diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5800638 --- /dev/null +++ b/LICENSE @@ -0,0 +1,23 @@ +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the Rails Dog LLC nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/README.markdown b/README.md similarity index 64% rename from README.markdown rename to README.md index efa6b8e..37018ad 100644 --- a/README.markdown +++ b/README.md @@ -23,12 +23,5 @@ Editing FAQs =========== 1. Login to Administraton Console -2. Click on Configuration -3. Click on the Frequently Asked Questions link +2. Click on FAQ -Loading Sample FAQs -============= - -There are sample FAQs loaded as part of the rake db:bootstrap task. - -See the sample data in db/sample. diff --git a/Rakefile b/Rakefile index 3b41ccc..5659284 100644 --- a/Rakefile +++ b/Rakefile @@ -1,120 +1,66 @@ -# I think this is the one that should be moved to the extension Rakefile template - -# In rails 1.2, plugins aren't available in the path until they're loaded. -# Check to see if the rspec plugin is installed first and require -# it if it is. If not, use the gem version. - -# Determine where the RSpec plugin is by loading the boot -unless defined? SPREE_ROOT - ENV["RAILS_ENV"] = "test" - case - when ENV["SPREE_ENV_FILE"] - require File.dirname(ENV["SPREE_ENV_FILE"]) + "/boot" - when File.dirname(__FILE__) =~ %r{vendor/SPREE/vendor/extensions} - require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../")}/config/boot" - else - require "#{File.expand_path(File.dirname(__FILE__) + "/../../../")}/config/boot" - end -end - +require 'rubygems' require 'rake' -require 'rake/rdoctask' require 'rake/testtask' +require 'rake/packagetask' +require 'rake/gempackagetask' -rspec_base = File.expand_path(SPREE_ROOT + '/vendor/plugins/rspec/lib') -$LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base) -require 'spec/rake/spectask' -# require 'spec/translator' +spec = eval(File.read('spree_faq.gemspec')) -# Cleanup the SPREE_ROOT constant so specs will load the environment -Object.send(:remove_const, :SPREE_ROOT) +Rake::GemPackageTask.new(spec) do |p| + p.gem_spec = spec +end -extension_root = File.expand_path(File.dirname(__FILE__)) +desc "Release to gemcutter" +task :release => :package do + require 'rake/gemcutter' + Rake::Gemcutter::Tasks.new(spec).define + Rake::Task['gem:push'].invoke +end -task :default => :spec -task :stats => "spec:statsetup" +desc "Default Task" +task :default => [ :spec ] -desc "Run all specs in spec directory" -Spec::Rake::SpecTask.new(:spec) do |t| - t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""] - t.spec_files = FileList["#{extension_root}/spec/**/*_spec.rb"] -end +require 'rspec/core/rake_task' +RSpec::Core::RakeTask.new -namespace :spec do - desc "Run all specs in spec directory with RCov" - Spec::Rake::SpecTask.new(:rcov) do |t| - t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""] - t.spec_files = FileList['spec/**/*_spec.rb'] - t.rcov = true - t.rcov_opts = ['--exclude', 'spec', '--rails'] - end - - desc "Print Specdoc for all specs" - Spec::Rake::SpecTask.new(:doc) do |t| - t.spec_opts = ["--format", "specdoc", "--dry-run"] - t.spec_files = FileList['spec/**/*_spec.rb'] - end +# require 'cucumber/rake/task' +# Cucumber::Rake::Task.new do |t| +# t.cucumber_opts = %w{--format pretty} +# end - [:models, :controllers, :views, :helpers].each do |sub| - desc "Run the specs under spec/#{sub}" - Spec::Rake::SpecTask.new(sub) do |t| - t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""] - t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"] +desc "Regenerates a rails 3 app for testing" +task :test_app do + SPREE_PATH = ENV['SPREE_PATH'] + raise "SPREE_PATH should be specified" unless SPREE_PATH + require File.join(SPREE_PATH, 'lib/generators/spree/test_app_generator') + class AuthTestAppGenerator < Spree::Generators::TestAppGenerator + def tweak_gemfile + append_file 'Gemfile' do + <<-gems + gem 'spree_core', :path => '#{File.join(SPREE_PATH, 'core')}' + gem 'spree_auth', :path => '#{File.join(SPREE_PATH, 'auth')}' + gem 'spree_faq', :path => '../..' + gems + end end - end - - # Hopefully no one has written their extensions in pre-0.9 style - # desc "Translate specs from pre-0.9 to 0.9 style" - # task :translate do - # translator = ::Spec::Translator.new - # dir = RAILS_ROOT + '/spec' - # translator.translate(dir, dir) - # end - # Setup specs for stats - task :statsetup do - require 'code_statistics' - ::STATS_DIRECTORIES << %w(Model\ specs spec/models) - ::STATS_DIRECTORIES << %w(View\ specs spec/views) - ::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers) - ::STATS_DIRECTORIES << %w(Helper\ specs spec/views) - ::CodeStatistics::TEST_TYPES << "Model specs" - ::CodeStatistics::TEST_TYPES << "View specs" - ::CodeStatistics::TEST_TYPES << "Controller specs" - ::CodeStatistics::TEST_TYPES << "Helper specs" - ::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/} - end + def install_gems + system("cd spec/test_app && rake spree_core:install") + system("cd spec/test_app && rake spree_auth:install") + generate 'spree_faq:install' + end - namespace :db do - namespace :fixtures do - desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y" - task :load => :environment do - require 'active_record/fixtures' - ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym) - (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(RAILS_ROOT, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file| - Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*')) - end - end + def migrate_db + run_migrations end end + AuthTestAppGenerator.start end -desc 'Generate documentation for the spree_faq extension.' -Rake::RDocTask.new(:rdoc) do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'SpreeFaqExtension' - rdoc.options << '--line-numbers' << '--inline-source' - rdoc.rdoc_files.include('README') - rdoc.rdoc_files.include('lib/**/*.rb') -end - -# For extensions that are in transition -desc 'Test the spree_faq extension.' -Rake::TestTask.new(:test) do |t| - t.libs << 'lib' - t.pattern = 'test/**/*_test.rb' - t.verbose = true +namespace :test_app do + desc 'Rebuild test and cucumber databases' + task :rebuild_dbs do + system("cd spec/test_app && rake db:drop db:migrate RAILS_ENV=test") + end end -# Load any custom rakefiles for extension -Dir[File.dirname(__FILE__) + '/tasks/*.rake'].sort.each { |f| require f } \ No newline at end of file diff --git a/app/controllers/faqs_controller.rb b/app/controllers/faqs_controller.rb index 3ff0344..41b462f 100644 --- a/app/controllers/faqs_controller.rb +++ b/app/controllers/faqs_controller.rb @@ -5,10 +5,6 @@ def index @categories = QuestionCategory.all :include => :questions end - def show - @question = Question.find(params[:id]) - end - def default_title I18n.t 'frequently_asked_questions' end diff --git a/app/helpers/admin/question_categories_helper.rb b/app/helpers/admin/question_categories_helper.rb deleted file mode 100644 index 6e1d95d..0000000 --- a/app/helpers/admin/question_categories_helper.rb +++ /dev/null @@ -1,12 +0,0 @@ -module Admin::QuestionCategoriesHelper - def add_question_link(name) - link_to_function name do |page| - page << %{ - var new_question_id = "new_" + new Date().getTime(); - jQuery('#questions').append(new_question_html.replace(/new_\\d+/g, new_question_id)); - jQuery().scrollTo(jQuery('#questions .question:last'), 800); - } - end - end - -end diff --git a/app/helpers/faqs_helper.rb b/app/helpers/faqs_helper.rb deleted file mode 100644 index d36ed48..0000000 --- a/app/helpers/faqs_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module FaqsHelper -end diff --git a/app/views/admin/question_categories/edit.html.erb b/app/views/admin/question_categories/edit.html.erb index 6d44754..e9aa143 100644 --- a/app/views/admin/question_categories/edit.html.erb +++ b/app/views/admin/question_categories/edit.html.erb @@ -2,13 +2,14 @@ <%= javascript_include_tag 'jquery.scrollTo-min' %> <%= stylesheet_link_tag 'spree_faq' %> <% end %> -<% form_for @question_category, :url => object_path do |f| %> - <% javascript_tag do %> +<%= form_for @question_category, :url => object_path do |f| %> + <%= render "shared/error_messages", :target => f.object %> + <%= javascript_tag do %> var new_question_html = '<%= generate_template(f, :questions) %>'; jQuery(document).ready(function($) { $('#new_question_link').click(function() { - $('#questions').append(new_question_html); + $('#questions').append(new_question_html.replace(/NEW_RECORD/g, $('#questions .question').size())); $('#questions .question:last .remove').click(function() { $(this).parent('.question').remove(); }); @@ -24,7 +25,7 @@
- <% f.field_container :name do %> + <%= f.field_container :name do %> <%= f.label :name, t("category_name") %> *
<%= f.text_field :name, :class => 'fullwidth title' %> <%= f.error_message_on :name %> @@ -34,12 +35,12 @@

Questions

<%= link_to_with_icon 'add', t('add_question'), '#', :id => 'new_question_link' %> - <% f.fields_for :questions do |question_form| %> + <%= f.fields_for :questions do |question_form| %> <%= render :partial => 'question', :locals => {:f => question_form } %> <% end %>
- <%= f.submit %> + <%= render :partial => 'admin/shared/edit_resource_links' %>
diff --git a/app/views/admin/question_categories/index.html.erb b/app/views/admin/question_categories/index.html.erb index 4411838..bed639e 100644 --- a/app/views/admin/question_categories/index.html.erb +++ b/app/views/admin/question_categories/index.html.erb @@ -1,32 +1,39 @@

-<%= image_tag "spinner.gif", :plugin=>"spree", :style => "display:none", :id => 'busy_indicator' %> -
+
-

Question Categories

+

<%= t("question_categories") %>

- + <%= hook :admin_question_categories_index_headers do %> + <% @question_categories.each do |category| %> - - - + + <%- locals = {:category => category} %> + <%= hook :admin_question_categories_index_rows, locals do %> + + + <% end %> <% end %> diff --git a/app/views/admin/question_categories/new.html.erb b/app/views/admin/question_categories/new.html.erb index ad694b8..3a2c586 100644 --- a/app/views/admin/question_categories/new.html.erb +++ b/app/views/admin/question_categories/new.html.erb @@ -1,11 +1,11 @@ -<%= error_messages_for :question_category %> -<% form_for @question_category, :url => collection_path do |f| %> +<%= form_for @question_category, :url => collection_path do |f| %> + <%= render "shared/error_messages", :target => f.object %>
- <% f.field_container :name do %> + <%= f.field_container :name do %> <%= f.label :name, t("name") %> *
<%= f.text_field :name, :class => 'fullwidth title' %> <%= f.error_message_on :name %> <% end %> - <%= f.submit t("create_category") %> + <%= render :partial => 'admin/shared/new_resource_links' %>
<% end %> diff --git a/app/views/faqs/index.html.erb b/app/views/faqs/index.html.erb index 5d28e58..49857da 100644 --- a/app/views/faqs/index.html.erb +++ b/app/views/faqs/index.html.erb @@ -2,12 +2,14 @@
<% @categories.each do |category| %> -
+

<%= h category.name %>

-
-<% content_for :head do %> - <% javascript_tag do %> - $(document).ready(function() { +<%= content_for :head do %> + <%= javascript_tag do %> + $(function() { $('.answer').hide(); $('.question').click(function() { var id = $(this).attr('id').split('_')[1]; diff --git a/autotest/discover.rb b/autotest/discover.rb new file mode 100644 index 0000000..f421dc5 --- /dev/null +++ b/autotest/discover.rb @@ -0,0 +1,2 @@ +Autotest.add_discovery { "rails" } +Autotest.add_discovery { "rspec2" } diff --git a/config/locales/en-GB.yml b/config/locales/en-GB.yml index c97212c..dfd6de3 100644 --- a/config/locales/en-GB.yml +++ b/config/locales/en-GB.yml @@ -1,7 +1,8 @@ --- en: frequently_asked_questions: Frequently Asked Questions - question_categoriess: Frequently Asked Questions + question_categories_admin: FAQ + question_categories: Frequently Asked Questions new_question_category: New Category questions: Questions create_category: Create Category diff --git a/config/locales/en-US.yml b/config/locales/en-US.yml index 968bcfc..57c92e4 100644 --- a/config/locales/en-US.yml +++ b/config/locales/en-US.yml @@ -1,6 +1,7 @@ --- en: frequently_asked_questions: Frequently Asked Questions + question_categories_admin: FAQ question_categories: Frequently Asked Questions new_question_category: New Category questions: Questions diff --git a/config/routes.rb b/config/routes.rb index ca02de6..195ba7a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,7 @@ -map.resources :faq, :controller => 'faqs' +Rails.application.routes.draw do + match :faq, :to => 'faqs#index', :as => 'faq' -map.namespace :admin do |admin| - admin.resources :question_categories + namespace :admin do + resources :question_categories + end end diff --git a/db/sample/question_categories.yml b/db/sample/question_categories.yml deleted file mode 100644 index 48757b8..0000000 --- a/db/sample/question_categories.yml +++ /dev/null @@ -1,8 +0,0 @@ -sales: - name: Sales - -shipping: - name: Shipping - -billing: - name: Billing diff --git a/db/sample/questions.yml b/db/sample/questions.yml deleted file mode 100644 index f10ade2..0000000 --- a/db/sample/questions.yml +++ /dev/null @@ -1,39 +0,0 @@ -question_1: - question_category: sales - question: How much does it cost? - answer: Contact customer support - -question_2: - question_category: sales - question: Does it do X? - answer: Duh - -question_3: - question_category: sales - question: Can I return it? - answer: Maybe - -question_4: - question_category: shipping - question: How much does shipping cost? - answer: Contact customer support - -question_5: - question_category: shipping - question: What if it breaks? - answer: At your own risk - -question_6: - question_category: billing - question: Can I use VISA? - answer: Yes! - -question_7: - question_category: billing - question: Can I use PayPal? - answer: Yes! - -question_8: - question_category: billing - question: Can I use AMEX? - answer: Yes! diff --git a/faq_extension.rb b/faq_extension.rb deleted file mode 100644 index 4c648e3..0000000 --- a/faq_extension.rb +++ /dev/null @@ -1,20 +0,0 @@ -# Uncomment this if you reference any of your controllers in activate -# require_dependency 'application' - -class FaqExtension < Spree::Extension - version "1.0" - description "Describe your extension here" - url "http://yourwebsite.com/spree_faq" - - # Please use spree_faq/config/routes.rb instead for extension routes. - - # def self.require_gems(config) - # config.gem "gemname-goes-here", :version => '1.2.3' - # end - - def activate - end - -end - - diff --git a/faq_hooks.rb b/faq_hooks.rb deleted file mode 100644 index 4d6e877..0000000 --- a/faq_hooks.rb +++ /dev/null @@ -1,5 +0,0 @@ -class FaqHooks < Spree::ThemeSupport::HookListener - insert_after :admin_tabs do - %(<%= tab(:question_categories) %>) - end -end \ No newline at end of file diff --git a/lib/generators/spree_faq/install_generator.rb b/lib/generators/spree_faq/install_generator.rb new file mode 100644 index 0000000..8d47679 --- /dev/null +++ b/lib/generators/spree_faq/install_generator.rb @@ -0,0 +1,17 @@ +module SpreeFaq + module Generators + class InstallGenerator < Rails::Generators::Base + source_root File.expand_path("../../templates", __FILE__) + + desc "Configures your Rails application for use with spree_faq" + def copy_migrations + directory "db" + end + + def copy_public + directory "public" + end + + end + end +end diff --git a/db/migrate/20090526213535_create_questions.rb b/lib/generators/templates/db/migrate/20090526213535_create_questions.rb similarity index 100% rename from db/migrate/20090526213535_create_questions.rb rename to lib/generators/templates/db/migrate/20090526213535_create_questions.rb diff --git a/db/migrate/20090526213550_create_question_categories.rb b/lib/generators/templates/db/migrate/20090526213550_create_question_categories.rb similarity index 100% rename from db/migrate/20090526213550_create_question_categories.rb rename to lib/generators/templates/db/migrate/20090526213550_create_question_categories.rb diff --git a/public/javascripts/jquery.scrollTo-min.js b/lib/generators/templates/public/javascripts/jquery.scrollTo-min.js similarity index 100% rename from public/javascripts/jquery.scrollTo-min.js rename to lib/generators/templates/public/javascripts/jquery.scrollTo-min.js diff --git a/public/stylesheets/spree_faq.css b/lib/generators/templates/public/stylesheets/spree_faq.css similarity index 100% rename from public/stylesheets/spree_faq.css rename to lib/generators/templates/public/stylesheets/spree_faq.css diff --git a/lib/spree_faq.rb b/lib/spree_faq.rb new file mode 100644 index 0000000..2e308e0 --- /dev/null +++ b/lib/spree_faq.rb @@ -0,0 +1,3 @@ +require 'spree_core' +require 'spree_faq_hooks' +require 'spree_faq/engine' diff --git a/lib/spree_faq/engine.rb b/lib/spree_faq/engine.rb new file mode 100644 index 0000000..4d3eacd --- /dev/null +++ b/lib/spree_faq/engine.rb @@ -0,0 +1,12 @@ +require "spree_faq" + +module SpreeFaq + + class Engine < Rails::Engine + + def self.activate + end + + end + +end diff --git a/lib/spree_faq_hooks.rb b/lib/spree_faq_hooks.rb new file mode 100644 index 0000000..7c70ffc --- /dev/null +++ b/lib/spree_faq_hooks.rb @@ -0,0 +1,6 @@ +class SpreeFaqHooks < Spree::ThemeSupport::HookListener + insert_after :admin_tabs do + %(<%= tab(:question_categories, :label => :question_categories_admin) %>) + end +end + diff --git a/lib/tasks/faq_extension_tasks.rake b/lib/tasks/faq_extension_tasks.rake deleted file mode 100644 index dc59a7d..0000000 --- a/lib/tasks/faq_extension_tasks.rake +++ /dev/null @@ -1,30 +0,0 @@ -if Spree::Version::Major.to_i == 0 && Spree::Version::Minor.to_i < 9 && Spree::Version::Tiny.to_i <= 9 - namespace :db do - desc "Bootstrap your database for Spree." - task :bootstrap => :environment do - # load initial database fixtures (in db/sample/*.yml) into the current environment's database - ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym) - Dir.glob(File.join(FaqExtension.root, "db", 'sample', '*.{yml,csv}')).each do |fixture_file| - Fixtures.create_fixtures("#{FaqExtension.root}/db/sample", File.basename(fixture_file, '.*')) - end - end - end -end - -namespace :spree do - namespace :extensions do - namespace :faq do - desc "Copies public assets of the Spree Faq to the instance public/ directory." - task :update => :environment do - is_svn_git_or_dir = proc {|path| path =~ /\.svn/ || path =~ /\.git/ || File.directory?(path) } - Dir[FaqExtension.root + "/public/**/*"].reject(&is_svn_git_or_dir).each do |file| - path = file.sub(FaqExtension.root, '') - directory = File.dirname(path) - puts "Copying #{path}..." - mkdir_p RAILS_ROOT + directory - cp file, RAILS_ROOT + path - end - end - end - end -end diff --git a/spec/controllers/faqs_controller_spec.rb b/spec/controllers/faqs_controller_spec.rb index a93f84b..5b2f967 100644 --- a/spec/controllers/faqs_controller_spec.rb +++ b/spec/controllers/faqs_controller_spec.rb @@ -11,13 +11,4 @@ response.should be_success end - it "should response to show" do - Question.should_receive(:find).with('1').and_return(:question) - - get :show, :id => 1 - - assigns(:question).should eql(:question) - response.should be_success - end - end diff --git a/spec/helpers/admin/question_categories_helper_spec.rb b/spec/helpers/admin/question_categories_helper_spec.rb deleted file mode 100644 index a1d21d7..0000000 --- a/spec/helpers/admin/question_categories_helper_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require File.dirname(__FILE__) + '/../../spec_helper' - -describe Admin::QuestionCategoriesHelper do - -end diff --git a/spec/helpers/faqs_helper_spec.rb b/spec/helpers/faqs_helper_spec.rb deleted file mode 100644 index 1d2dec9..0000000 --- a/spec/helpers/faqs_helper_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require File.dirname(__FILE__) + '/../spec_helper' - -describe FaqsHelper do - -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ffde315..c82b72d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,37 +1,28 @@ -unless defined? SPREE_ROOT - ENV["RAILS_ENV"] = "test" - case - when ENV["SPREE_ENV_FILE"] - require ENV["SPREE_ENV_FILE"] - when File.dirname(__FILE__) =~ %r{vendor/SPREE/vendor/extensions} - require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../../")}/config/environment" - else - require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../")}/config/environment" - end -end -require "#{SPREE_ROOT}/spec/spec_helper" +# This file is copied to ~/spec when you run 'ruby script/generate rspec' +# from the project root directory. +ENV["RAILS_ENV"] ||= 'test' +require File.expand_path("../test_app/config/environment", __FILE__) +require 'rspec/rails' -if File.directory?(File.dirname(__FILE__) + "/scenarios") - Scenario.load_paths.unshift File.dirname(__FILE__) + "/scenarios" -end -if File.directory?(File.dirname(__FILE__) + "/matchers") - Dir[File.dirname(__FILE__) + "/matchers/*.rb"].each {|file| require file } -end +# Requires supporting files with custom matchers and macros, etc, +# in ./support/ and its subdirectories. +Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} -Spec::Runner.configure do |config| - # config.use_transactional_fixtures = true - # config.use_instantiated_fixtures = false - # config.fixture_path = RAILS_ROOT + '/spec/fixtures' - - # You can declare fixtures for each behaviour like this: - # describe "...." do - # fixtures :table_a, :table_b - # - # Alternatively, if you prefer to declare them only once, you can - # do so here, like so ... +RSpec.configure do |config| + # == Mock Framework # - # config.global_fixtures = :table_a, :table_b + # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: # - # If you declare global fixtures, be aware that they will be declared - # for all of your examples, even those that don't use them. -end \ No newline at end of file + # config.mock_with :mocha + # config.mock_with :flexmock + # config.mock_with :rr + config.mock_with :rspec + + config.fixture_path = "#{::Rails.root}/spec/fixtures" + + # If you're not using ActiveRecord, or you'd prefer not to run each of your + # examples within a transaction, comment the following line or assign false + # instead of true. + config.use_transactional_fixtures = true +end + diff --git a/spec/test_app/Gemfile b/spec/test_app/Gemfile new file mode 100644 index 0000000..87b0d0b --- /dev/null +++ b/spec/test_app/Gemfile @@ -0,0 +1,19 @@ +source 'http://rubygems.org' + +gem 'rails', '~> 3.0.1' +gem 'sqlite3-ruby', :require => 'sqlite3' + +group :test do + gem 'rspec-rails', '~> 2.1.0' + gem 'fabrication' +end + +group :cucumber do + gem 'cucumber-rails', '~> 0.3.2' + gem 'database_cleaner', '~> 0.5.2' + gem 'capybara', '~> 0.3.9', :require => false +end + + gem 'spree_core', :path => '/home/josh/Playground/spree/core' + gem 'spree_auth', :path => '/home/josh/Playground/spree/auth' + gem 'spree_faq', :path => '../..' diff --git a/spec/test_app/Gemfile.lock b/spec/test_app/Gemfile.lock new file mode 100644 index 0000000..e99f2b7 --- /dev/null +++ b/spec/test_app/Gemfile.lock @@ -0,0 +1,188 @@ +PATH + remote: /home/josh/Playground/spree-faq + specs: + spree_faq (3.0.2) + spree_core (>= 0.30.1) + +PATH + remote: /home/josh/Playground/spree/auth + specs: + spree_auth (0.30.1) + authlogic (= 2.1.6) + cancan (>= 1.3.3) + spree_core (= 0.30.1) + +PATH + remote: /home/josh/Playground/spree/core + specs: + spree_core (0.30.1) + activemerchant (>= 1.7.1) + acts_as_list (>= 0.1.2) + faker (>= 0.3.1) + highline (>= 1.5.1) + jquery-rails (>= 0.2.2) + paperclip (>= 2.3.1.1) + rails (>= 3.0.1) + rd_awesome_nested_set (>= 1.4.4) + rd_resource_controller + rd_searchlogic (>= 3.0.0.rc3) + rd_unobtrusive_date_picker (>= 0.1.0) + state_machine (>= 0.9.4) + stringex (>= 1.0.3) + will_paginate (>= 3.0.pre) + +GEM + remote: http://rubygems.org/ + specs: + abstract (1.0.0) + actionmailer (3.0.1) + actionpack (= 3.0.1) + mail (~> 2.2.5) + actionpack (3.0.1) + activemodel (= 3.0.1) + activesupport (= 3.0.1) + builder (~> 2.1.2) + erubis (~> 2.6.6) + i18n (~> 0.4.1) + rack (~> 1.2.1) + rack-mount (~> 0.6.12) + rack-test (~> 0.5.4) + tzinfo (~> 0.3.23) + activemerchant (1.9.0) + activesupport (>= 2.3.2) + braintree (>= 2.0.0) + builder (>= 2.0.0) + activemodel (3.0.1) + activesupport (= 3.0.1) + builder (~> 2.1.2) + i18n (~> 0.4.1) + activerecord (3.0.1) + activemodel (= 3.0.1) + activesupport (= 3.0.1) + arel (~> 1.0.0) + tzinfo (~> 0.3.23) + activeresource (3.0.1) + activemodel (= 3.0.1) + activesupport (= 3.0.1) + activesupport (3.0.1) + acts_as_list (0.1.2) + arel (1.0.1) + activesupport (~> 3.0.0) + authlogic (2.1.6) + activesupport + braintree (2.6.2) + builder + builder (2.1.2) + cancan (1.4.1) + capybara (0.3.9) + culerity (>= 0.2.4) + mime-types (>= 1.16) + nokogiri (>= 1.3.3) + rack (>= 1.0.0) + rack-test (>= 0.5.4) + selenium-webdriver (>= 0.0.3) + childprocess (0.1.4) + ffi (~> 0.6.3) + cucumber (0.9.4) + builder (~> 2.1.2) + diff-lcs (~> 1.1.2) + gherkin (~> 2.2.9) + json (~> 1.4.6) + term-ansicolor (~> 1.0.5) + cucumber-rails (0.3.2) + cucumber (>= 0.8.0) + culerity (0.2.12) + database_cleaner (0.5.2) + diff-lcs (1.1.2) + erubis (2.6.6) + abstract (>= 1.0.0) + fabrication (0.9.1) + faker (0.3.1) + ffi (0.6.3) + rake (>= 0.8.7) + gherkin (2.2.9) + json (~> 1.4.6) + term-ansicolor (~> 1.0.5) + highline (1.6.1) + i18n (0.4.2) + jquery-rails (0.2.5) + rails (~> 3.0) + thor (~> 0.14.4) + json (1.4.6) + json_pure (1.4.6) + mail (2.2.10) + activesupport (>= 2.3.6) + i18n (~> 0.4.1) + mime-types (~> 1.16) + treetop (~> 1.4.8) + mime-types (1.16) + nokogiri (1.4.4) + paperclip (2.3.5) + activerecord + activesupport + polyglot (0.3.1) + rack (1.2.1) + rack-mount (0.6.13) + rack (>= 1.0.0) + rack-test (0.5.6) + rack (>= 1.0) + rails (3.0.1) + actionmailer (= 3.0.1) + actionpack (= 3.0.1) + activerecord (= 3.0.1) + activeresource (= 3.0.1) + activesupport (= 3.0.1) + bundler (~> 1.0.0) + railties (= 3.0.1) + railties (3.0.1) + actionpack (= 3.0.1) + activesupport (= 3.0.1) + rake (>= 0.8.4) + thor (~> 0.14.0) + rake (0.8.7) + rd_awesome_nested_set (1.4.4) + activerecord (>= 1.1) + rd_resource_controller (1.0.0) + rd_searchlogic (3.0.0.rc4) + activerecord (>= 3.0.0) + rd_unobtrusive_date_picker (0.1.0) + rspec (2.1.0) + rspec-core (~> 2.1.0) + rspec-expectations (~> 2.1.0) + rspec-mocks (~> 2.1.0) + rspec-core (2.1.0) + rspec-expectations (2.1.0) + diff-lcs (~> 1.1.2) + rspec-mocks (2.1.0) + rspec-rails (2.1.0) + rspec (~> 2.1.0) + rubyzip (0.9.4) + selenium-webdriver (0.1.0) + childprocess (= 0.1.4) + ffi (~> 0.6.3) + json_pure + rubyzip + sqlite3-ruby (1.3.2) + state_machine (0.9.4) + stringex (1.2.0) + term-ansicolor (1.0.5) + thor (0.14.6) + treetop (1.4.9) + polyglot (>= 0.3.1) + tzinfo (0.3.23) + will_paginate (3.0.pre2) + +PLATFORMS + ruby + +DEPENDENCIES + capybara (~> 0.3.9) + cucumber-rails (~> 0.3.2) + database_cleaner (~> 0.5.2) + fabrication + rails (~> 3.0.1) + rspec-rails (~> 2.1.0) + spree_auth! + spree_core! + spree_faq! + sqlite3-ruby diff --git a/spec/test_app/Rakefile b/spec/test_app/Rakefile new file mode 100644 index 0000000..685f6bc --- /dev/null +++ b/spec/test_app/Rakefile @@ -0,0 +1,7 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require File.expand_path('../config/application', __FILE__) +require 'rake' + +TestApp::Application.load_tasks diff --git a/spec/test_app/app/controllers/application_controller.rb b/spec/test_app/app/controllers/application_controller.rb new file mode 100644 index 0000000..e8065d9 --- /dev/null +++ b/spec/test_app/app/controllers/application_controller.rb @@ -0,0 +1,3 @@ +class ApplicationController < ActionController::Base + protect_from_forgery +end diff --git a/spec/test_app/app/helpers/application_helper.rb b/spec/test_app/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/spec/test_app/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/spec/test_app/app/views/layouts/application.html.erb b/spec/test_app/app/views/layouts/application.html.erb new file mode 100644 index 0000000..92e4534 --- /dev/null +++ b/spec/test_app/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + + + TestApp + <%= stylesheet_link_tag :all %> + <%= javascript_include_tag :defaults %> + <%= csrf_meta_tag %> + + + +<%= yield %> + + + diff --git a/spec/test_app/config.ru b/spec/test_app/config.ru new file mode 100644 index 0000000..86a587d --- /dev/null +++ b/spec/test_app/config.ru @@ -0,0 +1,4 @@ +# This file is used by Rack-based servers to start the application. + +require ::File.expand_path('../config/environment', __FILE__) +run TestApp::Application diff --git a/spec/test_app/config/application.rb b/spec/test_app/config/application.rb new file mode 100644 index 0000000..a117d09 --- /dev/null +++ b/spec/test_app/config/application.rb @@ -0,0 +1,42 @@ +require File.expand_path('../boot', __FILE__) + +require 'rails/all' + +# If you have a Gemfile, require the gems listed there, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(:default, Rails.env) if defined?(Bundler) + +module TestApp + class Application < Rails::Application + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + + # Custom directories with classes and modules you want to be autoloadable. + # config.autoload_paths += %W(#{config.root}/extras) + + # Only load the plugins named here, in the order given (default is alphabetical). + # :all can be used as a placeholder for all plugins not explicitly named. + # config.plugins = [ :exception_notification, :ssl_requirement, :all ] + + # Activate observers that should always be running. + # config.active_record.observers = :cacher, :garbage_collector, :forum_observer + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de + + # JavaScript files you want as :defaults (application.js is always included). + config.action_view.javascript_expansions[:defaults] = %w() + + # Configure the default encoding used in templates for Ruby 1.9. + config.encoding = "utf-8" + + # Configure sensitive parameters which will be filtered from the log file. + config.filter_parameters += [:password] + end +end diff --git a/spec/test_app/config/boot.rb b/spec/test_app/config/boot.rb new file mode 100644 index 0000000..ab6cb37 --- /dev/null +++ b/spec/test_app/config/boot.rb @@ -0,0 +1,13 @@ +require 'rubygems' + +# Set up gems listed in the Gemfile. +gemfile = File.expand_path('../../Gemfile', __FILE__) +begin + ENV['BUNDLE_GEMFILE'] = gemfile + require 'bundler' + Bundler.setup +rescue Bundler::GemNotFound => e + STDERR.puts e.message + STDERR.puts "Try running `bundle install`." + exit! +end if File.exist?(gemfile) diff --git a/spec/test_app/config/database.yml b/spec/test_app/config/database.yml new file mode 100644 index 0000000..4836b04 --- /dev/null +++ b/spec/test_app/config/database.yml @@ -0,0 +1,17 @@ +development: + adapter: sqlite3 + database: db/cucumber.sqlite3 + pool: 5 + timeout: 5000 + +test: + adapter: sqlite3 + database: db/test.sqlite3 + pool: 5 + timeout: 5000 + +cucumber: + adapter: sqlite3 + database: db/cucumber.sqlite3 + pool: 5 + timeout: 5000 diff --git a/spec/test_app/config/environment.rb b/spec/test_app/config/environment.rb new file mode 100644 index 0000000..f4cc1e4 --- /dev/null +++ b/spec/test_app/config/environment.rb @@ -0,0 +1,5 @@ +# Load the rails application +require File.expand_path('../application', __FILE__) + +# Initialize the rails application +TestApp::Application.initialize! diff --git a/spec/test_app/config/environments/cucumber.rb b/spec/test_app/config/environments/cucumber.rb new file mode 100644 index 0000000..132dc8d --- /dev/null +++ b/spec/test_app/config/environments/cucumber.rb @@ -0,0 +1,38 @@ +TestApp::Application.configure do + # Settings specified here will take precedence over those in config/environment.rb + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Log error messages when you accidentally call methods on nil. + config.whiny_nils = true + + # Show full error reports and disable caching + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment + config.action_controller.allow_forgery_protection = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Use SQL instead of Active Record's schema dumper when creating the test database. + # This is necessary if your schema can't be completely dumped by the schema dumper, + # like if you have constraints or database-specific column types + # config.active_record.schema_format = :sql + + # Print deprecation notices to the stderr + config.active_support.deprecation = :stderr + + config.action_mailer.default_url_options = { :host => 'testapp.com' } + +end diff --git a/spec/test_app/config/environments/development.rb b/spec/test_app/config/environments/development.rb new file mode 100644 index 0000000..1967636 --- /dev/null +++ b/spec/test_app/config/environments/development.rb @@ -0,0 +1,26 @@ +TestApp::Application.configure do + # Settings specified here will take precedence over those in config/environment.rb + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the webserver when you make code changes. + config.cache_classes = false + + # Log error messages when you accidentally call methods on nil. + config.whiny_nils = true + + # Show full error reports and disable caching + config.consider_all_requests_local = true + config.action_view.debug_rjs = true + config.action_controller.perform_caching = false + + # Don't care if the mailer can't send + config.action_mailer.raise_delivery_errors = false + + # Print deprecation notices to the Rails logger + config.active_support.deprecation = :log + + # Only use best-standards-support built into browsers + config.action_dispatch.best_standards_support = :builtin +end + diff --git a/spec/test_app/config/environments/production.rb b/spec/test_app/config/environments/production.rb new file mode 100644 index 0000000..dde1633 --- /dev/null +++ b/spec/test_app/config/environments/production.rb @@ -0,0 +1,49 @@ +TestApp::Application.configure do + # Settings specified here will take precedence over those in config/environment.rb + + # The production environment is meant for finished, "live" apps. + # Code is not reloaded between requests + config.cache_classes = true + + # Full error reports are disabled and caching is turned on + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Specifies the header that your server uses for sending files + config.action_dispatch.x_sendfile_header = "X-Sendfile" + + # For nginx: + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' + + # If you have no front-end server that supports something like X-Sendfile, + # just comment this out and Rails will serve the files + + # See everything in the log (default is :info) + # config.log_level = :debug + + # Use a different logger for distributed setups + # config.logger = SyslogLogger.new + + # Use a different cache store in production + # config.cache_store = :mem_cache_store + + # Disable Rails's static asset server + # In production, Apache or nginx will already do this + config.serve_static_assets = false + + # Enable serving of images, stylesheets, and javascripts from an asset server + # config.action_controller.asset_host = "http://assets.example.com" + + # Disable delivery errors, bad email addresses will be ignored + # config.action_mailer.raise_delivery_errors = false + + # Enable threaded mode + # config.threadsafe! + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation can not be found) + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners + config.active_support.deprecation = :notify +end diff --git a/spec/test_app/config/environments/test.rb b/spec/test_app/config/environments/test.rb new file mode 100644 index 0000000..1dafdec --- /dev/null +++ b/spec/test_app/config/environments/test.rb @@ -0,0 +1,62 @@ +TestApp::Application.configure do + # Settings specified here will take precedence over those in config/environment.rb + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Log error messages when you accidentally call methods on nil. + config.whiny_nils = true + + # Show full error reports and disable caching + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment + config.action_controller.allow_forgery_protection = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Use SQL instead of Active Record's schema dumper when creating the test database. + # This is necessary if your schema can't be completely dumped by the schema dumper, + # like if you have constraints or database-specific column types + # config.active_record.schema_format = :sql + + # Print deprecation notices to the stderr + config.active_support.deprecation = :stderr +end +CART = "cart" +ADDRESS = "address" +DELIVERY = "delivery" +PAYMENT = "payment" +CONFIRM = "confirm" +COMPLETE = "complete" +CANCELED = "canceled" +RETURNED = "returned" +RETURN_AUTHORIZED = "awaiting_return" + +ORDER_STATES = [CART, ADDRESS, DELIVERY, PAYMENT, CONFIRM, COMPLETE, CANCELED, RETURNED, RETURN_AUTHORIZED] + +READY = "ready" +SHIPPED = "shipped" +PARTIAL = "partial" +PENDING = "pending" +BACKORDER = "backorder" + +SHIPMENT_STATES = [READY, SHIPPED, PARTIAL, PENDING, BACKORDER] + +PROCESSING = 'processing' +FAILED = 'failed' +COMPLETED = 'completed' +VOID = 'void' +CHECKOUT = 'checkout' + +PAYMENT_STATES = [CHECKOUT, PROCESSING, FAILED, COMPLETED, VOID, PENDING] diff --git a/spec/test_app/config/initializers/backtrace_silencers.rb b/spec/test_app/config/initializers/backtrace_silencers.rb new file mode 100644 index 0000000..59385cd --- /dev/null +++ b/spec/test_app/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/spec/test_app/config/initializers/inflections.rb b/spec/test_app/config/initializers/inflections.rb new file mode 100644 index 0000000..9e8b013 --- /dev/null +++ b/spec/test_app/config/initializers/inflections.rb @@ -0,0 +1,10 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format +# (all these examples are active by default): +# ActiveSupport::Inflector.inflections do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end diff --git a/spec/test_app/config/initializers/mime_types.rb b/spec/test_app/config/initializers/mime_types.rb new file mode 100644 index 0000000..72aca7e --- /dev/null +++ b/spec/test_app/config/initializers/mime_types.rb @@ -0,0 +1,5 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf +# Mime::Type.register_alias "text/html", :iphone diff --git a/spec/test_app/config/initializers/secret_token.rb b/spec/test_app/config/initializers/secret_token.rb new file mode 100644 index 0000000..2acf5bb --- /dev/null +++ b/spec/test_app/config/initializers/secret_token.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +TestApp::Application.config.secret_token = '4e01fa67d2f72ba99174c1fd23e054d380ba6daf59ee71d977aad664c94946d430045bfcfbb28ae615240ac75cfe808340603b201c13a0321744b78df66d830f' diff --git a/spec/test_app/config/initializers/session_store.rb b/spec/test_app/config/initializers/session_store.rb new file mode 100644 index 0000000..5a9809f --- /dev/null +++ b/spec/test_app/config/initializers/session_store.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +TestApp::Application.config.session_store :cookie_store, :key => '_test_app_session' + +# Use the database for sessions instead of the cookie-based default, +# which shouldn't be used to store highly confidential information +# (create the session table with "rake db:sessions:create") +# TestApp::Application.config.session_store :active_record_store diff --git a/spec/test_app/config/locales/en.yml b/spec/test_app/config/locales/en.yml new file mode 100644 index 0000000..a747bfa --- /dev/null +++ b/spec/test_app/config/locales/en.yml @@ -0,0 +1,5 @@ +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en: + hello: "Hello world" diff --git a/spec/test_app/config/routes.rb b/spec/test_app/config/routes.rb new file mode 100644 index 0000000..1c345fe --- /dev/null +++ b/spec/test_app/config/routes.rb @@ -0,0 +1,58 @@ +TestApp::Application.routes.draw do + # The priority is based upon order of creation: + # first created -> highest priority. + + # Sample of regular route: + # match 'products/:id' => 'catalog#view' + # Keep in mind you can assign values other than :controller and :action + + # Sample of named route: + # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase + # This route can be invoked with purchase_url(:id => product.id) + + # Sample resource route (maps HTTP verbs to controller actions automatically): + # resources :products + + # Sample resource route with options: + # resources :products do + # member do + # get 'short' + # post 'toggle' + # end + # + # collection do + # get 'sold' + # end + # end + + # Sample resource route with sub-resources: + # resources :products do + # resources :comments, :sales + # resource :seller + # end + + # Sample resource route with more complex sub-resources + # resources :products do + # resources :comments + # resources :sales do + # get 'recent', :on => :collection + # end + # end + + # Sample resource route within a namespace: + # namespace :admin do + # # Directs /admin/products/* to Admin::ProductsController + # # (app/controllers/admin/products_controller.rb) + # resources :products + # end + + # You can have the root of your site routed with "root" + # just remember to delete public/index.html. + # root :to => "welcome#index" + + # See how all your routes lay out with "rake routes" + + # This is a legacy wild controller route that's not recommended for RESTful applications. + # Note: This route will make all actions in every controller accessible via GET requests. + # match ':controller(/:action(/:id(.:format)))' +end diff --git a/spec/test_app/db/cucumber.sqlite3 b/spec/test_app/db/cucumber.sqlite3 new file mode 100644 index 0000000..c05a88c Binary files /dev/null and b/spec/test_app/db/cucumber.sqlite3 differ diff --git a/spec/test_app/db/default/countries.yml b/spec/test_app/db/default/countries.yml new file mode 100644 index 0000000..b74cd01 --- /dev/null +++ b/spec/test_app/db/default/countries.yml @@ -0,0 +1,1583 @@ +--- +countries_039: + name: Chad + iso3: TCD + iso: TD + iso_name: CHAD + id: "39" + numcode: "148" +countries_065: + name: Faroe Islands + iso3: FRO + iso: FO + iso_name: FAROE ISLANDS + id: "65" + numcode: "234" +countries_092: + name: India + iso3: IND + iso: IN + iso_name: INDIA + id: "92" + numcode: "356" +countries_146: + name: Nicaragua + iso3: NIC + iso: NI + iso_name: NICARAGUA + id: "146" + numcode: "558" +countries_172: + name: Saint Lucia + iso3: LCA + iso: LC + iso_name: SAINT LUCIA + id: "172" + numcode: "662" +countries_066: + name: Fiji + iso3: FJI + iso: FJ + iso_name: FIJI + id: "66" + numcode: "242" +countries_093: + name: Indonesia + iso3: IDN + iso: ID + iso_name: INDONESIA + id: "93" + numcode: "360" +countries_147: + name: Niger + iso3: NER + iso: NE + iso_name: NIGER + id: "147" + numcode: "562" +countries_173: + name: Saint Pierre and Miquelon + iso3: SPM + iso: PM + iso_name: SAINT PIERRE AND MIQUELON + id: "173" + numcode: "666" +countries_067: + name: Finland + iso3: FIN + iso: FI + iso_name: FINLAND + id: "67" + numcode: "246" +countries_148: + name: Nigeria + iso3: NGA + iso: NG + iso_name: NIGERIA + id: "148" + numcode: "566" +countries_174: + name: Saint Vincent and the Grenadines + iso3: VCT + iso: VC + iso_name: SAINT VINCENT AND THE GRENADINES + id: "174" + numcode: "670" +countries_068: + name: France + iso3: FRA + iso: FR + iso_name: FRANCE + id: "68" + numcode: "250" +countries_094: + name: Iran, Islamic Republic of + iso3: IRN + iso: IR + iso_name: IRAN, ISLAMIC REPUBLIC OF + id: "94" + numcode: "364" +countries_149: + name: Niue + iso3: NIU + iso: NU + iso_name: NIUE + id: "149" + numcode: "570" +countries_175: + name: Samoa + iso3: WSM + iso: WS + iso_name: SAMOA + id: "175" + numcode: "882" +countries_069: + name: French Guiana + iso3: GUF + iso: GF + iso_name: FRENCH GUIANA + id: "69" + numcode: "254" +countries_095: + name: Iraq + iso3: IRQ + iso: IQ + iso_name: IRAQ + id: "95" + numcode: "368" +countries_176: + name: San Marino + iso3: SMR + iso: SM + iso_name: SAN MARINO + id: "176" + numcode: "674" +countries_096: + name: Ireland + iso3: IRL + iso: IE + iso_name: IRELAND + id: "96" + numcode: "372" +countries_177: + name: Sao Tome and Principe + iso3: STP + iso: ST + iso_name: SAO TOME AND PRINCIPE + id: "177" + numcode: "678" +countries_097: + name: Israel + iso3: ISR + iso: IL + iso_name: ISRAEL + id: "97" + numcode: "376" +countries_178: + name: Saudi Arabia + iso3: SAU + iso: SA + iso_name: SAUDI ARABIA + id: "178" + numcode: "682" +countries_098: + name: Italy + iso3: ITA + iso: IT + iso_name: ITALY + id: "98" + numcode: "380" +countries_179: + name: Senegal + iso3: SEN + iso: SN + iso_name: SENEGAL + id: "179" + numcode: "686" +countries_099: + name: Jamaica + iso3: JAM + iso: JM + iso_name: JAMAICA + id: "99" + numcode: "388" +countries_100: + name: Japan + iso3: JPN + iso: JP + iso_name: JAPAN + id: "100" + numcode: "392" +countries_101: + name: Jordan + iso3: JOR + iso: JO + iso_name: JORDAN + id: "101" + numcode: "400" +countries_020: + name: Belgium + iso3: BEL + iso: BE + iso_name: BELGIUM + id: "20" + numcode: "56" +countries_021: + name: Belize + iso3: BLZ + iso: BZ + iso_name: BELIZE + id: "21" + numcode: "84" +countries_102: + name: Kazakhstan + iso3: KAZ + iso: KZ + iso_name: KAZAKHSTAN + id: "102" + numcode: "398" +countries_210: + name: Uganda + iso3: UGA + iso: UG + iso_name: UGANDA + id: "210" + numcode: "800" +countries_022: + name: Benin + iso3: BEN + iso: BJ + iso_name: BENIN + id: "22" + numcode: "204" +countries_103: + name: Kenya + iso3: KEN + iso: KE + iso_name: KENYA + id: "103" + numcode: "404" +countries_211: + name: Ukraine + iso3: UKR + iso: UA + iso_name: UKRAINE + id: "211" + numcode: "804" +countries_023: + name: Bermuda + iso3: BMU + iso: BM + iso_name: BERMUDA + id: "23" + numcode: "60" +countries_104: + name: Kiribati + iso3: KIR + iso: KI + iso_name: KIRIBATI + id: "104" + numcode: "296" +countries_130: + name: Mexico + iso3: MEX + iso: MX + iso_name: MEXICO + id: "130" + numcode: "484" +countries_212: + name: United Arab Emirates + iso3: ARE + iso: AE + iso_name: UNITED ARAB EMIRATES + id: "212" + numcode: "784" +countries_024: + name: Bhutan + iso3: BTN + iso: BT + iso_name: BHUTAN + id: "24" + numcode: "64" +countries_050: + name: Cuba + iso3: CUB + iso: CU + iso_name: CUBA + id: "50" + numcode: "192" +countries_105: + name: North Korea + iso3: PRK + iso: KP + iso_name: KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF + id: "105" + numcode: "408" +countries_131: + name: Micronesia, Federated States of + iso3: FSM + iso: FM + iso_name: MICRONESIA, FEDERATED STATES OF + id: "131" + numcode: "583" +countries_213: + name: United Kingdom + iso3: GBR + iso: GB + iso_name: UNITED KINGDOM + id: "213" + numcode: "826" +countries_025: + name: Bolivia + iso3: BOL + iso: BO + iso_name: BOLIVIA + id: "25" + numcode: "68" +countries_051: + name: Cyprus + iso3: CYP + iso: CY + iso_name: CYPRUS + id: "51" + numcode: "196" +countries_106: + name: South Korea + iso3: KOR + iso: KR + iso_name: KOREA, REPUBLIC OF + id: "106" + numcode: "410" +countries_132: + name: Moldova, Republic of + iso3: MDA + iso: MD + iso_name: MOLDOVA, REPUBLIC OF + id: "132" + numcode: "498" +countries_214: + name: United States + iso3: USA + iso: US + iso_name: UNITED STATES + id: "214" + numcode: "840" +countries_026: + name: Bosnia and Herzegovina + iso3: BIH + iso: BA + iso_name: BOSNIA AND HERZEGOVINA + id: "26" + numcode: "70" +countries_052: + name: Czech Republic + iso3: CZE + iso: CZ + iso_name: CZECH REPUBLIC + id: "52" + numcode: "203" +countries_107: + name: Kuwait + iso3: KWT + iso: KW + iso_name: KUWAIT + id: "107" + numcode: "414" +countries_133: + name: Monaco + iso3: MCO + iso: MC + iso_name: MONACO + id: "133" + numcode: "492" +countries_215: + name: Uruguay + iso3: URY + iso: UY + iso_name: URUGUAY + id: "215" + numcode: "858" +countries_027: + name: Botswana + iso3: BWA + iso: BW + iso_name: BOTSWANA + id: "27" + numcode: "72" +countries_053: + name: Denmark + iso3: DNK + iso: DK + iso_name: DENMARK + id: "53" + numcode: "208" +countries_080: + name: Guadeloupe + iso3: GLP + iso: GP + iso_name: GUADELOUPE + id: "80" + numcode: "312" +countries_108: + name: Kyrgyzstan + iso3: KGZ + iso: KG + iso_name: KYRGYZSTAN + id: "108" + numcode: "417" +countries_134: + name: Mongolia + iso3: MNG + iso: MN + iso_name: MONGOLIA + id: "134" + numcode: "496" +countries_160: + name: Philippines + iso3: PHL + iso: PH + iso_name: PHILIPPINES + id: "160" + numcode: "608" +countries_028: + name: Brazil + iso3: BRA + iso: BR + iso_name: BRAZIL + id: "28" + numcode: "76" +countries_054: + name: Djibouti + iso3: DJI + iso: DJ + iso_name: DJIBOUTI + id: "54" + numcode: "262" +countries_081: + name: Guam + iso3: GUM + iso: GU + iso_name: GUAM + id: "81" + numcode: "316" +countries_109: + name: Lao People's Democratic Republic + iso3: LAO + iso: LA + iso_name: LAO PEOPLE'S DEMOCRATIC REPUBLIC + id: "109" + numcode: "418" +countries_135: + name: Montserrat + iso3: MSR + iso: MS + iso_name: MONTSERRAT + id: "135" + numcode: "500" +countries_161: + name: Pitcairn + iso3: PCN + iso: PN + iso_name: PITCAIRN + id: "161" + numcode: "612" +countries_216: + name: Uzbekistan + iso3: UZB + iso: UZ + iso_name: UZBEKISTAN + id: "216" + numcode: "860" +countries_029: + name: Brunei Darussalam + iso3: BRN + iso: BN + iso_name: BRUNEI DARUSSALAM + id: "29" + numcode: "96" +countries_055: + name: Dominica + iso3: DMA + iso: DM + iso_name: DOMINICA + id: "55" + numcode: "212" +countries_082: + name: Guatemala + iso3: GTM + iso: GT + iso_name: GUATEMALA + id: "82" + numcode: "320" +countries_136: + name: Morocco + iso3: MAR + iso: MA + iso_name: MOROCCO + id: "136" + numcode: "504" +countries_162: + name: Poland + iso3: POL + iso: PL + iso_name: POLAND + id: "162" + numcode: "616" +countries_217: + name: Vanuatu + iso3: VUT + iso: VU + iso_name: VANUATU + id: "217" + numcode: "548" +countries_056: + name: Dominican Republic + iso3: DOM + iso: DO + iso_name: DOMINICAN REPUBLIC + id: "56" + numcode: "214" +countries_137: + name: Mozambique + iso3: MOZ + iso: MZ + iso_name: MOZAMBIQUE + id: "137" + numcode: "508" +countries_163: + name: Portugal + iso3: PRT + iso: PT + iso_name: PORTUGAL + id: "163" + numcode: "620" +countries_190: + name: Sudan + iso3: SDN + iso: SD + iso_name: SUDAN + id: "190" + numcode: "736" +countries_218: + name: Venezuela + iso3: VEN + iso: VE + iso_name: VENEZUELA + id: "218" + numcode: "862" +countries_057: + name: Ecuador + iso3: ECU + iso: EC + iso_name: ECUADOR + id: "57" + numcode: "218" +countries_083: + name: Guinea + iso3: GIN + iso: GN + iso_name: GUINEA + id: "83" + numcode: "324" +countries_138: + name: Myanmar + iso3: MMR + iso: MM + iso_name: MYANMAR + id: "138" + numcode: "104" +countries_164: + name: Puerto Rico + iso3: PRI + iso: PR + iso_name: PUERTO RICO + id: "164" + numcode: "630" +countries_191: + name: Suriname + iso3: SUR + iso: SR + iso_name: SURINAME + id: "191" + numcode: "740" +countries_219: + name: Viet Nam + iso3: VNM + iso: VN + iso_name: VIET NAM + id: "219" + numcode: "704" +countries_058: + name: Egypt + iso3: EGY + iso: EG + iso_name: EGYPT + id: "58" + numcode: "818" +countries_084: + name: Guinea-Bissau + iso3: GNB + iso: GW + iso_name: GUINEA-BISSAU + id: "84" + numcode: "624" +countries_139: + name: Namibia + iso3: NAM + iso: NA + iso_name: NAMIBIA + id: "139" + numcode: "516" +countries_165: + name: Qatar + iso3: QAT + iso: QA + iso_name: QATAR + id: "165" + numcode: "634" +countries_192: + name: Svalbard and Jan Mayen + iso3: SJM + iso: SJ + iso_name: SVALBARD AND JAN MAYEN + id: "192" + numcode: "744" +countries_059: + name: El Salvador + iso3: SLV + iso: SV + iso_name: EL SALVADOR + id: "59" + numcode: "222" +countries_085: + name: Guyana + iso3: GUY + iso: GY + iso_name: GUYANA + id: "85" + numcode: "328" +countries_166: + name: Reunion + iso3: REU + iso: RE + iso_name: REUNION + id: "166" + numcode: "638" +countries_086: + name: Haiti + iso3: HTI + iso: HT + iso_name: HAITI + id: "86" + numcode: "332" +countries_167: + name: Romania + iso3: ROM + iso: RO + iso_name: ROMANIA + id: "167" + numcode: "642" +countries_193: + name: Swaziland + iso3: SWZ + iso: SZ + iso_name: SWAZILAND + id: "193" + numcode: "748" +countries_087: + name: Holy See (Vatican City State) + iso3: VAT + iso: VA + iso_name: HOLY SEE (VATICAN CITY STATE) + id: "87" + numcode: "336" +countries_168: + name: Russian Federation + iso3: RUS + iso: RU + iso_name: RUSSIAN FEDERATION + id: "168" + numcode: "643" +countries_194: + name: Sweden + iso3: SWE + iso: SE + iso_name: SWEDEN + id: "194" + numcode: "752" +countries_088: + name: Honduras + iso3: HND + iso: HN + iso_name: HONDURAS + id: "88" + numcode: "340" +countries_169: + name: Rwanda + iso3: RWA + iso: RW + iso_name: RWANDA + id: "169" + numcode: "646" +countries_195: + name: Switzerland + iso3: CHE + iso: CH + iso_name: SWITZERLAND + id: "195" + numcode: "756" +countries_089: + name: Hong Kong + iso3: HKG + iso: HK + iso_name: HONG KONG + id: "89" + numcode: "344" +countries_196: + name: Syrian Arab Republic + iso3: SYR + iso: SY + iso_name: SYRIAN ARAB REPUBLIC + id: "196" + numcode: "760" +countries_197: + name: Taiwan + iso3: TWN + iso: TW + iso_name: TAIWAN, PROVINCE OF CHINA + id: "197" + numcode: "158" +countries_198: + name: Tajikistan + iso3: TJK + iso: TJ + iso_name: TAJIKISTAN + id: "198" + numcode: "762" +countries_199: + name: Tanzania, United Republic of + iso3: TZA + iso: TZ + iso_name: TANZANIA, UNITED REPUBLIC OF + id: "199" + numcode: "834" +countries_010: + name: Armenia + iso3: ARM + iso: AM + iso_name: ARMENIA + id: "10" + numcode: "51" +countries_011: + name: Aruba + iso3: ABW + iso: AW + iso_name: ARUBA + id: "11" + numcode: "533" +countries_012: + name: Australia + iso3: AUS + iso: AU + iso_name: AUSTRALIA + id: "12" + numcode: "36" +countries_200: + name: Thailand + iso3: THA + iso: TH + iso_name: THAILAND + id: "200" + numcode: "764" +countries_013: + name: Austria + iso3: AUT + iso: AT + iso_name: AUSTRIA + id: "13" + numcode: "40" +countries_120: + name: Madagascar + iso3: MDG + iso: MG + iso_name: MADAGASCAR + id: "120" + numcode: "450" +countries_201: + name: Togo + iso3: TGO + iso: TG + iso_name: TOGO + id: "201" + numcode: "768" +countries_014: + name: Azerbaijan + iso3: AZE + iso: AZ + iso_name: AZERBAIJAN + id: "14" + numcode: "31" +countries_040: + name: Chile + iso3: CHL + iso: CL + iso_name: CHILE + id: "40" + numcode: "152" +countries_121: + name: Malawi + iso3: MWI + iso: MW + iso_name: MALAWI + id: "121" + numcode: "454" +countries_202: + name: Tokelau + iso3: TKL + iso: TK + iso_name: TOKELAU + id: "202" + numcode: "772" +countries_015: + name: Bahamas + iso3: BHS + iso: BS + iso_name: BAHAMAS + id: "15" + numcode: "44" +countries_041: + name: China + iso3: CHN + iso: CN + iso_name: CHINA + id: "41" + numcode: "156" +countries_122: + name: Malaysia + iso3: MYS + iso: MY + iso_name: MALAYSIA + id: "122" + numcode: "458" +countries_203: + name: Tonga + iso3: TON + iso: TO + iso_name: TONGA + id: "203" + numcode: "776" +countries_016: + name: Bahrain + iso3: BHR + iso: BH + iso_name: BAHRAIN + id: "16" + numcode: "48" +countries_042: + name: Colombia + iso3: COL + iso: CO + iso_name: COLOMBIA + id: "42" + numcode: "170" +countries_123: + name: Maldives + iso3: MDV + iso: MV + iso_name: MALDIVES + id: "123" + numcode: "462" +countries_204: + name: Trinidad and Tobago + iso3: TTO + iso: TT + iso_name: TRINIDAD AND TOBAGO + id: "204" + numcode: "780" +countries_017: + name: Bangladesh + iso3: BGD + iso: BD + iso_name: BANGLADESH + id: "17" + numcode: "50" +countries_043: + name: Comoros + iso3: COM + iso: KM + iso_name: COMOROS + id: "43" + numcode: "174" +countries_070: + name: French Polynesia + iso3: PYF + iso: PF + iso_name: FRENCH POLYNESIA + id: "70" + numcode: "258" +countries_124: + name: Mali + iso3: MLI + iso: ML + iso_name: MALI + id: "124" + numcode: "466" +countries_150: + name: Norfolk Island + iso3: NFK + iso: NF + iso_name: NORFOLK ISLAND + id: "150" + numcode: "574" +countries_205: + name: Tunisia + iso3: TUN + iso: TN + iso_name: TUNISIA + id: "205" + numcode: "788" +countries_018: + name: Barbados + iso3: BRB + iso: BB + iso_name: BARBADOS + id: "18" + numcode: "52" +countries_044: + name: Congo + iso3: COG + iso: CG + iso_name: CONGO + id: "44" + numcode: "178" +countries_071: + name: Gabon + iso3: GAB + iso: GA + iso_name: GABON + id: "71" + numcode: "266" +countries_125: + name: Malta + iso3: MLT + iso: MT + iso_name: MALTA + id: "125" + numcode: "470" +countries_151: + name: Northern Mariana Islands + iso3: MNP + iso: MP + iso_name: NORTHERN MARIANA ISLANDS + id: "151" + numcode: "580" +countries_206: + name: Turkey + iso3: TUR + iso: TR + iso_name: TURKEY + id: "206" + numcode: "792" +countries_045: + name: Congo, the Democratic Republic of the + iso3: COD + iso: CD + iso_name: CONGO, THE DEMOCRATIC REPUBLIC OF THE + id: "45" + numcode: "180" +countries_126: + name: Marshall Islands + iso3: MHL + iso: MH + iso_name: MARSHALL ISLANDS + id: "126" + numcode: "584" +countries_152: + name: Norway + iso3: NOR + iso: "NO" + iso_name: NORWAY + id: "152" + numcode: "578" +countries_207: + name: Turkmenistan + iso3: TKM + iso: TM + iso_name: TURKMENISTAN + id: "207" + numcode: "795" +countries_019: + name: Belarus + iso3: BLR + iso: BY + iso_name: BELARUS + id: "19" + numcode: "112" +countries_046: + name: Cook Islands + iso3: COK + iso: CK + iso_name: COOK ISLANDS + id: "46" + numcode: "184" +countries_072: + name: Gambia + iso3: GMB + iso: GM + iso_name: GAMBIA + id: "72" + numcode: "270" +countries_127: + name: Martinique + iso3: MTQ + iso: MQ + iso_name: MARTINIQUE + id: "127" + numcode: "474" +countries_153: + name: Oman + iso3: OMN + iso: OM + iso_name: OMAN + id: "153" + numcode: "512" +countries_180: + name: Seychelles + iso3: SYC + iso: SC + iso_name: SEYCHELLES + id: "180" + numcode: "690" +countries_208: + name: Turks and Caicos Islands + iso3: TCA + iso: TC + iso_name: TURKS AND CAICOS ISLANDS + id: "208" + numcode: "796" +countries_073: + name: Georgia + iso3: GEO + iso: GE + iso_name: GEORGIA + id: "73" + numcode: "268" +countries_128: + name: Mauritania + iso3: MRT + iso: MR + iso_name: MAURITANIA + id: "128" + numcode: "478" +countries_154: + name: Pakistan + iso3: PAK + iso: PK + iso_name: PAKISTAN + id: "154" + numcode: "586" +countries_181: + name: Sierra Leone + iso3: SLE + iso: SL + iso_name: SIERRA LEONE + id: "181" + numcode: "694" +countries_209: + name: Tuvalu + iso3: TUV + iso: TV + iso_name: TUVALU + id: "209" + numcode: "798" +countries_047: + name: Costa Rica + iso3: CRI + iso: CR + iso_name: COSTA RICA + id: "47" + numcode: "188" +countries_074: + name: Germany + iso3: DEU + iso: DE + iso_name: GERMANY + id: "74" + numcode: "276" +countries_129: + name: Mauritius + iso3: MUS + iso: MU + iso_name: MAURITIUS + id: "129" + numcode: "480" +countries_155: + name: Palau + iso3: PLW + iso: PW + iso_name: PALAU + id: "155" + numcode: "585" +countries_048: + name: Cote D'Ivoire + iso3: CIV + iso: CI + iso_name: COTE D'IVOIRE + id: "48" + numcode: "384" +countries_156: + name: Panama + iso3: PAN + iso: PA + iso_name: PANAMA + id: "156" + numcode: "591" +countries_182: + name: Singapore + iso3: SGP + iso: SG + iso_name: SINGAPORE + id: "182" + numcode: "702" +countries_049: + name: Croatia + iso3: HRV + iso: HR + iso_name: CROATIA + id: "49" + numcode: "191" +countries_075: + name: Ghana + iso3: GHA + iso: GH + iso_name: GHANA + id: "75" + numcode: "288" +countries_157: + name: Papua New Guinea + iso3: PNG + iso: PG + iso_name: PAPUA NEW GUINEA + id: "157" + numcode: "598" +countries_183: + name: Slovakia + iso3: SVK + iso: SK + iso_name: SLOVAKIA + id: "183" + numcode: "703" +countries_076: + name: Gibraltar + iso3: GIB + iso: GI + iso_name: GIBRALTAR + id: "76" + numcode: "292" +countries_158: + name: Paraguay + iso3: PRY + iso: PY + iso_name: PARAGUAY + id: "158" + numcode: "600" +countries_184: + name: Slovenia + iso3: SVN + iso: SI + iso_name: SLOVENIA + id: "184" + numcode: "705" +countries_077: + name: Greece + iso3: GRC + iso: GR + iso_name: GREECE + id: "77" + numcode: "300" +countries_159: + name: Peru + iso3: PER + iso: PE + iso_name: PERU + id: "159" + numcode: "604" +countries_185: + name: Solomon Islands + iso3: SLB + iso: SB + iso_name: SOLOMON ISLANDS + id: "185" + numcode: "90" +countries_078: + name: Greenland + iso3: GRL + iso: GL + iso_name: GREENLAND + id: "78" + numcode: "304" +countries_186: + name: Somalia + iso3: SOM + iso: SO + iso_name: SOMALIA + id: "186" + numcode: "706" +countries_079: + name: Grenada + iso3: GRD + iso: GD + iso_name: GRENADA + id: "79" + numcode: "308" +countries_187: + name: South Africa + iso3: ZAF + iso: ZA + iso_name: SOUTH AFRICA + id: "187" + numcode: "710" +countries_188: + name: Spain + iso3: ESP + iso: ES + iso_name: SPAIN + id: "188" + numcode: "724" +countries_189: + name: Sri Lanka + iso3: LKA + iso: LK + iso_name: SRI LANKA + id: "189" + numcode: "144" +countries_001: + name: Afghanistan + iso3: AFG + iso: AF + iso_name: AFGHANISTAN + id: "1" + numcode: "4" +countries_002: + name: Albania + iso3: ALB + iso: AL + iso_name: ALBANIA + id: "2" + numcode: "8" +countries_003: + name: Algeria + iso3: DZA + iso: DZ + iso_name: ALGERIA + id: "3" + numcode: "12" +countries_110: + name: Latvia + iso3: LVA + iso: LV + iso_name: LATVIA + id: "110" + numcode: "428" +countries_004: + name: American Samoa + iso3: ASM + iso: AS + iso_name: AMERICAN SAMOA + id: "4" + numcode: "16" +countries_030: + name: Bulgaria + iso3: BGR + iso: BG + iso_name: BULGARIA + id: "30" + numcode: "100" +countries_111: + name: Lebanon + iso3: LBN + iso: LB + iso_name: LEBANON + id: "111" + numcode: "422" +countries_005: + name: Andorra + iso3: AND + iso: AD + iso_name: ANDORRA + id: "5" + numcode: "20" +countries_031: + name: Burkina Faso + iso3: BFA + iso: BF + iso_name: BURKINA FASO + id: "31" + numcode: "854" +countries_112: + name: Lesotho + iso3: LSO + iso: LS + iso_name: LESOTHO + id: "112" + numcode: "426" +countries_006: + name: Angola + iso3: AGO + iso: AO + iso_name: ANGOLA + id: "6" + numcode: "24" +countries_032: + name: Burundi + iso3: BDI + iso: BI + iso_name: BURUNDI + id: "32" + numcode: "108" +countries_113: + name: Liberia + iso3: LBR + iso: LR + iso_name: LIBERIA + id: "113" + numcode: "430" +countries_220: + name: Virgin Islands, British + iso3: VGB + iso: VG + iso_name: VIRGIN ISLANDS, BRITISH + id: "220" + numcode: "92" +countries_007: + name: Anguilla + iso3: AIA + iso: AI + iso_name: ANGUILLA + id: "7" + numcode: "660" +countries_033: + name: Cambodia + iso3: KHM + iso: KH + iso_name: CAMBODIA + id: "33" + numcode: "116" +countries_060: + name: Equatorial Guinea + iso3: GNQ + iso: GQ + iso_name: EQUATORIAL GUINEA + id: "60" + numcode: "226" +countries_114: + name: Libyan Arab Jamahiriya + iso3: LBY + iso: LY + iso_name: LIBYAN ARAB JAMAHIRIYA + id: "114" + numcode: "434" +countries_140: + name: Nauru + iso3: NRU + iso: NR + iso_name: NAURU + id: "140" + numcode: "520" +countries_221: + name: Virgin Islands, U.S. + iso3: VIR + iso: VI + iso_name: VIRGIN ISLANDS, U.S. + id: "221" + numcode: "850" +countries_008: + name: Antigua and Barbuda + iso3: ATG + iso: AG + iso_name: ANTIGUA AND BARBUDA + id: "8" + numcode: "28" +countries_034: + name: Cameroon + iso3: CMR + iso: CM + iso_name: CAMEROON + id: "34" + numcode: "120" +countries_115: + name: Liechtenstein + iso3: LIE + iso: LI + iso_name: LIECHTENSTEIN + id: "115" + numcode: "438" +countries_141: + name: Nepal + iso3: NPL + iso: NP + iso_name: NEPAL + id: "141" + numcode: "524" +countries_222: + name: Wallis and Futuna + iso3: WLF + iso: WF + iso_name: WALLIS AND FUTUNA + id: "222" + numcode: "876" +countries_223: + name: Western Sahara + iso3: ESH + iso: EH + iso_name: WESTERN SAHARA + id: "223" + numcode: "732" +countries_009: + name: Argentina + iso3: ARG + iso: AR + iso_name: ARGENTINA + id: "9" + numcode: "32" +countries_035: + name: Canada + iso3: CAN + iso: CA + iso_name: CANADA + id: "35" + numcode: "124" +countries_061: + name: Eritrea + iso3: ERI + iso: ER + iso_name: ERITREA + id: "61" + numcode: "232" +countries_116: + name: Lithuania + iso3: LTU + iso: LT + iso_name: LITHUANIA + id: "116" + numcode: "440" +countries_142: + name: Netherlands + iso3: NLD + iso: NL + iso_name: NETHERLANDS + id: "142" + numcode: "528" +countries_224: + name: Yemen + iso3: YEM + iso: YE + iso_name: YEMEN + id: "224" + numcode: "887" +countries_036: + name: Cape Verde + iso3: CPV + iso: CV + iso_name: CAPE VERDE + id: "36" + numcode: "132" +countries_062: + name: Estonia + iso3: EST + iso: EE + iso_name: ESTONIA + id: "62" + numcode: "233" +countries_117: + name: Luxembourg + iso3: LUX + iso: LU + iso_name: LUXEMBOURG + id: "117" + numcode: "442" +countries_143: + name: Netherlands Antilles + iso3: ANT + iso: AN + iso_name: NETHERLANDS ANTILLES + id: "143" + numcode: "530" +countries_170: + name: Saint Helena + iso3: SHN + iso: SH + iso_name: SAINT HELENA + id: "170" + numcode: "654" +countries_225: + name: Zambia + iso3: ZMB + iso: ZM + iso_name: ZAMBIA + id: "225" + numcode: "894" +countries_037: + name: Cayman Islands + iso3: CYM + iso: KY + iso_name: CAYMAN ISLANDS + id: "37" + numcode: "136" +countries_063: + name: Ethiopia + iso3: ETH + iso: ET + iso_name: ETHIOPIA + id: "63" + numcode: "231" +countries_090: + name: Hungary + iso3: HUN + iso: HU + iso_name: HUNGARY + id: "90" + numcode: "348" +countries_118: + name: Macao + iso3: MAC + iso: MO + iso_name: MACAO + id: "118" + numcode: "446" +countries_144: + name: New Caledonia + iso3: NCL + iso: NC + iso_name: NEW CALEDONIA + id: "144" + numcode: "540" +countries_226: + name: Zimbabwe + iso3: ZWE + iso: ZW + iso_name: ZIMBABWE + id: "226" + numcode: "716" +countries_038: + name: Central African Republic + iso3: CAF + iso: CF + iso_name: CENTRAL AFRICAN REPUBLIC + id: "38" + numcode: "140" +countries_064: + name: Falkland Islands (Malvinas) + iso3: FLK + iso: FK + iso_name: FALKLAND ISLANDS (MALVINAS) + id: "64" + numcode: "238" +countries_091: + name: Iceland + iso3: ISL + iso: IS + iso_name: ICELAND + id: "91" + numcode: "352" +countries_119: + name: Macedonia + iso3: MKD + iso: MK + iso_name: MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF + id: "119" + numcode: "807" +countries_145: + name: New Zealand + iso3: NZL + iso: NZ + iso_name: NEW ZEALAND + id: "145" + numcode: "554" +countries_171: + name: Saint Kitts and Nevis + iso3: KNA + iso: KN + iso_name: SAINT KITTS AND NEVIS + id: "171" + numcode: "659" diff --git a/spec/test_app/db/default/roles.yml b/spec/test_app/db/default/roles.yml new file mode 100644 index 0000000..96b0543 --- /dev/null +++ b/spec/test_app/db/default/roles.yml @@ -0,0 +1,7 @@ +admin_role: + id: 1 + name: admin + +user_role: + id: 2 + name: user \ No newline at end of file diff --git a/spec/test_app/db/default/states.yml b/spec/test_app/db/default/states.yml new file mode 100644 index 0000000..02b838d --- /dev/null +++ b/spec/test_app/db/default/states.yml @@ -0,0 +1,256 @@ +--- +states_043: + name: Michigan + country_id: "214" + id: "931624400" + abbr: MI +states_032: + name: South Dakota + country_id: "214" + id: "615306087" + abbr: SD +states_021: + name: Washington + country_id: "214" + id: "414569975" + abbr: WA +states_010: + name: Wisconsin + country_id: "214" + id: "103680699" + abbr: WI +states_044: + name: Arizona + country_id: "214" + id: "948208802" + abbr: AZ +states_033: + name: Illinois + country_id: "214" + id: "625629523" + abbr: IL +states_022: + name: New Hampshire + country_id: "214" + id: "426832442" + abbr: NH +states_011: + name: North Carolina + country_id: "214" + id: "177087202" + abbr: NC +states_045: + name: Kansas + country_id: "214" + id: "969722173" + abbr: KS +states_034: + name: Missouri + country_id: "214" + id: "653576146" + abbr: MO +states_023: + name: Arkansas + country_id: "214" + id: "471470972" + abbr: AR +states_012: + name: Nevada + country_id: "214" + id: "179539703" + abbr: NV +states_001: + name: District of Columbia + country_id: "214" + id: "6764998" + abbr: DC +states_046: + name: Idaho + country_id: "214" + id: "982433740" + abbr: ID +states_035: + name: Nebraska + country_id: "214" + id: "673350891" + abbr: NE +states_024: + name: Pennsylvania + country_id: "214" + id: "471711976" + abbr: PA +states_013: + name: Hawaii + country_id: "214" + id: "199950338" + abbr: HI +states_002: + name: Utah + country_id: "214" + id: "17199670" + abbr: UT +states_047: + name: Vermont + country_id: "214" + id: "989115415" + abbr: VT +states_036: + name: Delaware + country_id: "214" + id: "721598219" + abbr: DE +states_025: + name: Rhode Island + country_id: "214" + id: "474001862" + abbr: RI +states_014: + name: Oklahoma + country_id: "214" + id: "248548169" + abbr: OK +states_003: + name: Louisiana + country_id: "214" + id: "37199952" + abbr: LA +states_048: + name: Montana + country_id: "214" + id: "999156632" + abbr: MT +states_037: + name: Tennessee + country_id: "214" + id: "726305632" + abbr: TN +states_026: + name: Maryland + country_id: "214" + id: "480368357" + abbr: MD +states_015: + name: Florida + country_id: "214" + id: "267271847" + abbr: FL +states_004: + name: Virginia + country_id: "214" + id: "41111624" + abbr: VA +states_049: + name: Minnesota + country_id: "214" + id: "1032288924" + abbr: MN +states_038: + name: New Jersey + country_id: "214" + id: "750950030" + abbr: NJ +states_027: + name: Ohio + country_id: "214" + id: "485193526" + abbr: OH +states_016: + name: California + country_id: "214" + id: "276110813" + abbr: CA +states_005: + name: North Dakota + country_id: "214" + id: "51943165" + abbr: ND +states_050: + name: Maine + country_id: "214" + id: "1055056709" + abbr: ME +states_039: + name: Indiana + country_id: "214" + id: "769938586" + abbr: IN +states_028: + name: Texas + country_id: "214" + id: "525212995" + abbr: TX +states_017: + name: Oregon + country_id: "214" + id: "298914262" + abbr: OR +states_006: + name: Wyoming + country_id: "214" + id: "66390489" + abbr: WY +states_051: + name: Alabama + country_id: "214" + id: "1061493585" + abbr: AL +states_040: + name: Iowa + country_id: "214" + id: "825306985" + abbr: IA +states_029: + name: Mississippi + country_id: "214" + id: "532363768" + abbr: MS +states_018: + name: Kentucky + country_id: "214" + id: "308473843" + abbr: KY +states_007: + name: New Mexico + country_id: "214" + id: "69729944" + abbr: NM +states_041: + name: Georgia + country_id: "214" + id: "876916760" + abbr: GA +states_030: + name: Colorado + country_id: "214" + id: "536031023" + abbr: CO +states_019: + name: Massachusetts + country_id: "214" + id: "385551075" + abbr: MA +states_008: + name: Connecticut + country_id: "214" + id: "69870734" + abbr: CT +states_042: + name: New York + country_id: "214" + id: "889445952" + abbr: NY +states_031: + name: South Carolina + country_id: "214" + id: "597434151" + abbr: SC +states_020: + name: Alaska + country_id: "214" + id: "403740659" + abbr: AK +states_009: + name: West Virginia + country_id: "214" + id: "91367981" + abbr: WV diff --git a/spec/test_app/db/default/zone_members.yml b/spec/test_app/db/default/zone_members.yml new file mode 100644 index 0000000..9ce0290 --- /dev/null +++ b/spec/test_app/db/default/zone_members.yml @@ -0,0 +1,169 @@ +--- +zone_members_019: + zoneable_id: "162" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_008: + zoneable_id: "67" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_020: + zoneable_id: "163" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_021: + zoneable_id: "167" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_010: + zoneable_id: "74" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_009: + zoneable_id: "68" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_022: + zoneable_id: "183" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_011: + zoneable_id: "90" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_023: + zoneable_id: "184" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_012: + zoneable_id: "96" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_001: + zoneable_id: "13" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_024: + zoneable_id: "188" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_013: + zoneable_id: "98" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_002: + zoneable_id: "20" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_025: + zoneable_id: "194" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_014: + zoneable_id: "110" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_003: + zoneable_id: "30" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_026: + zoneable_id: "213" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_015: + zoneable_id: "116" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_004: + zoneable_id: "51" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_016: + zoneable_id: "117" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_005: + zoneable_id: "52" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_028: + zoneable_id: "214" + created_at: 2009-06-04 17:22:41 + updated_at: 2009-06-04 17:22:41 + zone_id: "2" + zoneable_type: Country +zone_members_017: + zoneable_id: "125" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_006: + zoneable_id: "53" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_029: + zoneable_id: "35" + created_at: 2009-06-04 17:22:41 + updated_at: 2009-06-04 17:22:41 + zone_id: "2" + zoneable_type: Country +zone_members_018: + zoneable_id: "142" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country +zone_members_007: + zoneable_id: "62" + created_at: 2009-06-04 13:22:26 + updated_at: 2009-06-04 13:22:26 + zone_id: "1" + zoneable_type: Country diff --git a/spec/test_app/db/default/zones.yml b/spec/test_app/db/default/zones.yml new file mode 100644 index 0000000..ed771d9 --- /dev/null +++ b/spec/test_app/db/default/zones.yml @@ -0,0 +1,13 @@ +--- +zones_001: + name: EU_VAT + created_at: 2009-06-04 17:22:26 + updated_at: 2009-06-04 17:22:26 + id: "1" + description: Countries that make up the EU VAT zone. +zones_002: + name: North America + created_at: 2009-06-04 17:22:41 + updated_at: 2009-06-04 17:22:41 + id: "2" + description: USA + Canada diff --git a/spec/test_app/db/migrate/20090526213535_create_questions.rb b/spec/test_app/db/migrate/20090526213535_create_questions.rb new file mode 100644 index 0000000..21c8590 --- /dev/null +++ b/spec/test_app/db/migrate/20090526213535_create_questions.rb @@ -0,0 +1,17 @@ +class CreateQuestions < ActiveRecord::Migration + def self.up + create_table :questions do |t| + t.integer :question_category_id + t.text :question + t.text :answer + t.integer :position + + + t.timestamps + end + end + + def self.down + drop_table :questions + end +end diff --git a/spec/test_app/db/migrate/20090526213550_create_question_categories.rb b/spec/test_app/db/migrate/20090526213550_create_question_categories.rb new file mode 100644 index 0000000..2a2ef1f --- /dev/null +++ b/spec/test_app/db/migrate/20090526213550_create_question_categories.rb @@ -0,0 +1,14 @@ +class CreateQuestionCategories < ActiveRecord::Migration + def self.up + create_table :question_categories do |t| + t.string :name + t.integer :position + + t.timestamps + end + end + + def self.down + drop_table :question_categories + end +end diff --git a/spec/test_app/db/migrate/20090823005402_spree_zero_nine_zero.rb b/spec/test_app/db/migrate/20090823005402_spree_zero_nine_zero.rb new file mode 100644 index 0000000..851a960 --- /dev/null +++ b/spec/test_app/db/migrate/20090823005402_spree_zero_nine_zero.rb @@ -0,0 +1,442 @@ +class SpreeZeroNineZero < ActiveRecord::Migration + # This is a legacy migration consolidating all of the database changes needed as of Spree 0.9.0 + # (See http://railsdog.lighthouseapp.com/projects/31096-spree/tickets/772) + + def self.up + create_table "addresses", :force => true do |t| + t.string "firstname" + t.string "lastname" + t.string "address1" + t.string "address2" + t.string "city" + t.integer "state_id" + t.string "zipcode" + t.integer "country_id" + t.string "phone" + t.datetime "created_at" + t.datetime "updated_at" + t.string "state_name" + t.string "alternative_phone" + end + + create_table "adjustments", :force => true do |t| + t.integer "order_id" + t.string "type" + t.decimal "amount", :precision => 8, :scale => 2, :default => 0.0, :null => false + t.string "description" + t.integer "position" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "adjustment_source_id" + t.string "adjustment_source_type" + t.string "secondary_type" + end + + create_table "assets", :force => true do |t| + t.integer "viewable_id" + t.string "viewable_type", :limit => 50 + t.string "attachment_content_type" + t.string "attachment_file_name" + t.integer "attachment_size" + t.integer "position" + t.string "type", :limit => 75 + t.datetime "attachment_updated_at" + t.integer "attachment_width" + t.integer "attachment_height" + end + + create_table "calculators", :force => true do |t| + t.string "type" + t.integer "calculable_id", :null => false + t.string "calculable_type", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "checkouts", :force => true do |t| + t.integer "order_id" + t.string "email" + t.string "ip_address" + t.text "special_instructions" + t.integer "bill_address_id" + t.datetime "completed_at" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "configurations", :force => true do |t| + t.string "name" + t.datetime "created_at" + t.datetime "updated_at" + t.string "type", :limit => 50 + end + + add_index "configurations", ["name", "type"], :name => "index_configurations_on_name_and_type" + + create_table "countries", :force => true do |t| + t.string "iso_name" + t.string "iso" + t.string "name" + t.string "iso3" + t.integer "numcode" + end + + create_table "coupons", :force => true do |t| + t.string "code" + t.string "description" + t.integer "usage_limit" + t.boolean "combine" + t.datetime "expires_at" + t.datetime "created_at" + t.datetime "updated_at" + t.datetime "starts_at" + end + + create_table "creditcard_txns", :force => true do |t| + t.integer "creditcard_payment_id" + t.decimal "amount", :precision => 8, :scale => 2, :default => 0.0, :null => false + t.integer "txn_type" + t.string "response_code" + t.text "avs_response" + t.text "cvv_response" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "creditcards", :force => true do |t| + t.text "number" + t.string "month" + t.string "year" + t.text "verification_value" + t.string "cc_type" + t.string "display_number" + t.string "first_name" + t.string "last_name" + t.datetime "created_at" + t.datetime "updated_at" + t.string "start_month" + t.string "start_year" + t.string "issue_number" + t.integer "address_id" + t.integer "checkout_id" + end + + create_table "gateway_configurations", :force => true do |t| + t.integer "gateway_id" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "gateway_option_values", :force => true do |t| + t.integer "gateway_configuration_id" + t.integer "gateway_option_id" + t.text "value" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "gateway_options", :force => true do |t| + t.string "name" + t.text "description" + t.integer "gateway_id" + t.boolean "textarea", :default => false + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "gateways", :force => true do |t| + t.string "clazz" + t.string "name" + t.text "description" + t.boolean "active" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "inventory_units", :force => true do |t| + t.integer "variant_id" + t.integer "order_id" + t.string "state" + t.integer "lock_version", :default => 0 + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "line_items", :force => true do |t| + t.integer "order_id" + t.integer "variant_id" + t.integer "quantity", :null => false + t.decimal "price", :precision => 8, :scale => 2, :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "line_items", ["order_id"], :name => "index_line_items_on_order_id" + add_index "line_items", ["variant_id"], :name => "index_line_items_on_variant_id" + + create_table "option_types", :force => true do |t| + t.string "name", :limit => 100 + t.string "presentation", :limit => 100 + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "option_types_prototypes", :id => false, :force => true do |t| + t.integer "prototype_id" + t.integer "option_type_id" + end + + create_table "option_values", :force => true do |t| + t.integer "option_type_id" + t.string "name" + t.integer "position" + t.string "presentation" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "option_values_variants", :id => false, :force => true do |t| + t.integer "variant_id" + t.integer "option_value_id" + end + + add_index "option_values_variants", ["variant_id"], :name => "index_option_values_variants_on_variant_id" + + create_table "orders", :force => true do |t| + t.integer "user_id" + t.string "number", :limit => 15 + t.decimal "item_total", :precision => 8, :scale => 2, :default => 0.0, :null => false + t.decimal "total", :precision => 8, :scale => 2, :default => 0.0, :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.string "state" + t.string "token" + t.decimal "adjustment_total", :precision => 8, :scale => 2, :default => 0.0, :null => false + t.decimal "credit_total", :precision => 8, :scale => 2, :default => 0.0, :null => false + end + + add_index "orders", ["number"], :name => "index_orders_on_number" + + create_table "payments", :force => true do |t| + t.integer "order_id" + t.datetime "created_at" + t.datetime "updated_at" + t.decimal "amount", :precision => 8, :scale => 2, :default => 0.0, :null => false + t.integer "creditcard_id" + t.string "type" + end + + create_table "preferences", :force => true do |t| + t.string "attribute", :null => false, :limit => 100 + t.integer "owner_id", :null => false, :limit => 30 + t.string "owner_type", :null => false, :limit => 50 + t.integer "group_id" + t.string "group_type", :limit => 50 + t.string "value" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "preferences", ["owner_id", "owner_type", "attribute", "group_id", "group_type"], :name => "index_preferences_on_owner_and_attribute_and_preference", :unique => true + + create_table "product_option_types", :force => true do |t| + t.integer "product_id" + t.integer "option_type_id" + t.integer "position" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "product_properties", :force => true do |t| + t.integer "product_id" + t.integer "property_id" + t.string "value" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "products", :force => true do |t| + t.string "name", :default => "", :null => false + t.text "description" + t.datetime "created_at" + t.datetime "updated_at" + t.string "permalink" + t.datetime "available_on" + t.integer "tax_category_id" + t.integer "shipping_category_id" + t.datetime "deleted_at" + t.string "meta_description" + t.string "meta_keywords" + end + + add_index "products", ["available_on"], :name => "index_products_on_available_on" + add_index "products", ["deleted_at"], :name => "index_products_on_deleted_at" + add_index "products", ["name"], :name => "index_products_on_name" + add_index "products", ["permalink"], :name => "index_products_on_permalink" + + create_table "products_taxons", :id => false, :force => true do |t| + t.integer "product_id" + t.integer "taxon_id" + end + + add_index "products_taxons", ["product_id"], :name => "index_products_taxons_on_product_id" + add_index "products_taxons", ["taxon_id"], :name => "index_products_taxons_on_taxon_id" + + create_table "properties", :force => true do |t| + t.string "name" + t.string "presentation", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "properties_prototypes", :id => false, :force => true do |t| + t.integer "prototype_id" + t.integer "property_id" + end + + create_table "prototypes", :force => true do |t| + t.string "name" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "roles", :force => true do |t| + t.string "name" + end + + create_table "roles_users", :id => false, :force => true do |t| + t.integer "role_id" + t.integer "user_id" + end + + add_index "roles_users", ["role_id"], :name => "index_roles_users_on_role_id" + add_index "roles_users", ["user_id"], :name => "index_roles_users_on_user_id" + + create_table "shipments", :force => true do |t| + t.integer "order_id" + t.integer "shipping_method_id" + t.string "tracking" + t.datetime "created_at" + t.datetime "updated_at" + t.string "number" + t.decimal "cost", :precision => 8, :scale => 2 + t.datetime "shipped_at" + t.integer "address_id" + end + + create_table "shipping_categories", :force => true do |t| + t.string "name" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "shipping_methods", :force => true do |t| + t.integer "zone_id" + t.string "name" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "state_events", :force => true do |t| + t.integer "order_id" + t.integer "user_id" + t.string "name" + t.datetime "created_at" + t.datetime "updated_at" + t.string "previous_state" + end + + create_table "states", :force => true do |t| + t.string "name" + t.string "abbr" + t.integer "country_id" + end + + create_table "tax_categories", :force => true do |t| + t.string "name" + t.string "description" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "tax_rates", :force => true do |t| + t.integer "zone_id" + t.decimal "amount", :precision => 8, :scale => 4 + t.datetime "created_at" + t.datetime "updated_at" + t.integer "tax_category_id" + end + + create_table "taxonomies", :force => true do |t| + t.string "name", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "taxons", :force => true do |t| + t.integer "taxonomy_id", :null => false + t.integer "parent_id" + t.integer "position", :default => 0 + t.string "name", :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.string "permalink" + end + + create_table "users", :force => true do |t| + t.string "email" + t.string "crypted_password", :limit => 128, :default => "", :null => false + t.string "salt", :limit => 128, :default => "", :null => false + t.string "remember_token" + t.string "remember_token_expires_at" + t.datetime "created_at" + t.datetime "updated_at" + t.string "persistence_token" + t.string "single_access_token" + t.string "perishable_token" + t.integer "login_count", :default => 0, :null => false + t.integer "failed_login_count", :default => 0, :null => false + t.datetime "last_request_at" + t.datetime "current_login_at" + t.datetime "last_login_at" + t.string "current_login_ip" + t.string "last_login_ip" + t.string "login" + t.integer "ship_address_id" + t.integer "bill_address_id" + end + + create_table "variants", :force => true do |t| + t.integer "product_id" + t.string "sku", :default => "", :null => false + t.decimal "price", :precision => 8, :scale => 2, :null => false + t.decimal "weight", :precision => 8, :scale => 2 + t.decimal "height", :precision => 8, :scale => 2 + t.decimal "width", :precision => 8, :scale => 2 + t.decimal "depth", :precision => 8, :scale => 2 + t.datetime "deleted_at" + t.boolean "is_master", :default => false + end + + add_index "variants", ["product_id"], :name => "index_variants_on_product_id" + + create_table "zone_members", :force => true do |t| + t.integer "zone_id" + t.integer "zoneable_id" + t.string "zoneable_type" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "zones", :force => true do |t| + t.string "name" + t.string "description" + t.datetime "created_at" + t.datetime "updated_at" + end + end + + def self.down + # No going back + end +end diff --git a/spec/test_app/db/migrate/20090904192342_create_indexes_for_inventory_units.rb b/spec/test_app/db/migrate/20090904192342_create_indexes_for_inventory_units.rb new file mode 100644 index 0000000..801dba9 --- /dev/null +++ b/spec/test_app/db/migrate/20090904192342_create_indexes_for_inventory_units.rb @@ -0,0 +1,12 @@ +class CreateIndexesForInventoryUnits < ActiveRecord::Migration + def self.up + add_index(:inventory_units, :variant_id) + add_index(:inventory_units, :order_id) + end + + def self.down + remove_index(:inventory_units, :variant_id) + remove_index(:inventory_units, :order_id) + end +end + diff --git a/spec/test_app/db/migrate/20090923100315_add_count_on_hand_to_variants_and_products.rb b/spec/test_app/db/migrate/20090923100315_add_count_on_hand_to_variants_and_products.rb new file mode 100644 index 0000000..74ee903 --- /dev/null +++ b/spec/test_app/db/migrate/20090923100315_add_count_on_hand_to_variants_and_products.rb @@ -0,0 +1,36 @@ +class AddCountOnHandToVariantsAndProducts < ActiveRecord::Migration + def self.up + add_column :variants, :count_on_hand, :integer, :default => 0, :null => false + add_column :products, :count_on_hand, :integer, :default => 0, :null => false + + # In some cases needed to reflect changes in table structure + Variant.reset_column_information + Product.reset_column_information + + say_with_time 'Transfering inventory units with status on_hand to variants table...' do + Variant.all.each do |v| + v.update_attribute(:count_on_hand, v.inventory_units.with_state("on_hand").size) + InventoryUnit.destroy_all(:variant_id => v.id, :state => "on_hand") + end + end + + say_with_time 'Updating products count on hand' do + Product.all.each do |p| + product_count_on_hand = p.has_variants? ? + p.variants.inject(0) {|acc, v| acc + v.count_on_hand} : + (p.master ? p.master.count_on_hand : 0) + p.update_attribute(:count_on_hand, product_count_on_hand) + end + end + end + + def self.down + Variant.all.each do |v| + v.count_on_hand.times do + InventoryUnit.create(:variant => variant, :state => 'on_hand') + end + end + remove_column :variants, :count_on_hand + remove_column :products, :count_on_hand + end +end diff --git a/spec/test_app/db/migrate/20091007134354_change_taxons_to_nested_set.rb b/spec/test_app/db/migrate/20091007134354_change_taxons_to_nested_set.rb new file mode 100644 index 0000000..1cd72ba --- /dev/null +++ b/spec/test_app/db/migrate/20091007134354_change_taxons_to_nested_set.rb @@ -0,0 +1,40 @@ +class ChangeTaxonsToNestedSet < ActiveRecord::Migration + def self.up + add_column :taxons, :lft, :integer + add_column :taxons, :rgt, :integer + + Taxon.reset_column_information # So the new root ids get saved + + Taxon.class_eval do + # adapted from awesome nested set to use "position" information + indices = {} + + left_column_name = "lft" + right_column_name = "rgt" + quoted_parent_column_name = "parent_id" + scope = lambda{|node|} + + set_left_and_rights = lambda do |node| + # set left + node[left_column_name] = indices[scope.call(node)] += 1 + # find + find(:all, :conditions => ["#{quoted_parent_column_name} = ?", node], :order => "position ASC").each{|n| set_left_and_rights.call(n) } + # set right + node[right_column_name] = indices[scope.call(node)] += 1 + node.save! + end + + # Find root node(s) + find(:all, :conditions => "#{quoted_parent_column_name} IS NULL", :order => "position ASC").each do |root_node| + # setup index for this scope + indices[scope.call(root_node)] ||= 0 + set_left_and_rights.call(root_node) + end + end + end + + def self.down + remove_column :taxons, :lft + remove_column :taxons, :rgt + end +end diff --git a/spec/test_app/db/migrate/20091008091614_move_to_configurable_gateways.rb b/spec/test_app/db/migrate/20091008091614_move_to_configurable_gateways.rb new file mode 100644 index 0000000..046622b --- /dev/null +++ b/spec/test_app/db/migrate/20091008091614_move_to_configurable_gateways.rb @@ -0,0 +1,55 @@ +class MoveToConfigurableGateways < ActiveRecord::Migration + def self.up + drop_table :gateways + drop_table :gateway_options + drop_table :gateway_option_values + drop_table :gateway_configurations + + create_table :gateways, :force => true do |t| + t.string :type + t.string :name + t.text :description + t.boolean :active, :default => true + t.string :environment, :default => "development" + t.string :server, :default => "test" + t.boolean :test_mode, :default => true + t.timestamps + end + end + + def self.down + drop_table :gateways + create_table "gateway_configurations", :force => true do |t| + t.integer "gateway_id" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "gateway_option_values", :force => true do |t| + t.integer "gateway_configuration_id" + t.integer "gateway_option_id" + t.text "value" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "gateway_options", :force => true do |t| + t.string "name" + t.text "description" + t.integer "gateway_id" + t.boolean "textarea", :default => false + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "gateways", :force => true do |t| + t.string "clazz" + t.string "name" + t.text "description" + t.boolean "active" + t.datetime "created_at" + t.datetime "updated_at" + end + + end +end diff --git a/spec/test_app/db/migrate/20091012120519_product_groups_and_scopes.rb b/spec/test_app/db/migrate/20091012120519_product_groups_and_scopes.rb new file mode 100644 index 0000000..820a4c1 --- /dev/null +++ b/spec/test_app/db/migrate/20091012120519_product_groups_and_scopes.rb @@ -0,0 +1,25 @@ +class ProductGroupsAndScopes < ActiveRecord::Migration + def self.up + create_table(:product_groups) do |t| + t.column :name, :string + t.column :permalink, :string + t.column :order, :string + end + + create_table(:product_scopes) do |t| + t.column :product_group_id, :integer + t.column :name, :string + t.column :arguments, :text + end + + add_index :product_groups, :name + add_index :product_groups, :permalink + add_index :product_scopes, :name + add_index :product_scopes, :product_group_id + end + + def self.down + drop_table :product_groups + drop_table :product_scopes + end +end diff --git a/spec/test_app/db/migrate/20091015110842_add_open_id_authentication_tables.rb b/spec/test_app/db/migrate/20091015110842_add_open_id_authentication_tables.rb new file mode 100644 index 0000000..caae0d8 --- /dev/null +++ b/spec/test_app/db/migrate/20091015110842_add_open_id_authentication_tables.rb @@ -0,0 +1,20 @@ +class AddOpenIdAuthenticationTables < ActiveRecord::Migration + def self.up + create_table :open_id_authentication_associations, :force => true do |t| + t.integer :issued, :lifetime + t.string :handle, :assoc_type + t.binary :server_url, :secret + end + + create_table :open_id_authentication_nonces, :force => true do |t| + t.integer :timestamp, :null => false + t.string :server_url, :null => true + t.string :salt, :null => false + end + end + + def self.down + drop_table :open_id_authentication_associations + drop_table :open_id_authentication_nonces + end +end diff --git a/spec/test_app/db/migrate/20091015153048_add_openid_field_to_users.rb b/spec/test_app/db/migrate/20091015153048_add_openid_field_to_users.rb new file mode 100644 index 0000000..3c6b1fa --- /dev/null +++ b/spec/test_app/db/migrate/20091015153048_add_openid_field_to_users.rb @@ -0,0 +1,19 @@ + class AddOpenidFieldToUsers < ActiveRecord::Migration + def self.up + add_column :users, :openid_identifier, :string + add_index :users, :openid_identifier + + change_column :users, :login, :string, :default => nil, :null => true + change_column :users, :crypted_password, :string, :default => nil, :null => true + change_column :users, :salt, :string, :default => nil, :null => true + end + + def self.down + remove_column :users, :openid_identifier + + [:login, :crypted_password, :salt].each do |field| + User.all(:conditions => "#{field} is NULL").each { |user| user.update_attribute(field, "") if user.send(field).nil? } + change_column :users, field, :string, :default => "", :null => false + end + end + end diff --git a/spec/test_app/db/migrate/20091016174634_change_preference_value_type.rb b/spec/test_app/db/migrate/20091016174634_change_preference_value_type.rb new file mode 100644 index 0000000..8d64530 --- /dev/null +++ b/spec/test_app/db/migrate/20091016174634_change_preference_value_type.rb @@ -0,0 +1,10 @@ +class ChangePreferenceValueType < ActiveRecord::Migration + def self.up + remove_index :preferences, :name => 'index_preferences_on_owner_and_attribute_and_preference' + change_column :preferences, :value, :text + end + + def self.down + change_column :preferences, :value, :string + end +end diff --git a/spec/test_app/db/migrate/20091017175558_create_billing_integrations.rb b/spec/test_app/db/migrate/20091017175558_create_billing_integrations.rb new file mode 100644 index 0000000..aa2e17e --- /dev/null +++ b/spec/test_app/db/migrate/20091017175558_create_billing_integrations.rb @@ -0,0 +1,16 @@ +class CreateBillingIntegrations < ActiveRecord::Migration + def self.up + create_table :billing_integrations do |t| + t.string :type + t.string :name + t.text :description + t.boolean :active, :default => true + t.string :environment, :default => "development" + t.timestamps + end + end + + def self.down + drop_table :billing_integrations + end +end diff --git a/spec/test_app/db/migrate/20091021133257_charge_refactoring.rb b/spec/test_app/db/migrate/20091021133257_charge_refactoring.rb new file mode 100644 index 0000000..d36ddc6 --- /dev/null +++ b/spec/test_app/db/migrate/20091021133257_charge_refactoring.rb @@ -0,0 +1,35 @@ +class ChargeRefactoring < ActiveRecord::Migration + + class Checkout < ActiveRecord::Base + end + + # Hack to prevent issues with legacy migrations + class Order < ActiveRecord::Base + has_one :checkout + end + + def self.up + add_column :orders, :completed_at, :timestamp + Order.reset_column_information + Order.all.each {|o| o.update_attribute(:completed_at, o.checkout && o.checkout.read_attribute(:completed_at)) } + remove_column :checkouts, :completed_at + + change_column :adjustments, :amount, :decimal, :null => true, :default => nil, :precision => 8, :scale => 2 + Adjustment.update_all "type = secondary_type" + Adjustment.update_all "type = 'CouponCredit'", "type = 'Credit'" + remove_column :adjustments, :secondary_type + end + + def self.down + add_column :checkouts, :completed_at, :timestamp + Checkout.reset_column_information + Checkout.all.each{|c| c.update_attribute(:completed_at, c.order && c.order.completed_at)} + remove_column :orders, :completed_at + + add_column :adjustments, :secondary_type, :string + Adjustment.update_all "secondary_type = type" + Adjustment.update_all "type = 'Charge'", "type like '%Charge'" + Adjustment.update_all "type = 'Credit'", "type like '%Credit'" + change_column :adjustments, :amount, :decimal, :null => false, :default => 0, :precision => 8, :scale => 2 + end +end diff --git a/spec/test_app/db/migrate/20091104151730_add_some_indexes.rb b/spec/test_app/db/migrate/20091104151730_add_some_indexes.rb new file mode 100644 index 0000000..e9cbb5d --- /dev/null +++ b/spec/test_app/db/migrate/20091104151730_add_some_indexes.rb @@ -0,0 +1,21 @@ +class AddSomeIndexes < ActiveRecord::Migration + def self.up + add_index(:taxons, :permalink) + add_index(:taxons, :parent_id) + add_index(:taxons, :taxonomy_id) + add_index(:assets, :viewable_id) + add_index(:assets, [:viewable_type, :type]) + add_index(:product_properties, :product_id) + add_index(:option_values_variants, [:variant_id, :option_value_id]) + end + + def self.down + remove_index(:taxons, :permalink) + remove_index(:taxons, :parent_id) + remove_index(:taxons, :taxonomy_id) + remove_index(:assets, :viewable_id) + remove_index(:assets, [:viewable_type, :type]) + remove_index(:product_properties, :product_id) + remove_index(:option_values_variants, [:variant_id, :option_value_id]) + end +end diff --git a/spec/test_app/db/migrate/20091126190904_checkout_state_machine.rb b/spec/test_app/db/migrate/20091126190904_checkout_state_machine.rb new file mode 100644 index 0000000..5e6b484 --- /dev/null +++ b/spec/test_app/db/migrate/20091126190904_checkout_state_machine.rb @@ -0,0 +1,13 @@ +class CheckoutStateMachine < ActiveRecord::Migration + def self.up + change_table :checkouts do |t| + t.string :state + end + end + + def self.down + change_table :checkouts do |t| + t.remove :state + end + end +end diff --git a/spec/test_app/db/migrate/20091209153045_state_for_shipments.rb b/spec/test_app/db/migrate/20091209153045_state_for_shipments.rb new file mode 100644 index 0000000..3094333 --- /dev/null +++ b/spec/test_app/db/migrate/20091209153045_state_for_shipments.rb @@ -0,0 +1,9 @@ +class StateForShipments < ActiveRecord::Migration + def self.up + add_column "shipments", "state", :string + end + + def self.down + remove_column "shipments", "state" + end +end diff --git a/spec/test_app/db/migrate/20091209202200_make_state_events_polymorphic.rb b/spec/test_app/db/migrate/20091209202200_make_state_events_polymorphic.rb new file mode 100644 index 0000000..8224d47 --- /dev/null +++ b/spec/test_app/db/migrate/20091209202200_make_state_events_polymorphic.rb @@ -0,0 +1,12 @@ +class MakeStateEventsPolymorphic < ActiveRecord::Migration + def self.up + rename_column :state_events, :order_id, :stateful_id + add_column :state_events, :stateful_type, :string + StateEvent.update_all(:stateful_type => 'Order') + end + + def self.down + rename_column :state_events, :stateful_id, :order_id + remove_column :state_events, :stateful_type + end +end diff --git a/spec/test_app/db/migrate/20091211203813_ship_address_id_for_checkouts.rb b/spec/test_app/db/migrate/20091211203813_ship_address_id_for_checkouts.rb new file mode 100644 index 0000000..cb4cf03 --- /dev/null +++ b/spec/test_app/db/migrate/20091211203813_ship_address_id_for_checkouts.rb @@ -0,0 +1,9 @@ +class ShipAddressIdForCheckouts < ActiveRecord::Migration + def self.up + add_column "checkouts", "ship_address_id", :integer + end + + def self.down + remove_column "checkouts", "ship_address_id" + end +end diff --git a/spec/test_app/db/migrate/20091212161118_shipping_method_id_for_checkouts.rb b/spec/test_app/db/migrate/20091212161118_shipping_method_id_for_checkouts.rb new file mode 100644 index 0000000..e7c86cd --- /dev/null +++ b/spec/test_app/db/migrate/20091212161118_shipping_method_id_for_checkouts.rb @@ -0,0 +1,9 @@ +class ShippingMethodIdForCheckouts < ActiveRecord::Migration + def self.up + add_column "checkouts", "shipping_method_id", :integer + end + + def self.down + remove_column "checkouts", "shipping_method_id" + end +end diff --git a/spec/test_app/db/migrate/20091213222815_creditcard_last_four_digits.rb b/spec/test_app/db/migrate/20091213222815_creditcard_last_four_digits.rb new file mode 100644 index 0000000..fafa791 --- /dev/null +++ b/spec/test_app/db/migrate/20091213222815_creditcard_last_four_digits.rb @@ -0,0 +1,19 @@ +class CreditcardLastFourDigits < ActiveRecord::Migration + + # Hack to allow for legacy migrations + class Creditcard < ActiveRecord::Base + end + + def self.up + rename_column :creditcards, :display_number, :last_digits + + Creditcard.reset_column_information + Creditcard.all.each do |card| + card.update_attribute(:last_digits, card.last_digits.gsub("XXXX-XXXX-XXXX-", "")) if card.last_digits.present? + end + end + + def self.down + rename_column :creditcards, :last_digits, :display_number + end +end diff --git a/spec/test_app/db/migrate/20091214183826_populate_legacy_shipment_state.rb b/spec/test_app/db/migrate/20091214183826_populate_legacy_shipment_state.rb new file mode 100644 index 0000000..810e3c4 --- /dev/null +++ b/spec/test_app/db/migrate/20091214183826_populate_legacy_shipment_state.rb @@ -0,0 +1,19 @@ +class PopulateLegacyShipmentState < ActiveRecord::Migration + # Hack to allow for legacy migrations + class Shipment < ActiveRecord::Base + end + + def self.up + Shipment.all.each do |shipment| + if shipment.shipped_at + shipment.state = "shipped" + else + shipment.state = "pending" + end + shipment.save + end + end + + def self.down + end +end diff --git a/spec/test_app/db/migrate/20100105090147_add_cost_price.rb b/spec/test_app/db/migrate/20100105090147_add_cost_price.rb new file mode 100644 index 0000000..6f3aa13 --- /dev/null +++ b/spec/test_app/db/migrate/20100105090147_add_cost_price.rb @@ -0,0 +1,9 @@ +class AddCostPrice < ActiveRecord::Migration + def self.up + add_column :variants, :cost_price, :decimal, :null => true, :default => nil, :precision => 8, :scale => 2 + end + + def self.down + remove_column :variants, :cost_price + end +end diff --git a/spec/test_app/db/migrate/20100105132138_shipment_id_for_inventory_units.rb b/spec/test_app/db/migrate/20100105132138_shipment_id_for_inventory_units.rb new file mode 100644 index 0000000..fa104ab --- /dev/null +++ b/spec/test_app/db/migrate/20100105132138_shipment_id_for_inventory_units.rb @@ -0,0 +1,21 @@ +class ShipmentIdForInventoryUnits < ActiveRecord::Migration + def self.up + add_column "inventory_units", "shipment_id", :integer + add_index(:inventory_units, :shipment_id) + + # migrate legacy shipments + Shipment.all.each do |shipment| + unless shipment.order + puts "Warning: shipment has invalid order - #{shipment.id}" + next + end + shipment.order.inventory_units.each do |unit| + unit.update_attribute("shipment_id", shipment.id) + end + end + end + + def self.down + remove_column "inventory_units", "shipment_id" + end +end diff --git a/spec/test_app/db/migrate/20100111205525_cim_fields_for_creditcards.rb b/spec/test_app/db/migrate/20100111205525_cim_fields_for_creditcards.rb new file mode 100644 index 0000000..a30ddf3 --- /dev/null +++ b/spec/test_app/db/migrate/20100111205525_cim_fields_for_creditcards.rb @@ -0,0 +1,11 @@ +class CimFieldsForCreditcards < ActiveRecord::Migration + def self.up + add_column "creditcards", "gateway_customer_profile_id", :string + add_column "creditcards", "gateway_payment_profile_id", :string + end + + def self.down + remove_column "creditcards", "gateway_customer_profile_id" + remove_column "creditcards", "gateway_payment_profile_id" + end +end diff --git a/spec/test_app/db/migrate/20100112151511_create_return_authorizations.rb b/spec/test_app/db/migrate/20100112151511_create_return_authorizations.rb new file mode 100644 index 0000000..70c6d3b --- /dev/null +++ b/spec/test_app/db/migrate/20100112151511_create_return_authorizations.rb @@ -0,0 +1,16 @@ +class CreateReturnAuthorizations < ActiveRecord::Migration + def self.up + create_table :return_authorizations do |t| + t.string :number + t.decimal :amount, :precision => 8, :scale => 2, :default => 0.0, :null => false + t.references :order + t.text :reason + t.string :state + t.timestamps + end + end + + def self.down + drop_table :return_authorizations + end +end diff --git a/spec/test_app/db/migrate/20100113090919_add_return_authorization_to_inventory_units.rb b/spec/test_app/db/migrate/20100113090919_add_return_authorization_to_inventory_units.rb new file mode 100644 index 0000000..00e7d5f --- /dev/null +++ b/spec/test_app/db/migrate/20100113090919_add_return_authorization_to_inventory_units.rb @@ -0,0 +1,9 @@ +class AddReturnAuthorizationToInventoryUnits < ActiveRecord::Migration + def self.up + add_column :inventory_units, :return_authorization_id, :integer + end + + def self.down + remove_column :inventory_units, :return_authorization_id + end +end diff --git a/spec/test_app/db/migrate/20100113203104_create_trackers.rb b/spec/test_app/db/migrate/20100113203104_create_trackers.rb new file mode 100644 index 0000000..6078395 --- /dev/null +++ b/spec/test_app/db/migrate/20100113203104_create_trackers.rb @@ -0,0 +1,14 @@ +class CreateTrackers < ActiveRecord::Migration + def self.up + create_table :trackers do |t| + t.string :environment + t.string :analytics_id + t.boolean :active, :default => true + t.timestamps + end + end + + def self.down + drop_table :trackers + end +end diff --git a/spec/test_app/db/migrate/20100121160010_creditcard_id_for_creditcard_txns.rb b/spec/test_app/db/migrate/20100121160010_creditcard_id_for_creditcard_txns.rb new file mode 100644 index 0000000..d2bbac9 --- /dev/null +++ b/spec/test_app/db/migrate/20100121160010_creditcard_id_for_creditcard_txns.rb @@ -0,0 +1,9 @@ +class CreditcardIdForCreditcardTxns < ActiveRecord::Migration + def self.up + add_column "creditcard_txns", "creditcard_id", :integer + end + + def self.down + remove_column "creditcard_txns", "creditcard_id" + end +end diff --git a/spec/test_app/db/migrate/20100121183934_original_creditcard_txn_id_for_creditcard_txns.rb b/spec/test_app/db/migrate/20100121183934_original_creditcard_txn_id_for_creditcard_txns.rb new file mode 100644 index 0000000..98ef6a9 --- /dev/null +++ b/spec/test_app/db/migrate/20100121183934_original_creditcard_txn_id_for_creditcard_txns.rb @@ -0,0 +1,9 @@ +class OriginalCreditcardTxnIdForCreditcardTxns < ActiveRecord::Migration + def self.up + add_column "creditcard_txns", "original_creditcard_txn_id", :integer + end + + def self.down + remove_column "creditcard_txns", "original_creditcard_txn_id" + end +end diff --git a/spec/test_app/db/migrate/20100125145351_add_test_mode_to_billing_integration.rb b/spec/test_app/db/migrate/20100125145351_add_test_mode_to_billing_integration.rb new file mode 100644 index 0000000..4dccff2 --- /dev/null +++ b/spec/test_app/db/migrate/20100125145351_add_test_mode_to_billing_integration.rb @@ -0,0 +1,11 @@ +class AddTestModeToBillingIntegration < ActiveRecord::Migration + def self.up + add_column :billing_integrations, :test_mode, :boolean, :default => true + add_column :billing_integrations, :server, :string, :default => "test" + end + + def self.down + remove_column :billing_integrations, :test_mode + remove_column :billing_integrations, :server + end +end diff --git a/spec/test_app/db/migrate/20100126103714_create_products_product_groups.rb b/spec/test_app/db/migrate/20100126103714_create_products_product_groups.rb new file mode 100644 index 0000000..0317884 --- /dev/null +++ b/spec/test_app/db/migrate/20100126103714_create_products_product_groups.rb @@ -0,0 +1,12 @@ +class CreateProductsProductGroups < ActiveRecord::Migration + def self.up + create_table :product_groups_products, :id => false do |t| + t.references :product + t.references :product_group + end + end +#product_group_memberships + def self.down + drop_table :product_groups_products + end +end diff --git a/spec/test_app/db/migrate/20100209025806_create_payment_methods.rb b/spec/test_app/db/migrate/20100209025806_create_payment_methods.rb new file mode 100644 index 0000000..722f04d --- /dev/null +++ b/spec/test_app/db/migrate/20100209025806_create_payment_methods.rb @@ -0,0 +1,20 @@ +class CreatePaymentMethods < ActiveRecord::Migration + def self.up + create_table :payment_methods do |t| + t.string :type + t.string :name + t.text :description + t.boolean :active, :default => true + t.string :environment, :default => "development" + t.timestamps + end + # TODO - also migrate any legacy configurations for gateways and billing integrations before dropping the old tables + # we probably also need to do this inside the payment_gateway extension b/c table won't exist yet in fresh bootstrap + #drop_table :billing_integrations + #drop_table :gateways + end + + def self.down + drop_table :payment_methods + end +end diff --git a/spec/test_app/db/migrate/20100209144531_polymorphic_payments.rb b/spec/test_app/db/migrate/20100209144531_polymorphic_payments.rb new file mode 100644 index 0000000..7004d6f --- /dev/null +++ b/spec/test_app/db/migrate/20100209144531_polymorphic_payments.rb @@ -0,0 +1,29 @@ +class PolymorphicPayments < ActiveRecord::Migration + def self.up + remove_column :payments, :type + remove_column :payments, :creditcard_id + rename_column :payments, :order_id, :payable_id + change_table :payments do |t| + t.string :payable_type + t.string :payment_method + t.references :source, :polymorphic => true + end + execute "UPDATE payments SET payable_type = 'Order'" + + Creditcard.all.each do |creditcard| + if checkout = Checkout.find_by_id(creditcard.checkout_id) and checkout.order + if payment = checkout.order.payments.first + execute "UPDATE payments SET source_type = 'Creditcard', source_id = #{creditcard.id} WHERE id = #{payment.id}" + end + end + end + + change_table :creditcards do |t| + t.remove :checkout_id + end + end + + def self.down + # no going back! + end +end diff --git a/spec/test_app/db/migrate/20100213103131_change_payments_payment_method_to_belongs_to.rb b/spec/test_app/db/migrate/20100213103131_change_payments_payment_method_to_belongs_to.rb new file mode 100644 index 0000000..e4cc41c --- /dev/null +++ b/spec/test_app/db/migrate/20100213103131_change_payments_payment_method_to_belongs_to.rb @@ -0,0 +1,11 @@ +class ChangePaymentsPaymentMethodToBelongsTo < ActiveRecord::Migration + def self.up + remove_column "payments", "payment_method" + add_column "payments", "payment_method_id", :integer + end + + def self.down + add_column "payments", "payment_method", :string + remove_column "payments", "payment_method_id" + end +end diff --git a/spec/test_app/db/migrate/20100214212536_assign_creditcard_txns_to_payment.rb b/spec/test_app/db/migrate/20100214212536_assign_creditcard_txns_to_payment.rb new file mode 100644 index 0000000..bcca85f --- /dev/null +++ b/spec/test_app/db/migrate/20100214212536_assign_creditcard_txns_to_payment.rb @@ -0,0 +1,16 @@ +class AssignCreditcardTxnsToPayment < ActiveRecord::Migration + def self.up + add_column "creditcard_txns", "payment_id", :integer + ActiveRecord::Base.connection.select_all("SELECT * FROM creditcard_txns").each do |txn_attrs| + if creditcard = Creditcard.find_by_id(txn_attrs["creditcard_id"]) and creditcard.payments.first + execute "UPDATE creditcard_txns SET payment_id = #{creditcard.payments.first.id} WHERE id = #{txn_attrs['id']}" + end + end + remove_column "creditcard_txns", "creditcard_payment_id" + end + + def self.down + remove_column "creditcard_txns", "payment_id" + add_column "creditcard_txns", "creditcard_payment_id", :integer + end +end diff --git a/spec/test_app/db/migrate/20100223170312_sti_for_transactions.rb b/spec/test_app/db/migrate/20100223170312_sti_for_transactions.rb new file mode 100644 index 0000000..031027e --- /dev/null +++ b/spec/test_app/db/migrate/20100223170312_sti_for_transactions.rb @@ -0,0 +1,14 @@ +class StiForTransactions < ActiveRecord::Migration + def self.up + rename_table "creditcard_txns", "transactions" + add_column "transactions", "type", :string + remove_column "transactions", "creditcard_id" + Transaction.update_all(:type => 'CreditcardTxn') if defined? Transaction + end + + def self.down + rename_table "transactions", "creditcard_txns" + remove_column "transactions", "type" + add_column "transactions", "creditcard_id", :integer + end +end diff --git a/spec/test_app/db/migrate/20100223183812_drop_billing_integrations.rb b/spec/test_app/db/migrate/20100223183812_drop_billing_integrations.rb new file mode 100644 index 0000000..60c6dcb --- /dev/null +++ b/spec/test_app/db/migrate/20100223183812_drop_billing_integrations.rb @@ -0,0 +1,16 @@ +class DropBillingIntegrations < ActiveRecord::Migration + def self.up + drop_table :billing_integrations + end + + def self.down + create_table :billing_integrations do |t| + t.string :type + t.string :name + t.text :description + t.boolean :active, :default => true + t.string :environment, :default => "development" + t.timestamps + end + end +end diff --git a/spec/test_app/db/migrate/20100224153127_deleted_at_for_payment_methods.rb b/spec/test_app/db/migrate/20100224153127_deleted_at_for_payment_methods.rb new file mode 100644 index 0000000..168f17a --- /dev/null +++ b/spec/test_app/db/migrate/20100224153127_deleted_at_for_payment_methods.rb @@ -0,0 +1,13 @@ +class DeletedAtForPaymentMethods < ActiveRecord::Migration + def self.up + change_table :payment_methods do |t| + t.timestamp :deleted_at, :default => nil + end + end + + def self.down + change_table :payment_methods do |t| + t.remove :deleted_at + end + end +end diff --git a/spec/test_app/db/migrate/20100301163454_add_adjustments_index.rb b/spec/test_app/db/migrate/20100301163454_add_adjustments_index.rb new file mode 100644 index 0000000..fecc5cd --- /dev/null +++ b/spec/test_app/db/migrate/20100301163454_add_adjustments_index.rb @@ -0,0 +1,10 @@ +class AddAdjustmentsIndex < ActiveRecord::Migration + def self.up + add_index(:adjustments, :order_id) + end + + def self.down + remove_index(:adjustments, :order_id) + end +end + diff --git a/spec/test_app/db/migrate/20100306153445_fix_by_popularity.rb b/spec/test_app/db/migrate/20100306153445_fix_by_popularity.rb new file mode 100644 index 0000000..2426a8a --- /dev/null +++ b/spec/test_app/db/migrate/20100306153445_fix_by_popularity.rb @@ -0,0 +1,8 @@ +class FixByPopularity < ActiveRecord::Migration + def self.up + ProductScope.update_all("name='descend_by_popularity'", "name='by_popularity'") + end + + def self.down + end +end diff --git a/spec/test_app/db/migrate/20100317120946_add_alt_text_to_images.rb b/spec/test_app/db/migrate/20100317120946_add_alt_text_to_images.rb new file mode 100644 index 0000000..8d60703 --- /dev/null +++ b/spec/test_app/db/migrate/20100317120946_add_alt_text_to_images.rb @@ -0,0 +1,9 @@ +class AddAltTextToImages < ActiveRecord::Migration + def self.up + add_column :assets, :alt, :text + end + + def self.down + remove_column :assets, :alt + end +end diff --git a/spec/test_app/db/migrate/20100427121301_add_display_to_payment_methods.rb b/spec/test_app/db/migrate/20100427121301_add_display_to_payment_methods.rb new file mode 100644 index 0000000..2683f32 --- /dev/null +++ b/spec/test_app/db/migrate/20100427121301_add_display_to_payment_methods.rb @@ -0,0 +1,9 @@ +class AddDisplayToPaymentMethods < ActiveRecord::Migration + def self.up + add_column :payment_methods, :display, :string, :default => nil + end + + def self.down + remove_column :payment_methods, :display + end +end diff --git a/spec/test_app/db/migrate/20100504142133_add_addresses_checkouts_indexes.rb b/spec/test_app/db/migrate/20100504142133_add_addresses_checkouts_indexes.rb new file mode 100755 index 0000000..34c249e --- /dev/null +++ b/spec/test_app/db/migrate/20100504142133_add_addresses_checkouts_indexes.rb @@ -0,0 +1,16 @@ +class AddAddressesCheckoutsIndexes < ActiveRecord::Migration + def self.up + add_index :addresses, :firstname + add_index :addresses, :lastname + add_index :checkouts, :order_id + add_index :checkouts, :bill_address_id + end + + def self.down + remove_index :checkouts, :bill_address_id + remove_index :checkouts, :order_id + remove_index :addresses, :lastname + remove_index :addresses, :firstname + end +end + diff --git a/spec/test_app/db/migrate/20100506180619_add_icon_to_taxons.rb b/spec/test_app/db/migrate/20100506180619_add_icon_to_taxons.rb new file mode 100644 index 0000000..add1fa5 --- /dev/null +++ b/spec/test_app/db/migrate/20100506180619_add_icon_to_taxons.rb @@ -0,0 +1,18 @@ +class AddIconToTaxons < ActiveRecord::Migration + def self.up + # skip this migration if the attribute already exists because of advanced taxon extension + return if Taxon.new.respond_to? :icon_file_name + add_column :taxons, :icon_file_name, :string + add_column :taxons, :icon_content_type, :string + add_column :taxons, :icon_file_size, :integer + add_column :taxons, :icon_updated_at, :datetime + end + + def self.down + remove_column :taxons, :icon_file_name + remove_column :taxons, :icon_content_type + remove_column :taxons, :icon_file_size + remove_column :taxons, :icon_updated_at + end + +end diff --git a/spec/test_app/db/migrate/20100506185838_add_description_to_taxons.rb b/spec/test_app/db/migrate/20100506185838_add_description_to_taxons.rb new file mode 100644 index 0000000..9a047bd --- /dev/null +++ b/spec/test_app/db/migrate/20100506185838_add_description_to_taxons.rb @@ -0,0 +1,11 @@ +class AddDescriptionToTaxons < ActiveRecord::Migration + def self.up + # skip this migration if the attribute already exists because of advanced taxon extension + return if Taxon.new.respond_to? :description + add_column :taxons, :description, :text + end + + def self.down + remove_column :taxons, :description + end +end diff --git a/spec/test_app/db/migrate/20100528155333_index_for_shipments_number.rb b/spec/test_app/db/migrate/20100528155333_index_for_shipments_number.rb new file mode 100644 index 0000000..b33ca2f --- /dev/null +++ b/spec/test_app/db/migrate/20100528155333_index_for_shipments_number.rb @@ -0,0 +1,9 @@ +class IndexForShipmentsNumber < ActiveRecord::Migration + def self.up + add_index :shipments, :number + end + + def self.down + remove_index :shipments, :number + end +end diff --git a/spec/test_app/db/migrate/20100528185820_add_index_on_users_persistence_token.rb b/spec/test_app/db/migrate/20100528185820_add_index_on_users_persistence_token.rb new file mode 100644 index 0000000..2905e9e --- /dev/null +++ b/spec/test_app/db/migrate/20100528185820_add_index_on_users_persistence_token.rb @@ -0,0 +1,9 @@ +class AddIndexOnUsersPersistenceToken < ActiveRecord::Migration + def self.up + add_index :users, :persistence_token + end + + def self.down + remove_index :users, :persistence_token + end +end diff --git a/spec/test_app/db/migrate/20100605152042_add_default_to_tax_categories.rb b/spec/test_app/db/migrate/20100605152042_add_default_to_tax_categories.rb new file mode 100644 index 0000000..e2ea792 --- /dev/null +++ b/spec/test_app/db/migrate/20100605152042_add_default_to_tax_categories.rb @@ -0,0 +1,9 @@ +class AddDefaultToTaxCategories < ActiveRecord::Migration + def self.up + add_column :tax_categories, :is_default, :boolean, :default => false + end + + def self.down + remove_column :tax_categories, :is_default + end +end \ No newline at end of file diff --git a/spec/test_app/db/migrate/20100624110730_add_display_to_shipping_methods.rb b/spec/test_app/db/migrate/20100624110730_add_display_to_shipping_methods.rb new file mode 100644 index 0000000..f14bea6 --- /dev/null +++ b/spec/test_app/db/migrate/20100624110730_add_display_to_shipping_methods.rb @@ -0,0 +1,9 @@ +class AddDisplayToShippingMethods < ActiveRecord::Migration + def self.up + add_column :shipping_methods, :display_on, :string, :default => nil + end + + def self.down + remove_column :shipping_methods, :display_on + end +end diff --git a/spec/test_app/db/migrate/20100624123336_rename_payment_method_display.rb b/spec/test_app/db/migrate/20100624123336_rename_payment_method_display.rb new file mode 100644 index 0000000..6240453 --- /dev/null +++ b/spec/test_app/db/migrate/20100624123336_rename_payment_method_display.rb @@ -0,0 +1,9 @@ +class RenamePaymentMethodDisplay < ActiveRecord::Migration + def self.up + rename_column :payment_methods, :display, :display_on + end + + def self.down + rename_column :payment_methods, :display_on, :display + end +end \ No newline at end of file diff --git a/spec/test_app/db/migrate/20100624175547_rename_preferences_field.rb b/spec/test_app/db/migrate/20100624175547_rename_preferences_field.rb new file mode 100644 index 0000000..613ee3a --- /dev/null +++ b/spec/test_app/db/migrate/20100624175547_rename_preferences_field.rb @@ -0,0 +1,8 @@ +class RenamePreferencesField < ActiveRecord::Migration + def self.up + rename_column(:preferences, :attribute, :name) + end + + def self.down + end +end diff --git a/spec/test_app/db/migrate/20100811163637_add_guest_flag.rb b/spec/test_app/db/migrate/20100811163637_add_guest_flag.rb new file mode 100644 index 0000000..1df2fa4 --- /dev/null +++ b/spec/test_app/db/migrate/20100811163637_add_guest_flag.rb @@ -0,0 +1,13 @@ +class AddGuestFlag < ActiveRecord::Migration + def self.up + change_table :users do |t| + t.boolean :guest + end + end + + def self.down + change_table :users do |t| + t.remove :guest + end + end +end diff --git a/spec/test_app/db/migrate/20100811205836_drop_order_token.rb b/spec/test_app/db/migrate/20100811205836_drop_order_token.rb new file mode 100644 index 0000000..760cab3 --- /dev/null +++ b/spec/test_app/db/migrate/20100811205836_drop_order_token.rb @@ -0,0 +1,11 @@ +class DropOrderToken < ActiveRecord::Migration + def self.up + change_table :orders do |t| + t.remove :token + end + end + + def self.down + # no going back + end +end diff --git a/spec/test_app/db/migrate/20100812162326_payments_state_and_assigned_to_order_only.rb b/spec/test_app/db/migrate/20100812162326_payments_state_and_assigned_to_order_only.rb new file mode 100644 index 0000000..1737555 --- /dev/null +++ b/spec/test_app/db/migrate/20100812162326_payments_state_and_assigned_to_order_only.rb @@ -0,0 +1,11 @@ +class PaymentsStateAndAssignedToOrderOnly < ActiveRecord::Migration + def self.up + # TODO: migrate existing payments + rename_column :payments, :payable_id, :order_id + remove_column :payments, :payable_type + add_column :payments, :state, :string + end + + def self.down + end +end diff --git a/spec/test_app/db/migrate/20100813023502_create_address_keys_for_order.rb b/spec/test_app/db/migrate/20100813023502_create_address_keys_for_order.rb new file mode 100644 index 0000000..bf44320 --- /dev/null +++ b/spec/test_app/db/migrate/20100813023502_create_address_keys_for_order.rb @@ -0,0 +1,15 @@ +class CreateAddressKeysForOrder < ActiveRecord::Migration + def self.up + change_table :orders do |t| + t.integer :bill_address_id + t.integer :ship_address_id + end + end + + def self.down + change_table :orders do |t| + t.remove :bill_address_id + t.remove :ship_address_id + end + end +end diff --git a/spec/test_app/db/migrate/20100813185745_payment_total_for_orders.rb b/spec/test_app/db/migrate/20100813185745_payment_total_for_orders.rb new file mode 100644 index 0000000..3a89bd0 --- /dev/null +++ b/spec/test_app/db/migrate/20100813185745_payment_total_for_orders.rb @@ -0,0 +1,9 @@ +class PaymentTotalForOrders < ActiveRecord::Migration + def self.up + add_column :orders, :payment_total, :decimal, :precision => 8, :scale => 2, :default => 0.0 + end + + def self.down + remove_column :orders, :payment_total + end +end diff --git a/spec/test_app/db/migrate/20100816212146_shipping_method_id_for_orders.rb b/spec/test_app/db/migrate/20100816212146_shipping_method_id_for_orders.rb new file mode 100644 index 0000000..f972985 --- /dev/null +++ b/spec/test_app/db/migrate/20100816212146_shipping_method_id_for_orders.rb @@ -0,0 +1,9 @@ +class ShippingMethodIdForOrders < ActiveRecord::Migration + def self.up + add_column :orders, :shipping_method_id, :integer + end + + def self.down + remove_column :orders, :shipping_method_id + end +end diff --git a/spec/test_app/db/migrate/20100817152723_add_shipment_and_payment_state.rb b/spec/test_app/db/migrate/20100817152723_add_shipment_and_payment_state.rb new file mode 100644 index 0000000..60f2992 --- /dev/null +++ b/spec/test_app/db/migrate/20100817152723_add_shipment_and_payment_state.rb @@ -0,0 +1,15 @@ +class AddShipmentAndPaymentState < ActiveRecord::Migration + def self.up + change_table :orders do |t| + t.string :shipment_state + t.string :payment_state + end + end + + def self.down + change_table :orders do |t| + t.remove :shipment_state + t.remove :payment_state + end + end +end diff --git a/spec/test_app/db/migrate/20100819170125_refactor_adjustments.rb b/spec/test_app/db/migrate/20100819170125_refactor_adjustments.rb new file mode 100644 index 0000000..3a8d28b --- /dev/null +++ b/spec/test_app/db/migrate/20100819170125_refactor_adjustments.rb @@ -0,0 +1,19 @@ +class RefactorAdjustments < ActiveRecord::Migration + def self.up + change_table :adjustments do |t| + t.boolean :mandatory + t.boolean :frozen + t.rename :adjustment_source_id, :source_id + t.rename :adjustment_source_type, :source_type + t.references :originator + t.string :originator_type + t.remove :type + t.rename :description, :label + t.remove :position + end + end + + def self.down + # no going back + end +end diff --git a/spec/test_app/db/migrate/20100820135707_response_code_and_avs_response_for_payments.rb b/spec/test_app/db/migrate/20100820135707_response_code_and_avs_response_for_payments.rb new file mode 100644 index 0000000..d504381 --- /dev/null +++ b/spec/test_app/db/migrate/20100820135707_response_code_and_avs_response_for_payments.rb @@ -0,0 +1,11 @@ +class ResponseCodeAndAvsResponseForPayments < ActiveRecord::Migration + def self.up + add_column :payments, :response_code, :string + add_column :payments, :avs_response, :string + end + + def self.down + remove_column :payments, :response_code + remove_column :payments, :avs_response + end +end diff --git a/spec/test_app/db/migrate/20100901171814_change_guest_flag_to_anonymous.rb b/spec/test_app/db/migrate/20100901171814_change_guest_flag_to_anonymous.rb new file mode 100644 index 0000000..0fd9378 --- /dev/null +++ b/spec/test_app/db/migrate/20100901171814_change_guest_flag_to_anonymous.rb @@ -0,0 +1,13 @@ +class ChangeGuestFlagToAnonymous < ActiveRecord::Migration + def self.up + change_table :users do |t| + t.rename :guest, :anonymous + end + end + + def self.down + change_table :users do |t| + t.rename :anonymous, :guest + end + end +end diff --git a/spec/test_app/db/migrate/20100903203949_email_for_orders.rb b/spec/test_app/db/migrate/20100903203949_email_for_orders.rb new file mode 100644 index 0000000..c0d5bef --- /dev/null +++ b/spec/test_app/db/migrate/20100903203949_email_for_orders.rb @@ -0,0 +1,9 @@ +class EmailForOrders < ActiveRecord::Migration + def self.up + add_column :orders, :email, :string + end + + def self.down + remove_column :orders, :email + end +end diff --git a/spec/test_app/db/migrate/20100923162011_create_mail_methods.rb b/spec/test_app/db/migrate/20100923162011_create_mail_methods.rb new file mode 100644 index 0000000..e4141cc --- /dev/null +++ b/spec/test_app/db/migrate/20100923162011_create_mail_methods.rb @@ -0,0 +1,12 @@ +class CreateMailMethods < ActiveRecord::Migration + def self.up + create_table :mail_methods do |t| + t.string :environment + t.boolean :active, :default => true + t.timestamps + end + end + + def self.down + end +end diff --git a/spec/test_app/db/migrate/20100929151905_rename_frozen_to_locked.rb b/spec/test_app/db/migrate/20100929151905_rename_frozen_to_locked.rb new file mode 100644 index 0000000..b78b4f7 --- /dev/null +++ b/spec/test_app/db/migrate/20100929151905_rename_frozen_to_locked.rb @@ -0,0 +1,8 @@ +class RenameFrozenToLocked < ActiveRecord::Migration + def self.up + rename_column :adjustments, :frozen, :locked + end + + def self.down + end +end diff --git a/spec/test_app/db/migrate/20101008190536_move_special_instructions_to_orders.rb b/spec/test_app/db/migrate/20101008190536_move_special_instructions_to_orders.rb new file mode 100644 index 0000000..fcd04c5 --- /dev/null +++ b/spec/test_app/db/migrate/20101008190536_move_special_instructions_to_orders.rb @@ -0,0 +1,11 @@ +class MoveSpecialInstructionsToOrders < ActiveRecord::Migration + def self.up + add_column :orders, :special_instructions, :text + + ActiveRecord::Base.connection.execute("update orders set special_instructions = (select special_instructions from checkouts where order_id = orders.id)") + end + + def self.down + remove_column :orders, :special_instructions, :text + end +end diff --git a/spec/test_app/db/migrate/20101026184700_create_log_entries.rb b/spec/test_app/db/migrate/20101026184700_create_log_entries.rb new file mode 100644 index 0000000..d135d97 --- /dev/null +++ b/spec/test_app/db/migrate/20101026184700_create_log_entries.rb @@ -0,0 +1,15 @@ +class CreateLogEntries < ActiveRecord::Migration + def self.up + create_table :log_entries do |t| + t.integer :source_id + t.string :source_type + t.text :details + + t.timestamps + end + end + + def self.down + drop_table :log_entries + end +end diff --git a/spec/test_app/db/migrate/20101026184714_migrate_transactions_to_payment_state.rb b/spec/test_app/db/migrate/20101026184714_migrate_transactions_to_payment_state.rb new file mode 100644 index 0000000..f5bd5ea --- /dev/null +++ b/spec/test_app/db/migrate/20101026184714_migrate_transactions_to_payment_state.rb @@ -0,0 +1,94 @@ +class Transaction < ActiveRecord::Base; end +class CreditcardTxn < Transaction; end + +class MigrateTransactionsToPaymentState < ActiveRecord::Migration + + AUTHORIZED=1 + COMPLETED=2 + PURCHASED=3 + VOIDED = 4 + CREDITED =5 + + PAYMENT_COMPLETE = 'completed' + PAYMENT_VOID = 'void' + PAYMENT_PENDING = 'pending' + + def self.up + migrate_authorized_only_transactions + migrate_voided_transactions + migrate_completed_transactions + migrate_purchased_transactions + migrate_credited_transactions + end + + def self.migrate_credited_transactions + credited = Transaction.find_by_sql("select * from transactions where txn_type = #{CREDITED}") + credited.each do |tx| + payment = Payment.find(tx) + order = payment.order + order.create_payment( + :amount=>tx.amount, + :source_id=>payment.source_id, :source_type=>'Creditcard', + :payment_method_id=>payment.payment_method_id, :state=>PAYMENT_COMPLETE, + :avs_response=>tx.avs_response, :response_code=>tx.response_code + ) + end + credited.each{|rec| rec.destroy } + end + + def self.migrate_voided_transactions + voided = Transaction.find_by_sql("select * from transactions where txn_type=#{VOIDED}") + voided.each do |tx| + update_payment(tx, PAYMENT_VOID) + end + unless voided.empty? + all_but_credited = [AUTHORIZED, COMPLETED, PURCHASED, VOIDED] + voided_and_subsequent_transactions = Transaction.find_by_sql("select * from transactions where payment_id in (#{voided.map(&:payment_id).join(',')}) and txn_type in (#{all_but_credited.join(',')})") + voided_and_subsequent_transactions.each{|rec| rec.destroy } + end + end + + def self.migrate_purchased_transactions + migrate_transactions(PURCHASED) + end + + def self.migrate_completed_transactions + migrate_transactions(COMPLETED) + end + + def self.migrate_transactions(type) + txs = Transaction.find_by_sql("select * from transactions where txn_type = #{type}") + txs.each do |tx| + update_payment(tx, PAYMENT_COMPLETE) + end + txs.each{|rec| rec.destroy } + end + + def self.migrate_authorized_only_transactions + if (ActiveRecord::Base.connection.adapter_name == 'PostgreSQL') + group_by_clause = "group by transactions." + Transaction.column_names.join(", transactions.") + else + group_by_clause = "group by payment_id" + end + authorized_only = Transaction.find_by_sql("select * from transactions #{group_by_clause} having count(payment_id) = 1 and txn_type = #{AUTHORIZED}") + authorized_only.each do |tx| + update_payment(tx, PAYMENT_PENDING) + end + authorized_only.each {|rec| rec.destroy } + end + + def self.update_payment(tx, state) + payment = Payment.find(tx.payment_id) + payment.update_attributes_without_callbacks({ + :state => state, + :source_type => 'Creditcard', + :amount => tx.amount, + :response_code => tx.response_code, + :avs_response => tx.avs_response + }) + end + + def self.down + end +end + diff --git a/spec/test_app/db/migrate/20101026184746_delete_in_progress_orders.rb b/spec/test_app/db/migrate/20101026184746_delete_in_progress_orders.rb new file mode 100644 index 0000000..6f4b461 --- /dev/null +++ b/spec/test_app/db/migrate/20101026184746_delete_in_progress_orders.rb @@ -0,0 +1,18 @@ +class DeleteInProgressOrders < ActiveRecord::Migration + def self.up + Order.delete_all(:state=>'in_progress') + delete_orphans('adjustments') + delete_orphans('checkouts') + delete_orphans('shipments') + delete_orphans('payments') + delete_orphans('line_items') + delete_orphans('inventory_units') + end + + def self.delete_orphans(table_name) + execute("delete from #{table_name} where order_id not in (select id from orders)") + end + + def self.down + end +end \ No newline at end of file diff --git a/spec/test_app/db/migrate/20101026184808_migrate_checkout_to_orders.rb b/spec/test_app/db/migrate/20101026184808_migrate_checkout_to_orders.rb new file mode 100644 index 0000000..d55e3fe --- /dev/null +++ b/spec/test_app/db/migrate/20101026184808_migrate_checkout_to_orders.rb @@ -0,0 +1,27 @@ +class MigrateCheckoutToOrders < ActiveRecord::Migration + + class Checkout < ActiveRecord::Base + end + + def self.up + Order.find_each do |order| + checkout = update_order(order) + checkout.destroy if checkout + end + end + + def self.update_order(order) + checkout = Checkout.find_by_order_id(order.id) + if checkout + order.update_attributes_without_callbacks({ + :email => checkout.email, + :bill_address_id => checkout.bill_address_id, + :ship_address_id => checkout.ship_address_id + }) + end + checkout + end + + def self.down + end +end diff --git a/spec/test_app/db/migrate/20101026184833_migrate_adjustments.rb b/spec/test_app/db/migrate/20101026184833_migrate_adjustments.rb new file mode 100644 index 0000000..d5ded8e --- /dev/null +++ b/spec/test_app/db/migrate/20101026184833_migrate_adjustments.rb @@ -0,0 +1,9 @@ +class MigrateAdjustments < ActiveRecord::Migration + def self.up + execute("update adjustments set amount = 0.0 where amount is null") + execute("update adjustments set mandatory = 'true', locked = 'true'") + end + + def self.down + end +end diff --git a/spec/test_app/db/migrate/20101026184855_remove_shipped_state.rb b/spec/test_app/db/migrate/20101026184855_remove_shipped_state.rb new file mode 100644 index 0000000..377cf0a --- /dev/null +++ b/spec/test_app/db/migrate/20101026184855_remove_shipped_state.rb @@ -0,0 +1,14 @@ +class RemoveShippedState < ActiveRecord::Migration + def self.up + Order.where(:state => 'shipped').each do |order| + order.update_attribute_without_callbacks("state", "complete") + order.shipments.each do |shipment| + shipment.state = 'shipped' + shipment.save + end + end + end + + def self.down + end +end \ No newline at end of file diff --git a/spec/test_app/db/migrate/20101026184916_prevent_nil_payment_total.rb b/spec/test_app/db/migrate/20101026184916_prevent_nil_payment_total.rb new file mode 100644 index 0000000..d1b9d8a --- /dev/null +++ b/spec/test_app/db/migrate/20101026184916_prevent_nil_payment_total.rb @@ -0,0 +1,8 @@ +class PreventNilPaymentTotal < ActiveRecord::Migration + def self.up + execute("update orders set payment_total = 0.0 where payment_total is null") + end + + def self.down + end +end diff --git a/spec/test_app/db/migrate/20101026184932_prevent_nil_email.rb b/spec/test_app/db/migrate/20101026184932_prevent_nil_email.rb new file mode 100644 index 0000000..bf11421 --- /dev/null +++ b/spec/test_app/db/migrate/20101026184932_prevent_nil_email.rb @@ -0,0 +1,9 @@ +class PreventNilEmail < ActiveRecord::Migration + def self.up + execute("update orders set email = 'guest@example.com' where email is null") + execute("update orders set email = 'guest@example.com' where email = ''") + end + + def self.down + end +end diff --git a/spec/test_app/db/migrate/20101026184959_generate_anonymous_users.rb b/spec/test_app/db/migrate/20101026184959_generate_anonymous_users.rb new file mode 100644 index 0000000..f87e5fa --- /dev/null +++ b/spec/test_app/db/migrate/20101026184959_generate_anonymous_users.rb @@ -0,0 +1,14 @@ +class GenerateAnonymousUsers < ActiveRecord::Migration + def self.up + User.reset_column_information + Order.where(:user_id => nil).each do |order| + user = User.anonymous! + user.email ||= order.email + order.user = user + order.save! + end + end + + def self.down + end +end \ No newline at end of file diff --git a/spec/test_app/db/migrate/20101026185022_update_order_state.rb b/spec/test_app/db/migrate/20101026185022_update_order_state.rb new file mode 100644 index 0000000..1eff98e --- /dev/null +++ b/spec/test_app/db/migrate/20101026185022_update_order_state.rb @@ -0,0 +1,8 @@ +class UpdateOrderState < ActiveRecord::Migration + def self.up + Order.all.map(&:update!) + end + + def self.down + end +end \ No newline at end of file diff --git a/spec/test_app/db/migrate/20101026192225_cleanup_legacy_tables.rb b/spec/test_app/db/migrate/20101026192225_cleanup_legacy_tables.rb new file mode 100644 index 0000000..3984afb --- /dev/null +++ b/spec/test_app/db/migrate/20101026192225_cleanup_legacy_tables.rb @@ -0,0 +1,11 @@ +class CleanupLegacyTables < ActiveRecord::Migration + def self.up + drop_table :checkouts + drop_table :transactions + drop_table :open_id_authentication_associations + drop_table :open_id_authentication_nonces + end + + def self.down + end +end diff --git a/spec/test_app/db/migrate/20101028151745_remove_number_and_cvv_from_credicard.rb b/spec/test_app/db/migrate/20101028151745_remove_number_and_cvv_from_credicard.rb new file mode 100644 index 0000000..d71904b --- /dev/null +++ b/spec/test_app/db/migrate/20101028151745_remove_number_and_cvv_from_credicard.rb @@ -0,0 +1,9 @@ +class RemoveNumberAndCvvFromCredicard < ActiveRecord::Migration + def self.up + remove_column :creditcards, :number + remove_column :creditcards, :verification_value + end + + def self.down + end +end diff --git a/spec/test_app/db/migrate/20101103212716_drop_anonymous_field_for_user.rb b/spec/test_app/db/migrate/20101103212716_drop_anonymous_field_for_user.rb new file mode 100644 index 0000000..588cf70 --- /dev/null +++ b/spec/test_app/db/migrate/20101103212716_drop_anonymous_field_for_user.rb @@ -0,0 +1,8 @@ +class DropAnonymousFieldForUser < ActiveRecord::Migration + def self.up + remove_column :users, :anonymous + end + + def self.down + end +end diff --git a/spec/test_app/db/migrate/20101111133551_renamed_rma_cancelled_state.rb b/spec/test_app/db/migrate/20101111133551_renamed_rma_cancelled_state.rb new file mode 100644 index 0000000..de97224 --- /dev/null +++ b/spec/test_app/db/migrate/20101111133551_renamed_rma_cancelled_state.rb @@ -0,0 +1,10 @@ +class RenamedRmaCancelledState < ActiveRecord::Migration + def self.up + ReturnAuthorization.where(:state => 'cancelled').each do |rma| + rma.update_attribute_without_callbacks(:state, 'canceled') + end + end + + def self.down + end +end diff --git a/spec/test_app/db/migrate/20101117031806_fix_problematic_index_names.rb b/spec/test_app/db/migrate/20101117031806_fix_problematic_index_names.rb new file mode 100644 index 0000000..bca6762 --- /dev/null +++ b/spec/test_app/db/migrate/20101117031806_fix_problematic_index_names.rb @@ -0,0 +1,13 @@ +class FixProblematicIndexNames < ActiveRecord::Migration + def self.up + begin + remove_index("preferences", "index_preferences_on_owner_and_attribute_and_preference") + rescue ArgumentError + # ignore - already remove then + end + add_index "preferences", ["owner_id", "owner_type", "name", "group_id", "group_type"], :name => "ix_prefs_on_owner_attr_pref", :unique => true + end + + def self.down + end +end diff --git a/spec/test_app/db/sample/users.rb b/spec/test_app/db/sample/users.rb new file mode 100644 index 0000000..3e06b47 --- /dev/null +++ b/spec/test_app/db/sample/users.rb @@ -0,0 +1,53 @@ +# see last line where we create an admin if there is none, asking for email and password +def prompt_for_admin_password + password = ask('Password [spree123]: ', String) do |q| + q.echo = false + q.validate = /^(|.{5,40})$/ + q.responses[:not_valid] = "Invalid password. Must be at least 5 characters long." + q.whitespace = :strip + end + password = "spree123" if password.blank? + password +end + +def prompt_for_admin_email + email = ask('Email [spree@example.com]: ', String) do |q| + q.echo = true + q.whitespace = :strip + end + email = "spree@example.com" if email.blank? + email +end + +def create_admin_user + if ENV['AUTO_ACCEPT'] + password = "spree" + email = "spree@example.com" + else + require 'highline/import' + puts "Create the admin user (press enter for defaults)." + #name = prompt_for_admin_name unless name + email = prompt_for_admin_email + password = prompt_for_admin_password + end + attributes = { + :password => password, + :password_confirmation => password, + :email => email, + :login => email + } + + load 'user.rb' + + if User.find_by_email(email) + say "\nWARNING: There is already a user with the email: #{email}, so no account changes were made. If you wish to create an additional admin user, please run rake db:admin:create again with a different email.\n\n" + else + admin = User.create(attributes) + # create an admin role and and assign the admin user to that role + role = Role.find_or_create_by_name "admin" + admin.roles << role + admin.save + end +end + +create_admin_user if User.where("roles.name" => 'admin').includes(:roles).empty? \ No newline at end of file diff --git a/spec/test_app/db/schema.rb b/spec/test_app/db/schema.rb new file mode 100644 index 0000000..a63bc8a --- /dev/null +++ b/spec/test_app/db/schema.rb @@ -0,0 +1,543 @@ +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended to check this file into your version control system. + +ActiveRecord::Schema.define(:version => 20101117031806) do + + create_table "addresses", :force => true do |t| + t.string "firstname" + t.string "lastname" + t.string "address1" + t.string "address2" + t.string "city" + t.integer "state_id" + t.string "zipcode" + t.integer "country_id" + t.string "phone" + t.datetime "created_at" + t.datetime "updated_at" + t.string "state_name" + t.string "alternative_phone" + end + + add_index "addresses", ["firstname"], :name => "index_addresses_on_firstname" + add_index "addresses", ["lastname"], :name => "index_addresses_on_lastname" + + create_table "adjustments", :force => true do |t| + t.integer "order_id" + t.decimal "amount" + t.string "label" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "source_id" + t.string "source_type" + t.boolean "mandatory" + t.boolean "locked" + t.integer "originator_id" + t.string "originator_type" + end + + add_index "adjustments", ["order_id"], :name => "index_adjustments_on_order_id" + + create_table "assets", :force => true do |t| + t.integer "viewable_id" + t.string "viewable_type", :limit => 50 + t.string "attachment_content_type" + t.string "attachment_file_name" + t.integer "attachment_size" + t.integer "position" + t.string "type", :limit => 75 + t.datetime "attachment_updated_at" + t.integer "attachment_width" + t.integer "attachment_height" + t.text "alt" + end + + add_index "assets", ["viewable_id"], :name => "index_assets_on_viewable_id" + add_index "assets", ["viewable_type", "type"], :name => "index_assets_on_viewable_type_and_type" + + create_table "calculators", :force => true do |t| + t.string "type" + t.integer "calculable_id", :null => false + t.string "calculable_type", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "configurations", :force => true do |t| + t.string "name" + t.datetime "created_at" + t.datetime "updated_at" + t.string "type", :limit => 50 + end + + add_index "configurations", ["name", "type"], :name => "index_configurations_on_name_and_type" + + create_table "countries", :force => true do |t| + t.string "iso_name" + t.string "iso" + t.string "name" + t.string "iso3" + t.integer "numcode" + end + + create_table "coupons", :force => true do |t| + t.string "code" + t.string "description" + t.integer "usage_limit" + t.boolean "combine" + t.datetime "expires_at" + t.datetime "created_at" + t.datetime "updated_at" + t.datetime "starts_at" + end + + create_table "creditcards", :force => true do |t| + t.string "month" + t.string "year" + t.string "cc_type" + t.string "last_digits" + t.string "first_name" + t.string "last_name" + t.datetime "created_at" + t.datetime "updated_at" + t.string "start_month" + t.string "start_year" + t.string "issue_number" + t.integer "address_id" + t.string "gateway_customer_profile_id" + t.string "gateway_payment_profile_id" + end + + create_table "gateways", :force => true do |t| + t.string "type" + t.string "name" + t.text "description" + t.boolean "active", :default => true + t.string "environment", :default => "development" + t.string "server", :default => "test" + t.boolean "test_mode", :default => true + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "inventory_units", :force => true do |t| + t.integer "variant_id" + t.integer "order_id" + t.string "state" + t.integer "lock_version", :default => 0 + t.datetime "created_at" + t.datetime "updated_at" + t.integer "shipment_id" + t.integer "return_authorization_id" + end + + add_index "inventory_units", ["order_id"], :name => "index_inventory_units_on_order_id" + add_index "inventory_units", ["shipment_id"], :name => "index_inventory_units_on_shipment_id" + add_index "inventory_units", ["variant_id"], :name => "index_inventory_units_on_variant_id" + + create_table "line_items", :force => true do |t| + t.integer "order_id" + t.integer "variant_id" + t.integer "quantity", :null => false + t.decimal "price", :precision => 8, :scale => 2, :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "line_items", ["order_id"], :name => "index_line_items_on_order_id" + add_index "line_items", ["variant_id"], :name => "index_line_items_on_variant_id" + + create_table "log_entries", :force => true do |t| + t.integer "source_id" + t.string "source_type" + t.text "details" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "mail_methods", :force => true do |t| + t.string "environment" + t.boolean "active", :default => true + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "option_types", :force => true do |t| + t.string "name", :limit => 100 + t.string "presentation", :limit => 100 + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "option_types_prototypes", :id => false, :force => true do |t| + t.integer "prototype_id" + t.integer "option_type_id" + end + + create_table "option_values", :force => true do |t| + t.integer "option_type_id" + t.string "name" + t.integer "position" + t.string "presentation" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "option_values_variants", :id => false, :force => true do |t| + t.integer "variant_id" + t.integer "option_value_id" + end + + add_index "option_values_variants", ["variant_id", "option_value_id"], :name => "index_option_values_variants_on_variant_id_and_option_value_id" + add_index "option_values_variants", ["variant_id"], :name => "index_option_values_variants_on_variant_id" + + create_table "orders", :force => true do |t| + t.integer "user_id" + t.string "number", :limit => 15 + t.decimal "item_total", :default => 0.0, :null => false + t.decimal "total", :default => 0.0, :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.string "state" + t.decimal "adjustment_total", :default => 0.0, :null => false + t.decimal "credit_total", :default => 0.0, :null => false + t.datetime "completed_at" + t.integer "bill_address_id" + t.integer "ship_address_id" + t.decimal "payment_total", :precision => 8, :scale => 2, :default => 0.0 + t.integer "shipping_method_id" + t.string "shipment_state" + t.string "payment_state" + t.string "email" + t.text "special_instructions" + end + + add_index "orders", ["number"], :name => "index_orders_on_number" + + create_table "payment_methods", :force => true do |t| + t.string "type" + t.string "name" + t.text "description" + t.boolean "active", :default => true + t.string "environment", :default => "development" + t.datetime "created_at" + t.datetime "updated_at" + t.datetime "deleted_at" + t.string "display_on" + end + + create_table "payments", :force => true do |t| + t.integer "order_id" + t.datetime "created_at" + t.datetime "updated_at" + t.decimal "amount", :default => 0.0, :null => false + t.integer "source_id" + t.string "source_type" + t.integer "payment_method_id" + t.string "state" + t.string "response_code" + t.string "avs_response" + end + + create_table "preferences", :force => true do |t| + t.string "name", :limit => 100, :null => false + t.integer "owner_id", :limit => 30, :null => false + t.string "owner_type", :limit => 50, :null => false + t.integer "group_id" + t.string "group_type", :limit => 50 + t.text "value", :limit => 255 + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "preferences", ["owner_id", "owner_type", "name", "group_id", "group_type"], :name => "ix_prefs_on_owner_attr_pref", :unique => true + + create_table "product_groups", :force => true do |t| + t.string "name" + t.string "permalink" + t.string "order" + end + + add_index "product_groups", ["name"], :name => "index_product_groups_on_name" + add_index "product_groups", ["permalink"], :name => "index_product_groups_on_permalink" + + create_table "product_groups_products", :id => false, :force => true do |t| + t.integer "product_id" + t.integer "product_group_id" + end + + create_table "product_option_types", :force => true do |t| + t.integer "product_id" + t.integer "option_type_id" + t.integer "position" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "product_properties", :force => true do |t| + t.integer "product_id" + t.integer "property_id" + t.string "value" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "product_properties", ["product_id"], :name => "index_product_properties_on_product_id" + + create_table "product_scopes", :force => true do |t| + t.integer "product_group_id" + t.string "name" + t.text "arguments" + end + + add_index "product_scopes", ["name"], :name => "index_product_scopes_on_name" + add_index "product_scopes", ["product_group_id"], :name => "index_product_scopes_on_product_group_id" + + create_table "products", :force => true do |t| + t.string "name", :default => "", :null => false + t.text "description" + t.datetime "created_at" + t.datetime "updated_at" + t.string "permalink" + t.datetime "available_on" + t.integer "tax_category_id" + t.integer "shipping_category_id" + t.datetime "deleted_at" + t.string "meta_description" + t.string "meta_keywords" + t.integer "count_on_hand", :default => 0, :null => false + end + + add_index "products", ["available_on"], :name => "index_products_on_available_on" + add_index "products", ["deleted_at"], :name => "index_products_on_deleted_at" + add_index "products", ["name"], :name => "index_products_on_name" + add_index "products", ["permalink"], :name => "index_products_on_permalink" + + create_table "products_taxons", :id => false, :force => true do |t| + t.integer "product_id" + t.integer "taxon_id" + end + + add_index "products_taxons", ["product_id"], :name => "index_products_taxons_on_product_id" + add_index "products_taxons", ["taxon_id"], :name => "index_products_taxons_on_taxon_id" + + create_table "properties", :force => true do |t| + t.string "name" + t.string "presentation", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "properties_prototypes", :id => false, :force => true do |t| + t.integer "prototype_id" + t.integer "property_id" + end + + create_table "prototypes", :force => true do |t| + t.string "name" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "question_categories", :force => true do |t| + t.string "name" + t.integer "position" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "questions", :force => true do |t| + t.integer "question_category_id" + t.text "question" + t.text "answer" + t.integer "position" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "return_authorizations", :force => true do |t| + t.string "number" + t.decimal "amount", :precision => 8, :scale => 2, :default => 0.0, :null => false + t.integer "order_id" + t.text "reason" + t.string "state" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "roles", :force => true do |t| + t.string "name" + end + + create_table "roles_users", :id => false, :force => true do |t| + t.integer "role_id" + t.integer "user_id" + end + + add_index "roles_users", ["role_id"], :name => "index_roles_users_on_role_id" + add_index "roles_users", ["user_id"], :name => "index_roles_users_on_user_id" + + create_table "shipments", :force => true do |t| + t.integer "order_id" + t.integer "shipping_method_id" + t.string "tracking" + t.datetime "created_at" + t.datetime "updated_at" + t.string "number" + t.decimal "cost", :precision => 8, :scale => 2 + t.datetime "shipped_at" + t.integer "address_id" + t.string "state" + end + + add_index "shipments", ["number"], :name => "index_shipments_on_number" + + create_table "shipping_categories", :force => true do |t| + t.string "name" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "shipping_methods", :force => true do |t| + t.integer "zone_id" + t.string "name" + t.datetime "created_at" + t.datetime "updated_at" + t.string "display_on" + end + + create_table "state_events", :force => true do |t| + t.integer "stateful_id" + t.integer "user_id" + t.string "name" + t.datetime "created_at" + t.datetime "updated_at" + t.string "previous_state" + t.string "stateful_type" + end + + create_table "states", :force => true do |t| + t.string "name" + t.string "abbr" + t.integer "country_id" + end + + create_table "tax_categories", :force => true do |t| + t.string "name" + t.string "description" + t.datetime "created_at" + t.datetime "updated_at" + t.boolean "is_default", :default => false + end + + create_table "tax_rates", :force => true do |t| + t.integer "zone_id" + t.decimal "amount", :precision => 8, :scale => 4 + t.datetime "created_at" + t.datetime "updated_at" + t.integer "tax_category_id" + end + + create_table "taxonomies", :force => true do |t| + t.string "name", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "taxons", :force => true do |t| + t.integer "taxonomy_id", :null => false + t.integer "parent_id" + t.integer "position", :default => 0 + t.string "name", :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.string "permalink" + t.integer "lft" + t.integer "rgt" + t.string "icon_file_name" + t.string "icon_content_type" + t.integer "icon_file_size" + t.datetime "icon_updated_at" + t.text "description" + end + + add_index "taxons", ["parent_id"], :name => "index_taxons_on_parent_id" + add_index "taxons", ["permalink"], :name => "index_taxons_on_permalink" + add_index "taxons", ["taxonomy_id"], :name => "index_taxons_on_taxonomy_id" + + create_table "trackers", :force => true do |t| + t.string "environment" + t.string "analytics_id" + t.boolean "active", :default => true + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "users", :force => true do |t| + t.string "email" + t.string "crypted_password", :limit => 128 + t.string "salt", :limit => 128 + t.string "remember_token" + t.string "remember_token_expires_at" + t.datetime "created_at" + t.datetime "updated_at" + t.string "persistence_token" + t.string "single_access_token" + t.string "perishable_token" + t.integer "login_count", :default => 0, :null => false + t.integer "failed_login_count", :default => 0, :null => false + t.datetime "last_request_at" + t.datetime "current_login_at" + t.datetime "last_login_at" + t.string "current_login_ip" + t.string "last_login_ip" + t.string "login" + t.integer "ship_address_id" + t.integer "bill_address_id" + t.string "openid_identifier" + end + + add_index "users", ["openid_identifier"], :name => "index_users_on_openid_identifier" + add_index "users", ["persistence_token"], :name => "index_users_on_persistence_token" + + create_table "variants", :force => true do |t| + t.integer "product_id" + t.string "sku", :default => "", :null => false + t.decimal "price", :precision => 8, :scale => 2, :null => false + t.decimal "weight", :precision => 8, :scale => 2 + t.decimal "height", :precision => 8, :scale => 2 + t.decimal "width", :precision => 8, :scale => 2 + t.decimal "depth", :precision => 8, :scale => 2 + t.datetime "deleted_at" + t.boolean "is_master", :default => false + t.integer "count_on_hand", :default => 0, :null => false + t.decimal "cost_price", :precision => 8, :scale => 2 + end + + add_index "variants", ["product_id"], :name => "index_variants_on_product_id" + + create_table "zone_members", :force => true do |t| + t.integer "zone_id" + t.integer "zoneable_id" + t.string "zoneable_type" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "zones", :force => true do |t| + t.string "name" + t.string "description" + t.datetime "created_at" + t.datetime "updated_at" + end + +end diff --git a/spec/test_app/db/seeds.rb b/spec/test_app/db/seeds.rb new file mode 100644 index 0000000..3cc1fda --- /dev/null +++ b/spec/test_app/db/seeds.rb @@ -0,0 +1,3 @@ +# Loads seed data out of default dir +Rake::Task["db:load_dir"].invoke( "default" ) +puts "Default data has been loaded" \ No newline at end of file diff --git a/spec/test_app/db/test.sqlite3 b/spec/test_app/db/test.sqlite3 new file mode 100644 index 0000000..9fce6c5 Binary files /dev/null and b/spec/test_app/db/test.sqlite3 differ diff --git a/spec/test_app/log/cucumber.log b/spec/test_app/log/cucumber.log new file mode 100644 index 0000000..9e5a8b6 --- /dev/null +++ b/spec/test_app/log/cucumber.log @@ -0,0 +1,1309 @@ + SQL (0.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) select sqlite_version(*) + SQL (30.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)  + SQL (0.1ms) PRAGMA index_list("schema_migrations") + SQL (22.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version") + SQL (0.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" +Migrating to CreateQuestions (20090526213535) + SQL (0.7ms) CREATE TABLE "questions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "question_category_id" integer, "question" text, "answer" text, "position" integer, "created_at" datetime, "updated_at" datetime)  + SQL (0.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20090526213535') +Migrating to CreateQuestionCategories (20090526213550) + SQL (1.0ms) CREATE TABLE "question_categories" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime) + SQL (0.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20090526213550') +Migrating to SpreeZeroNineZero (20090823005402) + SQL (0.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.0ms) CREATE TABLE "addresses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "firstname" varchar(255), "lastname" varchar(255), "address1" varchar(255), "address2" varchar(255), "city" varchar(255), "state_id" integer, "zipcode" varchar(255), "country_id" integer, "phone" varchar(255), "created_at" datetime, "updated_at" datetime, "state_name" varchar(255), "alternative_phone" varchar(255)) + SQL (0.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.5ms) CREATE TABLE "adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "type" varchar(255), "amount" decimal(8,2) DEFAULT 0.0 NOT NULL, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "adjustment_source_id" integer, "adjustment_source_type" varchar(255), "secondary_type" varchar(255)) + SQL (0.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "assets" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "viewable_id" integer, "viewable_type" varchar(50), "attachment_content_type" varchar(255), "attachment_file_name" varchar(255), "attachment_size" integer, "position" integer, "type" varchar(75), "attachment_updated_at" datetime, "attachment_width" integer, "attachment_height" integer) + SQL (0.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "calculators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "calculable_id" integer NOT NULL, "calculable_type" varchar(255) NOT NULL, "created_at" datetime, "updated_at" datetime) + SQL (0.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.5ms) CREATE TABLE "checkouts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "email" varchar(255), "ip_address" varchar(255), "special_instructions" text, "bill_address_id" integer, "completed_at" datetime, "created_at" datetime, "updated_at" datetime) + SQL (0.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "configurations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "type" varchar(50)) + SQL (0.1ms) PRAGMA index_list("configurations") + SQL (0.3ms) CREATE INDEX "index_configurations_on_name_and_type" ON "configurations" ("name", "type") + SQL (0.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "countries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "iso_name" varchar(255), "iso" varchar(255), "name" varchar(255), "iso3" varchar(255), "numcode" integer) + SQL (0.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "coupons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar(255), "description" varchar(255), "usage_limit" integer, "combine" boolean, "expires_at" datetime, "created_at" datetime, "updated_at" datetime, "starts_at" datetime) + SQL (0.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.5ms) CREATE TABLE "creditcard_txns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "creditcard_payment_id" integer, "amount" decimal(8,2) DEFAULT 0.0 NOT NULL, "txn_type" integer, "response_code" varchar(255), "avs_response" text, "cvv_response" text, "created_at" datetime, "updated_at" datetime) + SQL (0.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "creditcards" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "number" text, "month" varchar(255), "year" varchar(255), "verification_value" text, "cc_type" varchar(255), "display_number" varchar(255), "first_name" varchar(255), "last_name" varchar(255), "created_at" datetime, "updated_at" datetime, "start_month" varchar(255), "start_year" varchar(255), "issue_number" varchar(255), "address_id" integer, "checkout_id" integer) + SQL (0.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "gateway_configurations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "gateway_id" integer, "created_at" datetime, "updated_at" datetime) + SQL (0.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "gateway_option_values" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "gateway_configuration_id" integer, "gateway_option_id" integer, "value" text, "created_at" datetime, "updated_at" datetime) + SQL (0.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "gateway_options" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "description" text, "gateway_id" integer, "textarea" boolean DEFAULT 'f', "created_at" datetime, "updated_at" datetime) + SQL (0.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "gateways" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "clazz" varchar(255), "name" varchar(255), "description" text, "active" boolean, "created_at" datetime, "updated_at" datetime) + SQL (0.7ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.5ms) CREATE TABLE "inventory_units" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "variant_id" integer, "order_id" integer, "state" varchar(255), "lock_version" integer DEFAULT 0, "created_at" datetime, "updated_at" datetime) + SQL (0.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "line_items" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "variant_id" integer, "quantity" integer NOT NULL, "price" decimal(8,2) NOT NULL, "created_at" datetime, "updated_at" datetime) + SQL (0.1ms) PRAGMA index_list("line_items") + SQL (0.7ms) CREATE INDEX "index_line_items_on_order_id" ON "line_items" ("order_id") + SQL (0.2ms) PRAGMA index_list("line_items") + SQL (0.1ms) PRAGMA index_info('index_line_items_on_order_id') + SQL (0.4ms) CREATE INDEX "index_line_items_on_variant_id" ON "line_items" ("variant_id") + SQL (0.6ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) CREATE TABLE "option_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(100), "presentation" varchar(100), "created_at" datetime, "updated_at" datetime)  + SQL (0.6ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) CREATE TABLE "option_types_prototypes" ("prototype_id" integer, "option_type_id" integer)  + SQL (1.0ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) CREATE TABLE "option_values" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "option_type_id" integer, "name" varchar(255), "position" integer, "presentation" varchar(255), "created_at" datetime, "updated_at" datetime)  + SQL (0.7ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) CREATE TABLE "option_values_variants" ("variant_id" integer, "option_value_id" integer)  + SQL (0.1ms) PRAGMA index_list("option_values_variants") + SQL (0.4ms) CREATE INDEX "index_option_values_variants_on_variant_id" ON "option_values_variants" ("variant_id") + SQL (1.1ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "number" varchar(15), "item_total" decimal(8,2) DEFAULT 0.0 NOT NULL, "total" decimal(8,2) DEFAULT 0.0 NOT NULL, "created_at" datetime, "updated_at" datetime, "state" varchar(255), "token" varchar(255), "adjustment_total" decimal(8,2) DEFAULT 0.0 NOT NULL, "credit_total" decimal(8,2) DEFAULT 0.0 NOT NULL)  + SQL (0.1ms) PRAGMA index_list("orders") + SQL (0.3ms) CREATE INDEX "index_orders_on_number" ON "orders" ("number") + SQL (0.7ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal(8,2) DEFAULT 0.0 NOT NULL, "creditcard_id" integer, "type" varchar(255))  + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "preferences" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "attribute" varchar(100) NOT NULL, "owner_id" integer(30) NOT NULL, "owner_type" varchar(50) NOT NULL, "group_id" integer, "group_type" varchar(50), "value" varchar(255), "created_at" datetime, "updated_at" datetime)  + SQL (0.1ms) PRAGMA index_list("preferences") + SQL (0.6ms) CREATE UNIQUE INDEX "index_preferences_on_owner_and_attribute_and_preference" ON "preferences" ("owner_id", "owner_type", "attribute", "group_id", "group_type") + SQL (0.8ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) CREATE TABLE "product_option_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "product_id" integer, "option_type_id" integer, "position" integer, "created_at" datetime, "updated_at" datetime)  + SQL (3.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.6ms) CREATE TABLE "product_properties" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "product_id" integer, "property_id" integer, "value" varchar(255), "created_at" datetime, "updated_at" datetime)  + SQL (0.8ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "description" text, "created_at" datetime, "updated_at" datetime, "permalink" varchar(255), "available_on" datetime, "tax_category_id" integer, "shipping_category_id" integer, "deleted_at" datetime, "meta_description" varchar(255), "meta_keywords" varchar(255))  + SQL (0.1ms) PRAGMA index_list("products") + SQL (0.4ms) CREATE INDEX "index_products_on_available_on" ON "products" ("available_on") + SQL (0.2ms) PRAGMA index_list("products") + SQL (0.1ms) PRAGMA index_info('index_products_on_available_on') + SQL (0.3ms) CREATE INDEX "index_products_on_deleted_at" ON "products" ("deleted_at") + SQL (0.2ms) PRAGMA index_list("products") + SQL (0.2ms) PRAGMA index_info('index_products_on_deleted_at') + SQL (0.2ms) PRAGMA index_info('index_products_on_available_on') + SQL (0.4ms) CREATE INDEX "index_products_on_name" ON "products" ("name") + SQL (0.3ms) PRAGMA index_list("products") + SQL (0.2ms) PRAGMA index_info('index_products_on_name') + SQL (0.2ms) PRAGMA index_info('index_products_on_deleted_at') + SQL (0.2ms) PRAGMA index_info('index_products_on_available_on') + SQL (0.4ms) CREATE INDEX "index_products_on_permalink" ON "products" ("permalink") + SQL (0.8ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) CREATE TABLE "products_taxons" ("product_id" integer, "taxon_id" integer)  + SQL (0.1ms) PRAGMA index_list("products_taxons") + SQL (0.4ms) CREATE INDEX "index_products_taxons_on_product_id" ON "products_taxons" ("product_id") + SQL (0.2ms) PRAGMA index_list("products_taxons") + SQL (0.1ms) PRAGMA index_info('index_products_taxons_on_product_id') + SQL (0.3ms) CREATE INDEX "index_products_taxons_on_taxon_id" ON "products_taxons" ("taxon_id") + SQL (0.8ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "properties" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "presentation" varchar(255) NOT NULL, "created_at" datetime, "updated_at" datetime) + SQL (0.8ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "properties_prototypes" ("prototype_id" integer, "property_id" integer) + SQL (0.8ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "prototypes" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime) + SQL (1.1ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "roles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255)) + SQL (0.9ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "roles_users" ("role_id" integer, "user_id" integer) + SQL (0.1ms) PRAGMA index_list("roles_users") + SQL (0.4ms) CREATE INDEX "index_roles_users_on_role_id" ON "roles_users" ("role_id") + SQL (0.2ms) PRAGMA index_list("roles_users") + SQL (0.1ms) PRAGMA index_info('index_roles_users_on_role_id') + SQL (0.7ms) CREATE INDEX "index_roles_users_on_user_id" ON "roles_users" ("user_id") + SQL (0.9ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "shipments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "shipping_method_id" integer, "tracking" varchar(255), "created_at" datetime, "updated_at" datetime, "number" varchar(255), "cost" decimal(8,2), "shipped_at" datetime, "address_id" integer)  + SQL (0.9ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "shipping_categories" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime)  + SQL (0.9ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) CREATE TABLE "shipping_methods" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "zone_id" integer, "name" varchar(255), "created_at" datetime, "updated_at" datetime)  + SQL (1.0ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "state_events" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "user_id" integer, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "previous_state" varchar(255))  + SQL (0.9ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) CREATE TABLE "states" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "abbr" varchar(255), "country_id" integer)  + SQL (1.0ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "tax_categories" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "description" varchar(255), "created_at" datetime, "updated_at" datetime)  + SQL (1.0ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "tax_rates" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "zone_id" integer, "amount" decimal(8,4), "created_at" datetime, "updated_at" datetime, "tax_category_id" integer)  + SQL (1.0ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) CREATE TABLE "taxonomies" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) NOT NULL, "created_at" datetime, "updated_at" datetime)  + SQL (1.1ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "taxons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "taxonomy_id" integer NOT NULL, "parent_id" integer, "position" integer DEFAULT 0, "name" varchar(255) NOT NULL, "created_at" datetime, "updated_at" datetime, "permalink" varchar(255))  + SQL (1.1ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128) DEFAULT '' NOT NULL, "salt" varchar(128) DEFAULT '' NOT NULL, "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer)  + SQL (1.1ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "variants" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "product_id" integer, "sku" varchar(255) DEFAULT '' NOT NULL, "price" decimal(8,2) NOT NULL, "weight" decimal(8,2), "height" decimal(8,2), "width" decimal(8,2), "depth" decimal(8,2), "deleted_at" datetime, "is_master" boolean DEFAULT 'f')  + SQL (0.1ms) PRAGMA index_list("variants") + SQL (0.4ms) CREATE INDEX "index_variants_on_product_id" ON "variants" ("product_id") + SQL (1.1ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "zone_members" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "zone_id" integer, "zoneable_id" integer, "zoneable_type" varchar(255), "created_at" datetime, "updated_at" datetime)  + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "zones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "description" varchar(255), "created_at" datetime, "updated_at" datetime)  + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20090823005402') +Migrating to CreateIndexesForInventoryUnits (20090904192342) + SQL (0.1ms) PRAGMA index_list("inventory_units") + SQL (0.6ms) CREATE INDEX "index_inventory_units_on_variant_id" ON "inventory_units" ("variant_id") + SQL (0.2ms) PRAGMA index_list("inventory_units") + SQL (0.1ms) PRAGMA index_info('index_inventory_units_on_variant_id') + SQL (0.4ms) CREATE INDEX "index_inventory_units_on_order_id" ON "inventory_units" ("order_id") + SQL (1.1ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20090904192342') +Migrating to AddCountOnHandToVariantsAndProducts (20090923100315) + SQL (0.9ms) ALTER TABLE "variants" ADD "count_on_hand" integer DEFAULT 0 NOT NULL + SQL (1.7ms) ALTER TABLE "products" ADD "count_on_hand" integer DEFAULT 0 NOT NULL + SQL (1.1ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + Variant Load (0.3ms) SELECT "variants".* FROM "variants" + Product Load (0.3ms) SELECT "products".* FROM "products" + SQL (1.1ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20090923100315') +Migrating to ChangeTaxonsToNestedSet (20091007134354) + SQL (0.8ms) ALTER TABLE "taxons" ADD "lft" integer + SQL (0.5ms) ALTER TABLE "taxons" ADD "rgt" integer + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + Property Load (0.2ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.1ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + Taxon Load (0.3ms) SELECT "taxons".* FROM "taxons" WHERE (parent_id IS NULL) ORDER BY position ASC + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091007134354') +Migrating to MoveToConfigurableGateways (20091008091614) + SQL (0.6ms) DROP TABLE "gateways" + SQL (0.5ms) DROP TABLE "gateway_options" + SQL (0.4ms) DROP TABLE "gateway_option_values" + SQL (0.4ms) DROP TABLE "gateway_configurations" + SQL (1.1ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.5ms) CREATE TABLE "gateways" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "name" varchar(255), "description" text, "active" boolean DEFAULT 't', "environment" varchar(255) DEFAULT 'development', "server" varchar(255) DEFAULT 'test', "test_mode" boolean DEFAULT 't', "created_at" datetime, "updated_at" datetime) + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091008091614') +Migrating to ProductGroupsAndScopes (20091012120519) + SQL (1.2ms) CREATE TABLE "product_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "permalink" varchar(255), "order" varchar(255))  + SQL (0.5ms) CREATE TABLE "product_scopes" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "product_group_id" integer, "name" varchar(255), "arguments" text) + SQL (0.1ms) PRAGMA index_list("product_groups") + SQL (0.4ms) CREATE INDEX "index_product_groups_on_name" ON "product_groups" ("name") + SQL (0.2ms) PRAGMA index_list("product_groups") + SQL (0.2ms) PRAGMA index_info('index_product_groups_on_name') + SQL (0.4ms) CREATE INDEX "index_product_groups_on_permalink" ON "product_groups" ("permalink") + SQL (0.1ms) PRAGMA index_list("product_scopes") + SQL (0.4ms) CREATE INDEX "index_product_scopes_on_name" ON "product_scopes" ("name") + SQL (0.2ms) PRAGMA index_list("product_scopes") + SQL (0.2ms) PRAGMA index_info('index_product_scopes_on_name') + SQL (0.4ms) CREATE INDEX "index_product_scopes_on_product_group_id" ON "product_scopes" ("product_group_id") + SQL (4.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091012120519') +Migrating to AddOpenIdAuthenticationTables (20091015110842) + SQL (1.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.9ms) CREATE TABLE "open_id_authentication_associations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "issued" integer, "lifetime" integer, "handle" varchar(255), "assoc_type" varchar(255), "server_url" blob, "secret" blob) + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "open_id_authentication_nonces" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "timestamp" integer NOT NULL, "server_url" varchar(255), "salt" varchar(255) NOT NULL) + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091015110842') +Migrating to AddOpenidFieldToUsers (20091015153048) + SQL (0.8ms) ALTER TABLE "users" ADD "openid_identifier" varchar(255) + SQL (0.1ms) PRAGMA index_list("users") + SQL (0.4ms) CREATE INDEX "index_users_on_openid_identifier" ON "users" ("openid_identifier") + SQL (0.8ms) CREATE TEMPORARY TABLE "altered_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128) DEFAULT '' NOT NULL, "salt" varchar(128) DEFAULT '' NOT NULL, "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer, "openid_identifier" varchar(255)) + SQL (0.1ms) PRAGMA index_list("users") + SQL (0.1ms) PRAGMA index_info('index_users_on_openid_identifier') + SQL (0.1ms) PRAGMA index_list("altered_users") + SQL (0.3ms) CREATE INDEX "temp_index_altered_users_on_openid_identifier" ON "altered_users" ("openid_identifier") + SQL (0.7ms) DROP TABLE "users" + SQL (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128) DEFAULT '' NOT NULL, "salt" varchar(128) DEFAULT '' NOT NULL, "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer, "openid_identifier" varchar(255)) + SQL (0.2ms) PRAGMA index_list("altered_users") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_users_on_openid_identifier') + SQL (0.1ms) PRAGMA index_list("users") + SQL (0.4ms) CREATE INDEX "index_users_on_openid_identifier" ON "users" ("openid_identifier") + SQL (0.6ms) DROP TABLE "altered_users" + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128) DEFAULT '' NOT NULL, "salt" varchar(128) DEFAULT '' NOT NULL, "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer, "openid_identifier" varchar(255)) + SQL (0.2ms) PRAGMA index_list("users") + SQL (0.1ms) PRAGMA index_info('index_users_on_openid_identifier') + SQL (0.1ms) PRAGMA index_list("altered_users") + SQL (0.3ms) CREATE INDEX "temp_index_altered_users_on_openid_identifier" ON "altered_users" ("openid_identifier") + SQL (0.5ms) DROP TABLE "users" + SQL (0.7ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128), "salt" varchar(128) DEFAULT '' NOT NULL, "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer, "openid_identifier" varchar(255)) + SQL (0.2ms) PRAGMA index_list("altered_users") + SQL (0.2ms) PRAGMA index_info('temp_index_altered_users_on_openid_identifier') + SQL (0.1ms) PRAGMA index_list("users") + SQL (0.4ms) CREATE INDEX "index_users_on_openid_identifier" ON "users" ("openid_identifier") + SQL (0.5ms) DROP TABLE "altered_users" + SQL (1.5ms) CREATE TEMPORARY TABLE "altered_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128), "salt" varchar(128) DEFAULT '' NOT NULL, "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer, "openid_identifier" varchar(255)) + SQL (0.2ms) PRAGMA index_list("users") + SQL (0.1ms) PRAGMA index_info('index_users_on_openid_identifier') + SQL (0.1ms) PRAGMA index_list("altered_users") + SQL (0.3ms) CREATE INDEX "temp_index_altered_users_on_openid_identifier" ON "altered_users" ("openid_identifier") + SQL (0.4ms) DROP TABLE "users" + SQL (0.5ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128), "salt" varchar(128), "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer, "openid_identifier" varchar(255)) + SQL (0.2ms) PRAGMA index_list("altered_users") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_users_on_openid_identifier') + SQL (0.1ms) PRAGMA index_list("users") + SQL (0.3ms) CREATE INDEX "index_users_on_openid_identifier" ON "users" ("openid_identifier") + SQL (0.3ms) DROP TABLE "altered_users" + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091015153048') +Migrating to ChangePreferenceValueType (20091016174634) + SQL (0.4ms) PRAGMA index_list("preferences") + SQL (0.3ms) PRAGMA index_info('index_preferences_on_owner_and_attribute_and_preference') + SQL (0.5ms) DROP INDEX "index_preferences_on_owner_and_attribute_and_preference" + SQL (2.4ms) CREATE TEMPORARY TABLE "altered_preferences" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "attribute" varchar(100) NOT NULL, "owner_id" integer(30) NOT NULL, "owner_type" varchar(50) NOT NULL, "group_id" integer, "group_type" varchar(50), "value" varchar(255), "created_at" datetime, "updated_at" datetime)  + SQL (0.1ms) PRAGMA index_list("preferences") + SQL (0.6ms) DROP TABLE "preferences" + SQL (0.6ms) CREATE TABLE "preferences" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "attribute" varchar(100) NOT NULL, "owner_id" integer(30) NOT NULL, "owner_type" varchar(50) NOT NULL, "group_id" integer, "group_type" varchar(50), "value" text(255), "created_at" datetime, "updated_at" datetime) + SQL (0.1ms) PRAGMA index_list("altered_preferences") + SQL (0.3ms) DROP TABLE "altered_preferences" + SQL (1.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091016174634') +Migrating to CreateBillingIntegrations (20091017175558) + SQL (0.8ms) CREATE TABLE "billing_integrations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "name" varchar(255), "description" text, "active" boolean DEFAULT 't', "environment" varchar(255) DEFAULT 'development', "created_at" datetime, "updated_at" datetime)  + SQL (2.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091017175558') +Migrating to ChargeRefactoring (20091021133257) + SQL (1.0ms) ALTER TABLE "orders" ADD "completed_at" datetime + ChargeRefactoring::Order Load (1.0ms) SELECT "orders".* FROM "orders" + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_checkouts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "email" varchar(255), "ip_address" varchar(255), "special_instructions" text, "bill_address_id" integer, "completed_at" datetime, "created_at" datetime, "updated_at" datetime) + SQL (0.1ms) PRAGMA index_list("checkouts") + SQL (0.6ms) DROP TABLE "checkouts" + SQL (0.6ms) CREATE TABLE "checkouts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "email" varchar(255), "ip_address" varchar(255), "special_instructions" text, "bill_address_id" integer, "created_at" datetime, "updated_at" datetime)  + SQL (0.1ms) PRAGMA index_list("altered_checkouts") + SQL (0.3ms) DROP TABLE "altered_checkouts" + SQL (0.4ms) CREATE TEMPORARY TABLE "altered_adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "type" varchar(255), "amount" decimal DEFAULT 0.0 NOT NULL, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "adjustment_source_id" integer, "adjustment_source_type" varchar(255), "secondary_type" varchar(255)) + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.5ms) DROP TABLE "adjustments" + SQL (0.5ms) CREATE TABLE "adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "type" varchar(255), "amount" decimal, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "adjustment_source_id" integer, "adjustment_source_type" varchar(255), "secondary_type" varchar(255))  + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.3ms) DROP TABLE "altered_adjustments" + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) UPDATE "adjustments" SET type = secondary_type  + SQL (0.2ms) UPDATE "adjustments" SET type = 'CouponCredit' WHERE (type = 'Credit') + SQL (0.4ms) CREATE TEMPORARY TABLE "altered_adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "type" varchar(255), "amount" decimal, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "adjustment_source_id" integer, "adjustment_source_type" varchar(255), "secondary_type" varchar(255))  + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.5ms) DROP TABLE "adjustments" + SQL (3.1ms) CREATE TABLE "adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "type" varchar(255), "amount" decimal, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "adjustment_source_id" integer, "adjustment_source_type" varchar(255)) + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.3ms) DROP TABLE "altered_adjustments" + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091021133257') +Migrating to AddSomeIndexes (20091104151730) + SQL (0.1ms) PRAGMA index_list("taxons") + SQL (0.6ms) CREATE INDEX "index_taxons_on_permalink" ON "taxons" ("permalink") + SQL (0.1ms) PRAGMA index_list("taxons") + SQL (0.1ms) PRAGMA index_info('index_taxons_on_permalink') + SQL (0.4ms) CREATE INDEX "index_taxons_on_parent_id" ON "taxons" ("parent_id") + SQL (0.3ms) PRAGMA index_list("taxons") + SQL (0.1ms) PRAGMA index_info('index_taxons_on_parent_id') + SQL (0.1ms) PRAGMA index_info('index_taxons_on_permalink') + SQL (0.4ms) CREATE INDEX "index_taxons_on_taxonomy_id" ON "taxons" ("taxonomy_id") + SQL (0.1ms) PRAGMA index_list("assets") + SQL (0.5ms) CREATE INDEX "index_assets_on_viewable_id" ON "assets" ("viewable_id") + SQL (0.2ms) PRAGMA index_list("assets") + SQL (0.1ms) PRAGMA index_info('index_assets_on_viewable_id') + SQL (0.4ms) CREATE INDEX "index_assets_on_viewable_type_and_type" ON "assets" ("viewable_type", "type") + SQL (0.1ms) PRAGMA index_list("product_properties") + SQL (0.4ms) CREATE INDEX "index_product_properties_on_product_id" ON "product_properties" ("product_id") + SQL (0.2ms) PRAGMA index_list("option_values_variants") + SQL (0.3ms) PRAGMA index_info('index_option_values_variants_on_variant_id') + SQL (0.4ms) CREATE INDEX "index_option_values_variants_on_variant_id_and_option_value_id" ON "option_values_variants" ("variant_id", "option_value_id") + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091104151730') +Migrating to CheckoutStateMachine (20091126190904) + SQL (0.8ms) ALTER TABLE "checkouts" ADD "state" varchar(255) + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091126190904') +Migrating to StateForShipments (20091209153045) + SQL (0.8ms) ALTER TABLE "shipments" ADD "state" varchar(255) + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091209153045') +Migrating to MakeStateEventsPolymorphic (20091209202200) + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_state_events" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stateful_id" integer, "user_id" integer, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "previous_state" varchar(255)) + SQL (0.1ms) PRAGMA index_list("state_events") + SQL (0.5ms) DROP TABLE "state_events" + SQL (0.7ms) CREATE TABLE "state_events" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stateful_id" integer, "user_id" integer, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "previous_state" varchar(255))  + SQL (0.1ms) PRAGMA index_list("altered_state_events") + SQL (0.3ms) DROP TABLE "altered_state_events" + SQL (2.8ms) ALTER TABLE "state_events" ADD "stateful_type" varchar(255) + SQL (0.2ms) UPDATE "state_events" SET "stateful_type" = 'Order'  + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091209202200') +Migrating to ShipAddressIdForCheckouts (20091211203813) + SQL (0.8ms) ALTER TABLE "checkouts" ADD "ship_address_id" integer + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091211203813') +Migrating to ShippingMethodIdForCheckouts (20091212161118) + SQL (0.9ms) ALTER TABLE "checkouts" ADD "shipping_method_id" integer + SQL (1.1ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091212161118') +Migrating to CreditcardLastFourDigits (20091213222815) + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_creditcards" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "number" text, "month" varchar(255), "year" varchar(255), "verification_value" text, "cc_type" varchar(255), "last_digits" varchar(255), "first_name" varchar(255), "last_name" varchar(255), "created_at" datetime, "updated_at" datetime, "start_month" varchar(255), "start_year" varchar(255), "issue_number" varchar(255), "address_id" integer, "checkout_id" integer) + SQL (0.1ms) PRAGMA index_list("creditcards") + SQL (0.5ms) DROP TABLE "creditcards" + SQL (0.6ms) CREATE TABLE "creditcards" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "number" text, "month" varchar(255), "year" varchar(255), "verification_value" text, "cc_type" varchar(255), "last_digits" varchar(255), "first_name" varchar(255), "last_name" varchar(255), "created_at" datetime, "updated_at" datetime, "start_month" varchar(255), "start_year" varchar(255), "issue_number" varchar(255), "address_id" integer, "checkout_id" integer)  + SQL (0.1ms) PRAGMA index_list("altered_creditcards") + SQL (0.3ms) DROP TABLE "altered_creditcards" + CreditcardLastFourDigits::Creditcard Load (0.3ms) SELECT "creditcards".* FROM "creditcards" + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091213222815') +Migrating to PopulateLegacyShipmentState (20091214183826) + PopulateLegacyShipmentState::Shipment Load (0.4ms) SELECT "shipments".* FROM "shipments" + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091214183826') +Migrating to AddCostPrice (20100105090147) + SQL (1.0ms) ALTER TABLE "variants" ADD "cost_price" decimal(8,2) DEFAULT NULL + SQL (1.1ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100105090147') +Migrating to ShipmentIdForInventoryUnits (20100105132138) + SQL (0.9ms) ALTER TABLE "inventory_units" ADD "shipment_id" integer + SQL (0.2ms) PRAGMA index_list("inventory_units") + SQL (0.2ms) PRAGMA index_info('index_inventory_units_on_order_id') + SQL (0.1ms) PRAGMA index_info('index_inventory_units_on_variant_id') + SQL (0.4ms) CREATE INDEX "index_inventory_units_on_shipment_id" ON "inventory_units" ("shipment_id") + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Shipment Load (0.6ms) SELECT "shipments".* FROM "shipments" + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100105132138') +Migrating to CimFieldsForCreditcards (20100111205525) + SQL (1.1ms) ALTER TABLE "creditcards" ADD "gateway_customer_profile_id" varchar(255) + SQL (0.6ms) ALTER TABLE "creditcards" ADD "gateway_payment_profile_id" varchar(255) + SQL (9.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100111205525') +Migrating to CreateReturnAuthorizations (20100112151511) + SQL (6.1ms) CREATE TABLE "return_authorizations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "number" varchar(255), "amount" decimal(8,2) DEFAULT 0.0 NOT NULL, "order_id" integer, "reason" text, "state" varchar(255), "created_at" datetime, "updated_at" datetime) + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100112151511') +Migrating to AddReturnAuthorizationToInventoryUnits (20100113090919) + SQL (4.2ms) ALTER TABLE "inventory_units" ADD "return_authorization_id" integer + SQL (1.6ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100113090919') +Migrating to CreateTrackers (20100113203104) + SQL (0.8ms) CREATE TABLE "trackers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "environment" varchar(255), "analytics_id" varchar(255), "active" boolean DEFAULT 't', "created_at" datetime, "updated_at" datetime) + SQL (2.1ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100113203104') +Migrating to CreditcardIdForCreditcardTxns (20100121160010) + SQL (1.1ms) ALTER TABLE "creditcard_txns" ADD "creditcard_id" integer + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100121160010') +Migrating to OriginalCreditcardTxnIdForCreditcardTxns (20100121183934) + SQL (1.1ms) ALTER TABLE "creditcard_txns" ADD "original_creditcard_txn_id" integer + SQL (1.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100121183934') +Migrating to AddTestModeToBillingIntegration (20100125145351) + SQL (1.1ms) ALTER TABLE "billing_integrations" ADD "test_mode" boolean DEFAULT 't' + SQL (0.5ms) ALTER TABLE "billing_integrations" ADD "server" varchar(255) DEFAULT 'test' + SQL (2.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100125145351') +Migrating to CreateProductsProductGroups (20100126103714) + SQL (1.0ms) CREATE TABLE "product_groups_products" ("product_id" integer, "product_group_id" integer)  + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100126103714') +Migrating to CreatePaymentMethods (20100209025806) + SQL (0.9ms) CREATE TABLE "payment_methods" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "name" varchar(255), "description" text, "active" boolean DEFAULT 't', "environment" varchar(255) DEFAULT 'development', "created_at" datetime, "updated_at" datetime) + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100209025806') +Migrating to PolymorphicPayments (20100209144531) + SQL (0.6ms) CREATE TEMPORARY TABLE "altered_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL, "creditcard_id" integer, "type" varchar(255))  + SQL (0.1ms) PRAGMA index_list("payments") + SQL (0.8ms) DROP TABLE "payments" + SQL (0.6ms) CREATE TABLE "payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL, "creditcard_id" integer) + SQL (0.1ms) PRAGMA index_list("altered_payments") + SQL (0.3ms) DROP TABLE "altered_payments" + SQL (3.3ms) CREATE TEMPORARY TABLE "altered_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL, "creditcard_id" integer)  + SQL (0.1ms) PRAGMA index_list("payments") + SQL (1.2ms) DROP TABLE "payments" + SQL (0.4ms) CREATE TABLE "payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL) + SQL (0.1ms) PRAGMA index_list("altered_payments") + SQL (0.3ms) DROP TABLE "altered_payments" + SQL (0.4ms) CREATE TEMPORARY TABLE "altered_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payable_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL)  + SQL (0.1ms) PRAGMA index_list("payments") + SQL (0.4ms) DROP TABLE "payments" + SQL (0.5ms) CREATE TABLE "payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payable_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL) + SQL (0.1ms) PRAGMA index_list("altered_payments") + SQL (0.3ms) DROP TABLE "altered_payments" + SQL (0.5ms) ALTER TABLE "payments" ADD "payable_type" varchar(255) + SQL (0.5ms) ALTER TABLE "payments" ADD "payment_method" varchar(255) + SQL (0.5ms) ALTER TABLE "payments" ADD "source_id" integer + SQL (0.5ms) ALTER TABLE "payments" ADD "source_type" varchar(255) + SQL (0.1ms) UPDATE payments SET payable_type = 'Order' + Creditcard Load (0.3ms) SELECT "creditcards".* FROM "creditcards" + SQL (0.4ms) CREATE TEMPORARY TABLE "altered_creditcards" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "number" text, "month" varchar(255), "year" varchar(255), "verification_value" text, "cc_type" varchar(255), "last_digits" varchar(255), "first_name" varchar(255), "last_name" varchar(255), "created_at" datetime, "updated_at" datetime, "start_month" varchar(255), "start_year" varchar(255), "issue_number" varchar(255), "address_id" integer, "checkout_id" integer, "gateway_customer_profile_id" varchar(255), "gateway_payment_profile_id" varchar(255))  + SQL (0.1ms) PRAGMA index_list("creditcards") + SQL (0.5ms) DROP TABLE "creditcards" + SQL (0.6ms) CREATE TABLE "creditcards" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "number" text, "month" varchar(255), "year" varchar(255), "verification_value" text, "cc_type" varchar(255), "last_digits" varchar(255), "first_name" varchar(255), "last_name" varchar(255), "created_at" datetime, "updated_at" datetime, "start_month" varchar(255), "start_year" varchar(255), "issue_number" varchar(255), "address_id" integer, "gateway_customer_profile_id" varchar(255), "gateway_payment_profile_id" varchar(255)) + SQL (0.1ms) PRAGMA index_list("altered_creditcards") + SQL (0.3ms) DROP TABLE "altered_creditcards" + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100209144531') +Migrating to ChangePaymentsPaymentMethodToBelongsTo (20100213103131) + SQL (0.4ms) CREATE TEMPORARY TABLE "altered_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payable_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL, "payable_type" varchar(255), "payment_method" varchar(255), "source_id" integer, "source_type" varchar(255))  + SQL (0.1ms) PRAGMA index_list("payments") + SQL (0.5ms) DROP TABLE "payments" + SQL (0.5ms) CREATE TABLE "payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payable_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL, "payable_type" varchar(255), "source_id" integer, "source_type" varchar(255)) + SQL (0.1ms) PRAGMA index_list("altered_payments") + SQL (0.2ms) DROP TABLE "altered_payments" + SQL (0.5ms) ALTER TABLE "payments" ADD "payment_method_id" integer + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100213103131') +Migrating to AssignCreditcardTxnsToPayment (20100214212536) + SQL (0.9ms) ALTER TABLE "creditcard_txns" ADD "payment_id" integer + SQL (0.2ms) SELECT * FROM creditcard_txns + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_creditcard_txns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "creditcard_payment_id" integer, "amount" decimal DEFAULT 0.0 NOT NULL, "txn_type" integer, "response_code" varchar(255), "avs_response" text, "cvv_response" text, "created_at" datetime, "updated_at" datetime, "creditcard_id" integer, "original_creditcard_txn_id" integer, "payment_id" integer) + SQL (0.1ms) PRAGMA index_list("creditcard_txns") + SQL (0.7ms) DROP TABLE "creditcard_txns" + SQL (0.6ms) CREATE TABLE "creditcard_txns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "amount" decimal DEFAULT 0.0 NOT NULL, "txn_type" integer, "response_code" varchar(255), "avs_response" text, "cvv_response" text, "created_at" datetime, "updated_at" datetime, "creditcard_id" integer, "original_creditcard_txn_id" integer, "payment_id" integer)  + SQL (0.1ms) PRAGMA index_list("altered_creditcard_txns") + SQL (0.3ms) DROP TABLE "altered_creditcard_txns" + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100214212536') +Migrating to StiForTransactions (20100223170312) + SQL (0.9ms) ALTER TABLE "creditcard_txns" RENAME TO "transactions" + SQL (0.6ms) ALTER TABLE "transactions" ADD "type" varchar(255) + SQL (0.4ms) CREATE TEMPORARY TABLE "altered_transactions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "amount" decimal DEFAULT 0.0 NOT NULL, "txn_type" integer, "response_code" varchar(255), "avs_response" text, "cvv_response" text, "created_at" datetime, "updated_at" datetime, "creditcard_id" integer, "original_creditcard_txn_id" integer, "payment_id" integer, "type" varchar(255)) + SQL (0.1ms) PRAGMA index_list("transactions") + SQL (0.6ms) DROP TABLE "transactions" + SQL (0.5ms) CREATE TABLE "transactions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "amount" decimal DEFAULT 0.0 NOT NULL, "txn_type" integer, "response_code" varchar(255), "avs_response" text, "cvv_response" text, "created_at" datetime, "updated_at" datetime, "original_creditcard_txn_id" integer, "payment_id" integer, "type" varchar(255))  + SQL (0.1ms) PRAGMA index_list("altered_transactions") + SQL (0.3ms) DROP TABLE "altered_transactions" + SQL (2.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100223170312') +Migrating to DropBillingIntegrations (20100223183812) + SQL (0.7ms) DROP TABLE "billing_integrations" + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100223183812') +Migrating to DeletedAtForPaymentMethods (20100224153127) + SQL (0.8ms) ALTER TABLE "payment_methods" ADD "deleted_at" datetime DEFAULT NULL + SQL (2.7ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100224153127') +Migrating to AddAdjustmentsIndex (20100301163454) + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (1.9ms) CREATE INDEX "index_adjustments_on_order_id" ON "adjustments" ("order_id") + SQL (3.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100301163454') +Migrating to FixByPopularity (20100306153445) + SQL (0.3ms) UPDATE "product_scopes" SET name='descend_by_popularity' WHERE (name='by_popularity') + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100306153445') +Migrating to AddAltTextToImages (20100317120946) + SQL (1.5ms) ALTER TABLE "assets" ADD "alt" text + SQL (1.8ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100317120946') +Migrating to AddDisplayToPaymentMethods (20100427121301) + SQL (1.6ms) ALTER TABLE "payment_methods" ADD "display" varchar(255) DEFAULT NULL + SQL (1.9ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100427121301') +Migrating to AddAddressesCheckoutsIndexes (20100504142133) + SQL (0.1ms) PRAGMA index_list("addresses") + SQL (0.6ms) CREATE INDEX "index_addresses_on_firstname" ON "addresses" ("firstname") + SQL (0.2ms) PRAGMA index_list("addresses") + SQL (0.2ms) PRAGMA index_info('index_addresses_on_firstname') + SQL (0.7ms) CREATE INDEX "index_addresses_on_lastname" ON "addresses" ("lastname") + SQL (0.1ms) PRAGMA index_list("checkouts") + SQL (0.4ms) CREATE INDEX "index_checkouts_on_order_id" ON "checkouts" ("order_id") + SQL (0.2ms) PRAGMA index_list("checkouts") + SQL (0.2ms) PRAGMA index_info('index_checkouts_on_order_id') + SQL (0.8ms) CREATE INDEX "index_checkouts_on_bill_address_id" ON "checkouts" ("bill_address_id") + SQL (2.1ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100504142133') +Migrating to AddIconToTaxons (20100506180619) + SQL (0.9ms) ALTER TABLE "taxons" ADD "icon_file_name" varchar(255) + SQL (0.6ms) ALTER TABLE "taxons" ADD "icon_content_type" varchar(255) + SQL (0.7ms) ALTER TABLE "taxons" ADD "icon_file_size" integer + SQL (0.7ms) ALTER TABLE "taxons" ADD "icon_updated_at" datetime + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100506180619') +Migrating to AddDescriptionToTaxons (20100506185838) + SQL (0.9ms) ALTER TABLE "taxons" ADD "description" text + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100506185838') +Migrating to IndexForShipmentsNumber (20100528155333) + SQL (0.1ms) PRAGMA index_list("shipments") + SQL (0.8ms) CREATE INDEX "index_shipments_on_number" ON "shipments" ("number") + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100528155333') +Migrating to AddIndexOnUsersPersistenceToken (20100528185820) + SQL (0.2ms) PRAGMA index_list("users") + SQL (0.1ms) PRAGMA index_info('index_users_on_openid_identifier') + SQL (0.6ms) CREATE INDEX "index_users_on_persistence_token" ON "users" ("persistence_token") + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100528185820') +Migrating to AddDefaultToTaxCategories (20100605152042) + SQL (1.0ms) ALTER TABLE "tax_categories" ADD "is_default" boolean DEFAULT 'f' + SQL (1.7ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100605152042') +Migrating to AddDisplayToShippingMethods (20100624110730) + SQL (0.8ms) ALTER TABLE "shipping_methods" ADD "display_on" varchar(255) DEFAULT NULL + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100624110730') +Migrating to RenamePaymentMethodDisplay (20100624123336) + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_payment_methods" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "name" varchar(255), "description" text, "active" boolean DEFAULT 't', "environment" varchar(255) DEFAULT 'development', "created_at" datetime, "updated_at" datetime, "deleted_at" datetime, "display_on" varchar(255))  + SQL (0.1ms) PRAGMA index_list("payment_methods") + SQL (0.9ms) DROP TABLE "payment_methods" + SQL (0.6ms) CREATE TABLE "payment_methods" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "name" varchar(255), "description" text, "active" boolean DEFAULT 't', "environment" varchar(255) DEFAULT 'development', "created_at" datetime, "updated_at" datetime, "deleted_at" datetime, "display_on" varchar(255)) + SQL (0.1ms) PRAGMA index_list("altered_payment_methods") + SQL (0.3ms) DROP TABLE "altered_payment_methods" + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100624123336') +Migrating to RenamePreferencesField (20100624175547) + SQL (0.8ms) CREATE TEMPORARY TABLE "altered_preferences" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(100) NOT NULL, "owner_id" integer(30) NOT NULL, "owner_type" varchar(50) NOT NULL, "group_id" integer, "group_type" varchar(50), "value" text(255), "created_at" datetime, "updated_at" datetime)  + SQL (0.1ms) PRAGMA index_list("preferences") + SQL (1.5ms) DROP TABLE "preferences" + SQL (0.7ms) CREATE TABLE "preferences" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(100) NOT NULL, "owner_id" integer(30) NOT NULL, "owner_type" varchar(50) NOT NULL, "group_id" integer, "group_type" varchar(50), "value" text(255), "created_at" datetime, "updated_at" datetime) + SQL (0.1ms) PRAGMA index_list("altered_preferences") + SQL (1.1ms) DROP TABLE "altered_preferences" + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100624175547') +Migrating to AddGuestFlag (20100811163637) + SQL (0.9ms) ALTER TABLE "users" ADD "guest" boolean + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100811163637') +Migrating to DropOrderToken (20100811205836) + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "number" varchar(15), "item_total" decimal DEFAULT 0.0 NOT NULL, "total" decimal DEFAULT 0.0 NOT NULL, "created_at" datetime, "updated_at" datetime, "state" varchar(255), "token" varchar(255), "adjustment_total" decimal DEFAULT 0.0 NOT NULL, "credit_total" decimal DEFAULT 0.0 NOT NULL, "completed_at" datetime) + SQL (0.2ms) PRAGMA index_list("orders") + SQL (0.2ms) PRAGMA index_info('index_orders_on_number') + SQL (0.1ms) PRAGMA index_list("altered_orders") + SQL (0.3ms) CREATE INDEX "temp_index_altered_orders_on_number" ON "altered_orders" ("number") + SQL (0.8ms) DROP TABLE "orders" + SQL (0.5ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "number" varchar(15), "item_total" decimal DEFAULT 0.0 NOT NULL, "total" decimal DEFAULT 0.0 NOT NULL, "created_at" datetime, "updated_at" datetime, "state" varchar(255), "adjustment_total" decimal DEFAULT 0.0 NOT NULL, "credit_total" decimal DEFAULT 0.0 NOT NULL, "completed_at" datetime) + SQL (0.2ms) PRAGMA index_list("altered_orders") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_orders_on_number') + SQL (0.1ms) PRAGMA index_list("orders") + SQL (0.3ms) CREATE INDEX "index_orders_on_number" ON "orders" ("number") + SQL (0.3ms) DROP TABLE "altered_orders" + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100811205836') +Migrating to PaymentsStateAndAssignedToOrderOnly (20100812162326) + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL, "payable_type" varchar(255), "source_id" integer, "source_type" varchar(255), "payment_method_id" integer) + SQL (0.1ms) PRAGMA index_list("payments") + SQL (0.8ms) DROP TABLE "payments" + SQL (0.7ms) CREATE TABLE "payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL, "payable_type" varchar(255), "source_id" integer, "source_type" varchar(255), "payment_method_id" integer)  + SQL (0.1ms) PRAGMA index_list("altered_payments") + SQL (0.2ms) DROP TABLE "altered_payments" + SQL (0.4ms) CREATE TEMPORARY TABLE "altered_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL, "payable_type" varchar(255), "source_id" integer, "source_type" varchar(255), "payment_method_id" integer) + SQL (0.1ms) PRAGMA index_list("payments") + SQL (0.6ms) DROP TABLE "payments" + SQL (0.4ms) CREATE TABLE "payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL, "source_id" integer, "source_type" varchar(255), "payment_method_id" integer)  + SQL (0.1ms) PRAGMA index_list("altered_payments") + SQL (0.3ms) DROP TABLE "altered_payments" + SQL (1.1ms) ALTER TABLE "payments" ADD "state" varchar(255) + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100812162326') +Migrating to CreateAddressKeysForOrder (20100813023502) + SQL (0.9ms) ALTER TABLE "orders" ADD "bill_address_id" integer + SQL (0.6ms) ALTER TABLE "orders" ADD "ship_address_id" integer + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100813023502') +Migrating to PaymentTotalForOrders (20100813185745) + SQL (0.8ms) ALTER TABLE "orders" ADD "payment_total" decimal(8,2) DEFAULT 0.0 + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100813185745') +Migrating to ShippingMethodIdForOrders (20100816212146) + SQL (0.9ms) ALTER TABLE "orders" ADD "shipping_method_id" integer + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100816212146') +Migrating to AddShipmentAndPaymentState (20100817152723) + SQL (1.1ms) ALTER TABLE "orders" ADD "shipment_state" varchar(255) + SQL (0.6ms) ALTER TABLE "orders" ADD "payment_state" varchar(255) + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100817152723') +Migrating to RefactorAdjustments (20100819170125) + SQL (1.0ms) ALTER TABLE "adjustments" ADD "mandatory" boolean + SQL (0.6ms) ALTER TABLE "adjustments" ADD "frozen" boolean + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "type" varchar(255), "amount" decimal, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "source_id" integer, "adjustment_source_type" varchar(255), "mandatory" boolean, "frozen" boolean)  + SQL (0.2ms) PRAGMA index_list("adjustments") + SQL (0.1ms) PRAGMA index_info('index_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.3ms) CREATE INDEX "temp_index_altered_adjustments_on_order_id" ON "altered_adjustments" ("order_id") + SQL (0.7ms) DROP TABLE "adjustments" + SQL (0.6ms) CREATE TABLE "adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "type" varchar(255), "amount" decimal, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "source_id" integer, "adjustment_source_type" varchar(255), "mandatory" boolean, "frozen" boolean)  + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.6ms) CREATE INDEX "index_adjustments_on_order_id" ON "adjustments" ("order_id") + SQL (0.3ms) DROP TABLE "altered_adjustments" + SQL (0.3ms) CREATE TEMPORARY TABLE "altered_adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "type" varchar(255), "amount" decimal, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "source_id" integer, "source_type" varchar(255), "mandatory" boolean, "frozen" boolean)  + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.1ms) PRAGMA index_info('index_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.3ms) CREATE INDEX "temp_index_altered_adjustments_on_order_id" ON "altered_adjustments" ("order_id") + SQL (0.5ms) DROP TABLE "adjustments" + SQL (0.4ms) CREATE TABLE "adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "type" varchar(255), "amount" decimal, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "source_id" integer, "source_type" varchar(255), "mandatory" boolean, "frozen" boolean)  + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.3ms) CREATE INDEX "index_adjustments_on_order_id" ON "adjustments" ("order_id") + SQL (0.3ms) DROP TABLE "altered_adjustments" + SQL (0.5ms) ALTER TABLE "adjustments" ADD "originator_id" integer + SQL (0.5ms) ALTER TABLE "adjustments" ADD "originator_type" varchar(255) + SQL (0.7ms) CREATE TEMPORARY TABLE "altered_adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "type" varchar(255), "amount" decimal, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "source_id" integer, "source_type" varchar(255), "mandatory" boolean, "frozen" boolean, "originator_id" integer, "originator_type" varchar(255))  + SQL (0.2ms) PRAGMA index_list("adjustments") + SQL (0.1ms) PRAGMA index_info('index_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.2ms) CREATE INDEX "temp_index_altered_adjustments_on_order_id" ON "altered_adjustments" ("order_id") + SQL (0.4ms) DROP TABLE "adjustments" + SQL (0.5ms) CREATE TABLE "adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "amount" decimal, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "source_id" integer, "source_type" varchar(255), "mandatory" boolean, "frozen" boolean, "originator_id" integer, "originator_type" varchar(255))  + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.4ms) CREATE INDEX "index_adjustments_on_order_id" ON "adjustments" ("order_id") + SQL (0.4ms) DROP TABLE "altered_adjustments" + SQL (0.4ms) CREATE TEMPORARY TABLE "altered_adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "amount" decimal, "label" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "source_id" integer, "source_type" varchar(255), "mandatory" boolean, "frozen" boolean, "originator_id" integer, "originator_type" varchar(255))  + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.1ms) PRAGMA index_info('index_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.2ms) CREATE INDEX "temp_index_altered_adjustments_on_order_id" ON "altered_adjustments" ("order_id") + SQL (0.4ms) DROP TABLE "adjustments" + SQL (0.4ms) CREATE TABLE "adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "amount" decimal, "label" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "source_id" integer, "source_type" varchar(255), "mandatory" boolean, "frozen" boolean, "originator_id" integer, "originator_type" varchar(255))  + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.3ms) CREATE INDEX "index_adjustments_on_order_id" ON "adjustments" ("order_id") + SQL (0.3ms) DROP TABLE "altered_adjustments" + SQL (0.4ms) CREATE TEMPORARY TABLE "altered_adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "amount" decimal, "label" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "source_id" integer, "source_type" varchar(255), "mandatory" boolean, "frozen" boolean, "originator_id" integer, "originator_type" varchar(255))  + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.1ms) PRAGMA index_info('index_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.2ms) CREATE INDEX "temp_index_altered_adjustments_on_order_id" ON "altered_adjustments" ("order_id") + SQL (0.4ms) DROP TABLE "adjustments" + SQL (0.4ms) CREATE TABLE "adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "amount" decimal, "label" varchar(255), "created_at" datetime, "updated_at" datetime, "source_id" integer, "source_type" varchar(255), "mandatory" boolean, "frozen" boolean, "originator_id" integer, "originator_type" varchar(255))  + SQL (0.2ms) PRAGMA index_list("altered_adjustments") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.3ms) CREATE INDEX "index_adjustments_on_order_id" ON "adjustments" ("order_id") + SQL (0.3ms) DROP TABLE "altered_adjustments" + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100819170125') +Migrating to ResponseCodeAndAvsResponseForPayments (20100820135707) + SQL (0.7ms) ALTER TABLE "payments" ADD "response_code" varchar(255) + SQL (0.5ms) ALTER TABLE "payments" ADD "avs_response" varchar(255) + SQL (3.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100820135707') +Migrating to ChangeGuestFlagToAnonymous (20100901171814) + SQL (0.7ms) CREATE TEMPORARY TABLE "altered_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128), "salt" varchar(128), "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer, "openid_identifier" varchar(255), "anonymous" boolean)  + SQL (0.2ms) PRAGMA index_list("users") + SQL (0.1ms) PRAGMA index_info('index_users_on_persistence_token') + SQL (0.2ms) PRAGMA index_info('index_users_on_openid_identifier') + SQL (0.1ms) PRAGMA index_list("altered_users") + SQL (0.3ms) CREATE INDEX "temp_index_altered_users_on_persistence_token" ON "altered_users" ("persistence_token") + SQL (0.1ms) PRAGMA index_list("altered_users") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_users_on_persistence_token') + SQL (0.3ms) CREATE INDEX "temp_index_altered_users_on_openid_identifier" ON "altered_users" ("openid_identifier") + SQL (0.8ms) DROP TABLE "users" + SQL (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128), "salt" varchar(128), "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer, "openid_identifier" varchar(255), "anonymous" boolean)  + SQL (0.2ms) PRAGMA index_list("altered_users") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_users_on_openid_identifier') + SQL (0.1ms) PRAGMA index_info('temp_index_altered_users_on_persistence_token') + SQL (0.1ms) PRAGMA index_list("users") + SQL (0.4ms) CREATE INDEX "index_users_on_openid_identifier" ON "users" ("openid_identifier") + SQL (0.1ms) PRAGMA index_list("users") + SQL (0.1ms) PRAGMA index_info('index_users_on_openid_identifier') + SQL (0.4ms) CREATE INDEX "index_users_on_persistence_token" ON "users" ("persistence_token") + SQL (0.4ms) DROP TABLE "altered_users" + SQL (36.1ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100901171814') +Migrating to EmailForOrders (20100903203949) + SQL (0.9ms) ALTER TABLE "orders" ADD "email" varchar(255) + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100903203949') +Migrating to CreateMailMethods (20100923162011) + SQL (0.7ms) CREATE TABLE "mail_methods" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "environment" varchar(255), "active" boolean DEFAULT 't', "created_at" datetime, "updated_at" datetime) + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100923162011') +Migrating to RenameFrozenToLocked (20100929151905) + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "amount" decimal, "label" varchar(255), "created_at" datetime, "updated_at" datetime, "source_id" integer, "source_type" varchar(255), "mandatory" boolean, "locked" boolean, "originator_id" integer, "originator_type" varchar(255))  + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.2ms) PRAGMA index_info('index_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.3ms) CREATE INDEX "temp_index_altered_adjustments_on_order_id" ON "altered_adjustments" ("order_id") + SQL (0.6ms) DROP TABLE "adjustments" + SQL (0.5ms) CREATE TABLE "adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "amount" decimal, "label" varchar(255), "created_at" datetime, "updated_at" datetime, "source_id" integer, "source_type" varchar(255), "mandatory" boolean, "locked" boolean, "originator_id" integer, "originator_type" varchar(255))  + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.4ms) CREATE INDEX "index_adjustments_on_order_id" ON "adjustments" ("order_id") + SQL (0.5ms) DROP TABLE "altered_adjustments" + SQL (2.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100929151905') +Migrating to MoveSpecialInstructionsToOrders (20101008190536) + SQL (0.9ms) ALTER TABLE "orders" ADD "special_instructions" text + SQL (0.3ms) update orders set special_instructions = (select special_instructions from checkouts where order_id = orders.id) + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101008190536') +Migrating to CreateLogEntries (20101026184700) + SQL (0.8ms) CREATE TABLE "log_entries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "source_id" integer, "source_type" varchar(255), "details" text, "created_at" datetime, "updated_at" datetime)  + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026184700') +Migrating to MigrateTransactionsToPaymentState (20101026184714) + Transaction Load (0.4ms) select * from transactions group by payment_id having count(payment_id) = 1 and txn_type = 1 + Transaction Load (0.2ms) select * from transactions where txn_type=4 + Transaction Load (0.2ms) select * from transactions where txn_type = 2 + Transaction Load (0.2ms) select * from transactions where txn_type = 3 + Transaction Load (0.2ms) select * from transactions where txn_type = 5 + SQL (2.1ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026184714') +Migrating to DeleteInProgressOrders (20101026184746) + SQL (1.9ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) DELETE FROM "orders" WHERE ("orders"."state" = 'in_progress') + SQL (0.3ms) delete from adjustments where order_id not in (select id from orders) + SQL (0.2ms) delete from checkouts where order_id not in (select id from orders) + SQL (0.2ms) delete from shipments where order_id not in (select id from orders) + SQL (0.2ms) delete from payments where order_id not in (select id from orders) + SQL (0.2ms) delete from line_items where order_id not in (select id from orders) + SQL (0.2ms) delete from inventory_units where order_id not in (select id from orders) + SQL (1.8ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (5.0ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026184746') +Migrating to MigrateCheckoutToOrders (20101026184808) + Order Load (0.4ms) SELECT "orders".* FROM "orders" WHERE ("orders"."id" >= 0) ORDER BY orders.id ASC LIMIT 1000 + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026184808') +Migrating to MigrateAdjustments (20101026184833) + SQL (0.4ms) update adjustments set amount = 0.0 where amount is null + SQL (0.2ms) update adjustments set mandatory = 'true', locked = 'true' + SQL (6.7ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026184833') +Migrating to RemoveShippedState (20101026184855) + Order Load (0.5ms) SELECT "orders".* FROM "orders" WHERE ("orders"."state" = 'shipped') + SQL (1.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026184855') +Migrating to PreventNilPaymentTotal (20101026184916) + SQL (0.3ms) update orders set payment_total = 0.0 where payment_total is null + SQL (2.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026184916') +Migrating to PreventNilEmail (20101026184932) + SQL (0.7ms) update orders set email = 'guest@example.com' where email is null + SQL (0.3ms) update orders set email = 'guest@example.com' where email = '' + SQL (2.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026184932') +Migrating to GenerateAnonymousUsers (20101026184959) + Order Load (0.4ms) SELECT "orders".* FROM "orders" WHERE ("orders"."user_id" IS NULL) + SQL (14.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.6ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026184959') +Migrating to UpdateOrderState (20101026185022) + Order Load (0.4ms) SELECT "orders".* FROM "orders" + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026185022') +Migrating to CleanupLegacyTables (20101026192225) + SQL (0.8ms) DROP TABLE "checkouts" + SQL (0.7ms) DROP TABLE "transactions" + SQL (0.6ms) DROP TABLE "open_id_authentication_associations" + SQL (0.4ms) DROP TABLE "open_id_authentication_nonces" + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026192225') +Migrating to RemoveNumberAndCvvFromCredicard (20101028151745) + SQL (0.6ms) CREATE TEMPORARY TABLE "altered_creditcards" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "number" text, "month" varchar(255), "year" varchar(255), "verification_value" text, "cc_type" varchar(255), "last_digits" varchar(255), "first_name" varchar(255), "last_name" varchar(255), "created_at" datetime, "updated_at" datetime, "start_month" varchar(255), "start_year" varchar(255), "issue_number" varchar(255), "address_id" integer, "gateway_customer_profile_id" varchar(255), "gateway_payment_profile_id" varchar(255)) + SQL (0.1ms) PRAGMA index_list("creditcards") + SQL (0.5ms) DROP TABLE "creditcards" + SQL (0.6ms) CREATE TABLE "creditcards" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "month" varchar(255), "year" varchar(255), "verification_value" text, "cc_type" varchar(255), "last_digits" varchar(255), "first_name" varchar(255), "last_name" varchar(255), "created_at" datetime, "updated_at" datetime, "start_month" varchar(255), "start_year" varchar(255), "issue_number" varchar(255), "address_id" integer, "gateway_customer_profile_id" varchar(255), "gateway_payment_profile_id" varchar(255))  + SQL (0.1ms) PRAGMA index_list("altered_creditcards") + SQL (0.2ms) DROP TABLE "altered_creditcards" + SQL (0.4ms) CREATE TEMPORARY TABLE "altered_creditcards" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "month" varchar(255), "year" varchar(255), "verification_value" text, "cc_type" varchar(255), "last_digits" varchar(255), "first_name" varchar(255), "last_name" varchar(255), "created_at" datetime, "updated_at" datetime, "start_month" varchar(255), "start_year" varchar(255), "issue_number" varchar(255), "address_id" integer, "gateway_customer_profile_id" varchar(255), "gateway_payment_profile_id" varchar(255)) + SQL (0.1ms) PRAGMA index_list("creditcards") + SQL (0.5ms) DROP TABLE "creditcards" + SQL (0.6ms) CREATE TABLE "creditcards" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "month" varchar(255), "year" varchar(255), "cc_type" varchar(255), "last_digits" varchar(255), "first_name" varchar(255), "last_name" varchar(255), "created_at" datetime, "updated_at" datetime, "start_month" varchar(255), "start_year" varchar(255), "issue_number" varchar(255), "address_id" integer, "gateway_customer_profile_id" varchar(255), "gateway_payment_profile_id" varchar(255))  + SQL (0.1ms) PRAGMA index_list("altered_creditcards") + SQL (0.3ms) DROP TABLE "altered_creditcards" + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101028151745') +Migrating to DropAnonymousFieldForUser (20101103212716) + SQL (0.6ms) CREATE TEMPORARY TABLE "altered_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128), "salt" varchar(128), "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer, "openid_identifier" varchar(255), "anonymous" boolean) + SQL (0.2ms) PRAGMA index_list("users") + SQL (0.1ms) PRAGMA index_info('index_users_on_persistence_token') + SQL (0.1ms) PRAGMA index_info('index_users_on_openid_identifier') + SQL (0.1ms) PRAGMA index_list("altered_users") + SQL (0.3ms) CREATE INDEX "temp_index_altered_users_on_persistence_token" ON "altered_users" ("persistence_token") + SQL (0.1ms) PRAGMA index_list("altered_users") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_users_on_persistence_token') + SQL (0.3ms) CREATE INDEX "temp_index_altered_users_on_openid_identifier" ON "altered_users" ("openid_identifier") + SQL (0.8ms) DROP TABLE "users" + SQL (0.6ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128), "salt" varchar(128), "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer, "openid_identifier" varchar(255)) + SQL (0.2ms) PRAGMA index_list("altered_users") + SQL (0.2ms) PRAGMA index_info('temp_index_altered_users_on_openid_identifier') + SQL (0.4ms) PRAGMA index_info('temp_index_altered_users_on_persistence_token') + SQL (0.1ms) PRAGMA index_list("users") + SQL (0.4ms) CREATE INDEX "index_users_on_openid_identifier" ON "users" ("openid_identifier") + SQL (0.2ms) PRAGMA index_list("users") + SQL (0.1ms) PRAGMA index_info('index_users_on_openid_identifier') + SQL (0.6ms) CREATE INDEX "index_users_on_persistence_token" ON "users" ("persistence_token") + SQL (0.4ms) DROP TABLE "altered_users" + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101103212716') +Migrating to RenamedRmaCancelledState (20101111133551) + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + ReturnAuthorization Load (0.2ms) SELECT "return_authorizations".* FROM "return_authorizations" WHERE ("return_authorizations"."state" = 'cancelled') + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101111133551') +Migrating to FixProblematicIndexNames (20101117031806) + SQL (0.2ms) PRAGMA index_list("preferences") +Index name 'index_preferences_on_index_preferences_on_owner_and_attribute_and_preference' on table 'preferences' does not exist. Skipping. + SQL (0.2ms) PRAGMA index_list("preferences") + SQL (0.7ms) CREATE UNIQUE INDEX "ix_prefs_on_owner_attr_pref" ON "preferences" ("owner_id", "owner_type", "name", "group_id", "group_type") + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101117031806') + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" + SQL (2.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) PRAGMA index_list("addresses") + SQL (0.1ms) PRAGMA index_info('index_addresses_on_lastname') + SQL (0.1ms) PRAGMA index_info('index_addresses_on_firstname') + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.1ms) PRAGMA index_info('index_adjustments_on_order_id') + SQL (0.2ms) PRAGMA index_list("assets") + SQL (0.4ms) PRAGMA index_info('index_assets_on_viewable_type_and_type') + SQL (0.1ms) PRAGMA index_info('index_assets_on_viewable_id') + SQL (0.1ms) PRAGMA index_list("calculators") + SQL (0.2ms) PRAGMA index_list("configurations") + SQL (0.2ms) PRAGMA index_info('index_configurations_on_name_and_type') + SQL (0.3ms) PRAGMA index_list("countries") + SQL (0.3ms) PRAGMA index_list("coupons") + SQL (0.1ms) PRAGMA index_list("creditcards") + SQL (0.1ms) PRAGMA index_list("gateways") + SQL (0.2ms) PRAGMA index_list("inventory_units") + SQL (0.1ms) PRAGMA index_info('index_inventory_units_on_shipment_id') + SQL (0.1ms) PRAGMA index_info('index_inventory_units_on_order_id') + SQL (0.1ms) PRAGMA index_info('index_inventory_units_on_variant_id') + SQL (0.2ms) PRAGMA index_list("line_items") + SQL (0.1ms) PRAGMA index_info('index_line_items_on_variant_id') + SQL (0.1ms) PRAGMA index_info('index_line_items_on_order_id') + SQL (0.1ms) PRAGMA index_list("log_entries") + SQL (0.1ms) PRAGMA index_list("mail_methods") + SQL (0.1ms) PRAGMA index_list("option_types") + SQL (0.1ms) PRAGMA index_list("option_types_prototypes") + SQL (0.1ms) PRAGMA index_list("option_values") + SQL (0.2ms) PRAGMA index_list("option_values_variants") + SQL (0.1ms) PRAGMA index_info('index_option_values_variants_on_variant_id_and_option_value_id') + SQL (0.1ms) PRAGMA index_info('index_option_values_variants_on_variant_id') + SQL (0.1ms) PRAGMA index_list("orders") + SQL (0.1ms) PRAGMA index_info('index_orders_on_number') + SQL (0.1ms) PRAGMA index_list("payment_methods") + SQL (0.1ms) PRAGMA index_list("payments") + SQL (0.1ms) PRAGMA index_list("preferences") + SQL (0.2ms) PRAGMA index_info('ix_prefs_on_owner_attr_pref') + SQL (0.1ms) PRAGMA index_list("product_groups") + SQL (0.1ms) PRAGMA index_info('index_product_groups_on_permalink') + SQL (0.1ms) PRAGMA index_info('index_product_groups_on_name') + SQL (0.1ms) PRAGMA index_list("product_groups_products") + SQL (0.1ms) PRAGMA index_list("product_option_types") + SQL (0.2ms) PRAGMA index_list("product_properties") + SQL (0.2ms) PRAGMA index_info('index_product_properties_on_product_id') + SQL (0.2ms) PRAGMA index_list("product_scopes") + SQL (0.1ms) PRAGMA index_info('index_product_scopes_on_product_group_id') + SQL (0.1ms) PRAGMA index_info('index_product_scopes_on_name') + SQL (0.2ms) PRAGMA index_list("products") + SQL (0.1ms) PRAGMA index_info('index_products_on_permalink') + SQL (0.1ms) PRAGMA index_info('index_products_on_name') + SQL (0.1ms) PRAGMA index_info('index_products_on_deleted_at') + SQL (0.1ms) PRAGMA index_info('index_products_on_available_on') + SQL (0.2ms) PRAGMA index_list("products_taxons") + SQL (0.1ms) PRAGMA index_info('index_products_taxons_on_taxon_id') + SQL (0.1ms) PRAGMA index_info('index_products_taxons_on_product_id') + SQL (0.1ms) PRAGMA index_list("properties") + SQL (0.1ms) PRAGMA index_list("properties_prototypes") + SQL (0.1ms) PRAGMA index_list("prototypes") + SQL (0.1ms) PRAGMA index_list("question_categories") + SQL (0.1ms) PRAGMA index_list("questions") + SQL (0.1ms) PRAGMA index_list("return_authorizations") + SQL (0.1ms) PRAGMA index_list("roles") + SQL (0.2ms) PRAGMA index_list("roles_users") + SQL (0.1ms) PRAGMA index_info('index_roles_users_on_user_id') + SQL (0.1ms) PRAGMA index_info('index_roles_users_on_role_id') + SQL (0.1ms) PRAGMA index_list("shipments") + SQL (0.1ms) PRAGMA index_info('index_shipments_on_number') + SQL (0.1ms) PRAGMA index_list("shipping_categories") + SQL (0.1ms) PRAGMA index_list("shipping_methods") + SQL (0.1ms) PRAGMA index_list("state_events") + SQL (0.1ms) PRAGMA index_list("states") + SQL (0.2ms) PRAGMA index_list("tax_categories") + SQL (0.1ms) PRAGMA index_list("tax_rates") + SQL (0.1ms) PRAGMA index_list("taxonomies") + SQL (0.2ms) PRAGMA index_list("taxons") + SQL (0.1ms) PRAGMA index_info('index_taxons_on_taxonomy_id') + SQL (0.1ms) PRAGMA index_info('index_taxons_on_parent_id') + SQL (0.1ms) PRAGMA index_info('index_taxons_on_permalink') + SQL (0.1ms) PRAGMA index_list("trackers") + SQL (0.2ms) PRAGMA index_list("users") + SQL (0.1ms) PRAGMA index_info('index_users_on_persistence_token') + SQL (0.1ms) PRAGMA index_info('index_users_on_openid_identifier') + SQL (0.1ms) PRAGMA index_list("variants") + SQL (0.1ms) PRAGMA index_info('index_variants_on_product_id') + SQL (0.1ms) PRAGMA index_list("zone_members") + SQL (0.1ms) PRAGMA index_list("zones") + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" diff --git a/spec/test_app/log/development.log b/spec/test_app/log/development.log new file mode 100644 index 0000000..94b81b0 --- /dev/null +++ b/spec/test_app/log/development.log @@ -0,0 +1,35 @@ + SQL (0.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' diff --git a/app/views/faqs/show.rjs b/spec/test_app/log/production.log similarity index 100% rename from app/views/faqs/show.rjs rename to spec/test_app/log/production.log diff --git a/spec/test_app/log/server.log b/spec/test_app/log/server.log new file mode 100644 index 0000000..e69de29 diff --git a/spec/test_app/log/test.log b/spec/test_app/log/test.log new file mode 100644 index 0000000..1177342 --- /dev/null +++ b/spec/test_app/log/test.log @@ -0,0 +1,3675 @@ + SQL (0.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) select sqlite_version(*) + SQL (29.6ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)  + SQL (0.1ms) PRAGMA index_list("schema_migrations") + SQL (24.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version") + SQL (0.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" +Migrating to CreateQuestions (20090526213535) + SQL (0.7ms) CREATE TABLE "questions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "question_category_id" integer, "question" text, "answer" text, "position" integer, "created_at" datetime, "updated_at" datetime)  + SQL (0.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20090526213535') +Migrating to CreateQuestionCategories (20090526213550) + SQL (0.7ms) CREATE TABLE "question_categories" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime) + SQL (0.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20090526213550') +Migrating to SpreeZeroNineZero (20090823005402) + SQL (0.7ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.9ms) CREATE TABLE "addresses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "firstname" varchar(255), "lastname" varchar(255), "address1" varchar(255), "address2" varchar(255), "city" varchar(255), "state_id" integer, "zipcode" varchar(255), "country_id" integer, "phone" varchar(255), "created_at" datetime, "updated_at" datetime, "state_name" varchar(255), "alternative_phone" varchar(255)) + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.5ms) CREATE TABLE "adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "type" varchar(255), "amount" decimal(8,2) DEFAULT 0.0 NOT NULL, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "adjustment_source_id" integer, "adjustment_source_type" varchar(255), "secondary_type" varchar(255)) + SQL (0.7ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.7ms) CREATE TABLE "assets" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "viewable_id" integer, "viewable_type" varchar(50), "attachment_content_type" varchar(255), "attachment_file_name" varchar(255), "attachment_size" integer, "position" integer, "type" varchar(75), "attachment_updated_at" datetime, "attachment_width" integer, "attachment_height" integer) + SQL (0.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) CREATE TABLE "calculators" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "calculable_id" integer NOT NULL, "calculable_type" varchar(255) NOT NULL, "created_at" datetime, "updated_at" datetime) + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.5ms) CREATE TABLE "checkouts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "email" varchar(255), "ip_address" varchar(255), "special_instructions" text, "bill_address_id" integer, "completed_at" datetime, "created_at" datetime, "updated_at" datetime) + SQL (0.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "configurations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "type" varchar(50)) + SQL (0.2ms) PRAGMA index_list("configurations") + SQL (0.5ms) CREATE INDEX "index_configurations_on_name_and_type" ON "configurations" ("name", "type") + SQL (0.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "countries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "iso_name" varchar(255), "iso" varchar(255), "name" varchar(255), "iso3" varchar(255), "numcode" integer) + SQL (0.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.6ms) CREATE TABLE "coupons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar(255), "description" varchar(255), "usage_limit" integer, "combine" boolean, "expires_at" datetime, "created_at" datetime, "updated_at" datetime, "starts_at" datetime) + SQL (0.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) CREATE TABLE "creditcard_txns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "creditcard_payment_id" integer, "amount" decimal(8,2) DEFAULT 0.0 NOT NULL, "txn_type" integer, "response_code" varchar(255), "avs_response" text, "cvv_response" text, "created_at" datetime, "updated_at" datetime) + SQL (1.7ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.5ms) CREATE TABLE "creditcards" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "number" text, "month" varchar(255), "year" varchar(255), "verification_value" text, "cc_type" varchar(255), "display_number" varchar(255), "first_name" varchar(255), "last_name" varchar(255), "created_at" datetime, "updated_at" datetime, "start_month" varchar(255), "start_year" varchar(255), "issue_number" varchar(255), "address_id" integer, "checkout_id" integer) + SQL (0.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.5ms) CREATE TABLE "gateway_configurations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "gateway_id" integer, "created_at" datetime, "updated_at" datetime) + SQL (0.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "gateway_option_values" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "gateway_configuration_id" integer, "gateway_option_id" integer, "value" text, "created_at" datetime, "updated_at" datetime) + SQL (0.9ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.5ms) CREATE TABLE "gateway_options" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "description" text, "gateway_id" integer, "textarea" boolean DEFAULT 'f', "created_at" datetime, "updated_at" datetime) + SQL (1.8ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.5ms) CREATE TABLE "gateways" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "clazz" varchar(255), "name" varchar(255), "description" text, "active" boolean, "created_at" datetime, "updated_at" datetime) + SQL (0.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "inventory_units" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "variant_id" integer, "order_id" integer, "state" varchar(255), "lock_version" integer DEFAULT 0, "created_at" datetime, "updated_at" datetime) + SQL (0.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "line_items" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "variant_id" integer, "quantity" integer NOT NULL, "price" decimal(8,2) NOT NULL, "created_at" datetime, "updated_at" datetime) + SQL (0.1ms) PRAGMA index_list("line_items") + SQL (0.3ms) CREATE INDEX "index_line_items_on_order_id" ON "line_items" ("order_id") + SQL (0.3ms) PRAGMA index_list("line_items") + SQL (0.2ms) PRAGMA index_info('index_line_items_on_order_id') + SQL (0.8ms) CREATE INDEX "index_line_items_on_variant_id" ON "line_items" ("variant_id") + SQL (0.7ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "option_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(100), "presentation" varchar(100), "created_at" datetime, "updated_at" datetime)  + SQL (2.7ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "option_types_prototypes" ("prototype_id" integer, "option_type_id" integer)  + SQL (0.7ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) CREATE TABLE "option_values" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "option_type_id" integer, "name" varchar(255), "position" integer, "presentation" varchar(255), "created_at" datetime, "updated_at" datetime)  + SQL (0.6ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) CREATE TABLE "option_values_variants" ("variant_id" integer, "option_value_id" integer)  + SQL (0.1ms) PRAGMA index_list("option_values_variants") + SQL (0.3ms) CREATE INDEX "index_option_values_variants_on_variant_id" ON "option_values_variants" ("variant_id") + SQL (0.6ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "number" varchar(15), "item_total" decimal(8,2) DEFAULT 0.0 NOT NULL, "total" decimal(8,2) DEFAULT 0.0 NOT NULL, "created_at" datetime, "updated_at" datetime, "state" varchar(255), "token" varchar(255), "adjustment_total" decimal(8,2) DEFAULT 0.0 NOT NULL, "credit_total" decimal(8,2) DEFAULT 0.0 NOT NULL)  + SQL (0.1ms) PRAGMA index_list("orders") + SQL (0.3ms) CREATE INDEX "index_orders_on_number" ON "orders" ("number") + SQL (0.7ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) CREATE TABLE "payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal(8,2) DEFAULT 0.0 NOT NULL, "creditcard_id" integer, "type" varchar(255))  + SQL (0.7ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) CREATE TABLE "preferences" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "attribute" varchar(100) NOT NULL, "owner_id" integer(30) NOT NULL, "owner_type" varchar(50) NOT NULL, "group_id" integer, "group_type" varchar(50), "value" varchar(255), "created_at" datetime, "updated_at" datetime)  + SQL (0.1ms) PRAGMA index_list("preferences") + SQL (0.6ms) CREATE UNIQUE INDEX "index_preferences_on_owner_and_attribute_and_preference" ON "preferences" ("owner_id", "owner_type", "attribute", "group_id", "group_type") + SQL (1.0ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "product_option_types" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "product_id" integer, "option_type_id" integer, "position" integer, "created_at" datetime, "updated_at" datetime)  + SQL (0.8ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) CREATE TABLE "product_properties" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "product_id" integer, "property_id" integer, "value" varchar(255), "created_at" datetime, "updated_at" datetime)  + SQL (0.8ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT '' NOT NULL, "description" text, "created_at" datetime, "updated_at" datetime, "permalink" varchar(255), "available_on" datetime, "tax_category_id" integer, "shipping_category_id" integer, "deleted_at" datetime, "meta_description" varchar(255), "meta_keywords" varchar(255))  + SQL (0.1ms) PRAGMA index_list("products") + SQL (0.4ms) CREATE INDEX "index_products_on_available_on" ON "products" ("available_on") + SQL (0.2ms) PRAGMA index_list("products") + SQL (0.3ms) PRAGMA index_info('index_products_on_available_on') + SQL (0.5ms) CREATE INDEX "index_products_on_deleted_at" ON "products" ("deleted_at") + SQL (0.2ms) PRAGMA index_list("products") + SQL (0.2ms) PRAGMA index_info('index_products_on_deleted_at') + SQL (0.1ms) PRAGMA index_info('index_products_on_available_on') + SQL (0.6ms) CREATE INDEX "index_products_on_name" ON "products" ("name") + SQL (0.3ms) PRAGMA index_list("products") + SQL (0.2ms) PRAGMA index_info('index_products_on_name') + SQL (0.1ms) PRAGMA index_info('index_products_on_deleted_at') + SQL (0.2ms) PRAGMA index_info('index_products_on_available_on') + SQL (0.4ms) CREATE INDEX "index_products_on_permalink" ON "products" ("permalink") + SQL (0.8ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) CREATE TABLE "products_taxons" ("product_id" integer, "taxon_id" integer)  + SQL (0.1ms) PRAGMA index_list("products_taxons") + SQL (0.3ms) CREATE INDEX "index_products_taxons_on_product_id" ON "products_taxons" ("product_id") + SQL (0.2ms) PRAGMA index_list("products_taxons") + SQL (0.2ms) PRAGMA index_info('index_products_taxons_on_product_id') + SQL (0.4ms) CREATE INDEX "index_products_taxons_on_taxon_id" ON "products_taxons" ("taxon_id") + SQL (0.8ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "properties" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "presentation" varchar(255) NOT NULL, "created_at" datetime, "updated_at" datetime) + SQL (0.8ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "properties_prototypes" ("prototype_id" integer, "property_id" integer) + SQL (0.9ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.5ms) CREATE TABLE "prototypes" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime) + SQL (1.0ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.5ms) CREATE TABLE "roles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255)) + SQL (1.0ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.5ms) CREATE TABLE "roles_users" ("role_id" integer, "user_id" integer) + SQL (0.2ms) PRAGMA index_list("roles_users") + SQL (0.4ms) CREATE INDEX "index_roles_users_on_role_id" ON "roles_users" ("role_id") + SQL (0.2ms) PRAGMA index_list("roles_users") + SQL (0.2ms) PRAGMA index_info('index_roles_users_on_role_id') + SQL (0.4ms) CREATE INDEX "index_roles_users_on_user_id" ON "roles_users" ("user_id") + SQL (0.9ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "shipments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "shipping_method_id" integer, "tracking" varchar(255), "created_at" datetime, "updated_at" datetime, "number" varchar(255), "cost" decimal(8,2), "shipped_at" datetime, "address_id" integer)  + SQL (1.0ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "shipping_categories" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime)  + SQL (1.0ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "shipping_methods" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "zone_id" integer, "name" varchar(255), "created_at" datetime, "updated_at" datetime)  + SQL (1.0ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "state_events" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "user_id" integer, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "previous_state" varchar(255))  + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) CREATE TABLE "states" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "abbr" varchar(255), "country_id" integer)  + SQL (0.9ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "tax_categories" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "description" varchar(255), "created_at" datetime, "updated_at" datetime)  + SQL (2.0ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) CREATE TABLE "tax_rates" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "zone_id" integer, "amount" decimal(8,4), "created_at" datetime, "updated_at" datetime, "tax_category_id" integer)  + SQL (1.0ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) CREATE TABLE "taxonomies" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) NOT NULL, "created_at" datetime, "updated_at" datetime)  + SQL (1.0ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.8ms) CREATE TABLE "taxons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "taxonomy_id" integer NOT NULL, "parent_id" integer, "position" integer DEFAULT 0, "name" varchar(255) NOT NULL, "created_at" datetime, "updated_at" datetime, "permalink" varchar(255))  + SQL (1.1ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.6ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128) DEFAULT '' NOT NULL, "salt" varchar(128) DEFAULT '' NOT NULL, "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer)  + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "variants" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "product_id" integer, "sku" varchar(255) DEFAULT '' NOT NULL, "price" decimal(8,2) NOT NULL, "weight" decimal(8,2), "height" decimal(8,2), "width" decimal(8,2), "depth" decimal(8,2), "deleted_at" datetime, "is_master" boolean DEFAULT 'f')  + SQL (0.1ms) PRAGMA index_list("variants") + SQL (0.4ms) CREATE INDEX "index_variants_on_product_id" ON "variants" ("product_id") + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) CREATE TABLE "zone_members" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "zone_id" integer, "zoneable_id" integer, "zoneable_type" varchar(255), "created_at" datetime, "updated_at" datetime)  + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.5ms) CREATE TABLE "zones" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "description" varchar(255), "created_at" datetime, "updated_at" datetime)  + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20090823005402') +Migrating to CreateIndexesForInventoryUnits (20090904192342) + SQL (0.1ms) PRAGMA index_list("inventory_units") + SQL (0.6ms) CREATE INDEX "index_inventory_units_on_variant_id" ON "inventory_units" ("variant_id") + SQL (0.2ms) PRAGMA index_list("inventory_units") + SQL (0.2ms) PRAGMA index_info('index_inventory_units_on_variant_id') + SQL (0.4ms) CREATE INDEX "index_inventory_units_on_order_id" ON "inventory_units" ("order_id") + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20090904192342') +Migrating to AddCountOnHandToVariantsAndProducts (20090923100315) + SQL (0.9ms) ALTER TABLE "variants" ADD "count_on_hand" integer DEFAULT 0 NOT NULL + SQL (0.6ms) ALTER TABLE "products" ADD "count_on_hand" integer DEFAULT 0 NOT NULL + SQL (1.1ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.1ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + Variant Load (0.2ms) SELECT "variants".* FROM "variants" + Product Load (0.2ms) SELECT "products".* FROM "products" + SQL (1.1ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20090923100315') +Migrating to ChangeTaxonsToNestedSet (20091007134354) + SQL (0.8ms) ALTER TABLE "taxons" ADD "lft" integer + SQL (0.5ms) ALTER TABLE "taxons" ADD "rgt" integer + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + Property Load (0.2ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.1ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + Taxon Load (0.3ms) SELECT "taxons".* FROM "taxons" WHERE (parent_id IS NULL) ORDER BY position ASC + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091007134354') +Migrating to MoveToConfigurableGateways (20091008091614) + SQL (0.5ms) DROP TABLE "gateways" + SQL (0.7ms) DROP TABLE "gateway_options" + SQL (0.5ms) DROP TABLE "gateway_option_values" + SQL (0.5ms) DROP TABLE "gateway_configurations" + SQL (1.1ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.6ms) CREATE TABLE "gateways" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "name" varchar(255), "description" text, "active" boolean DEFAULT 't', "environment" varchar(255) DEFAULT 'development', "server" varchar(255) DEFAULT 'test', "test_mode" boolean DEFAULT 't', "created_at" datetime, "updated_at" datetime) + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091008091614') +Migrating to ProductGroupsAndScopes (20091012120519) + SQL (0.8ms) CREATE TABLE "product_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "permalink" varchar(255), "order" varchar(255))  + SQL (0.4ms) CREATE TABLE "product_scopes" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "product_group_id" integer, "name" varchar(255), "arguments" text) + SQL (0.1ms) PRAGMA index_list("product_groups") + SQL (0.4ms) CREATE INDEX "index_product_groups_on_name" ON "product_groups" ("name") + SQL (0.2ms) PRAGMA index_list("product_groups") + SQL (0.6ms) PRAGMA index_info('index_product_groups_on_name') + SQL (0.4ms) CREATE INDEX "index_product_groups_on_permalink" ON "product_groups" ("permalink") + SQL (0.1ms) PRAGMA index_list("product_scopes") + SQL (0.4ms) CREATE INDEX "index_product_scopes_on_name" ON "product_scopes" ("name") + SQL (0.2ms) PRAGMA index_list("product_scopes") + SQL (0.2ms) PRAGMA index_info('index_product_scopes_on_name') + SQL (0.4ms) CREATE INDEX "index_product_scopes_on_product_group_id" ON "product_scopes" ("product_group_id") + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091012120519') +Migrating to AddOpenIdAuthenticationTables (20091015110842) + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.7ms) CREATE TABLE "open_id_authentication_associations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "issued" integer, "lifetime" integer, "handle" varchar(255), "assoc_type" varchar(255), "server_url" blob, "secret" blob) + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) CREATE TABLE "open_id_authentication_nonces" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "timestamp" integer NOT NULL, "server_url" varchar(255), "salt" varchar(255) NOT NULL) + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091015110842') +Migrating to AddOpenidFieldToUsers (20091015153048) + SQL (1.0ms) ALTER TABLE "users" ADD "openid_identifier" varchar(255) + SQL (0.1ms) PRAGMA index_list("users") + SQL (0.5ms) CREATE INDEX "index_users_on_openid_identifier" ON "users" ("openid_identifier") + SQL (2.0ms) CREATE TEMPORARY TABLE "altered_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128) DEFAULT '' NOT NULL, "salt" varchar(128) DEFAULT '' NOT NULL, "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer, "openid_identifier" varchar(255)) + SQL (0.2ms) PRAGMA index_list("users") + SQL (0.1ms) PRAGMA index_info('index_users_on_openid_identifier') + SQL (0.1ms) PRAGMA index_list("altered_users") + SQL (0.3ms) CREATE INDEX "temp_index_altered_users_on_openid_identifier" ON "altered_users" ("openid_identifier") + SQL (0.7ms) DROP TABLE "users" + SQL (1.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128) DEFAULT '' NOT NULL, "salt" varchar(128) DEFAULT '' NOT NULL, "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer, "openid_identifier" varchar(255)) + SQL (0.2ms) PRAGMA index_list("altered_users") + SQL (0.2ms) PRAGMA index_info('temp_index_altered_users_on_openid_identifier') + SQL (0.1ms) PRAGMA index_list("users") + SQL (0.7ms) CREATE INDEX "index_users_on_openid_identifier" ON "users" ("openid_identifier") + SQL (1.5ms) DROP TABLE "altered_users" + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128) DEFAULT '' NOT NULL, "salt" varchar(128) DEFAULT '' NOT NULL, "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer, "openid_identifier" varchar(255)) + SQL (0.2ms) PRAGMA index_list("users") + SQL (0.1ms) PRAGMA index_info('index_users_on_openid_identifier') + SQL (0.1ms) PRAGMA index_list("altered_users") + SQL (0.3ms) CREATE INDEX "temp_index_altered_users_on_openid_identifier" ON "altered_users" ("openid_identifier") + SQL (0.5ms) DROP TABLE "users" + SQL (0.6ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128), "salt" varchar(128) DEFAULT '' NOT NULL, "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer, "openid_identifier" varchar(255)) + SQL (0.2ms) PRAGMA index_list("altered_users") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_users_on_openid_identifier') + SQL (0.1ms) PRAGMA index_list("users") + SQL (0.3ms) CREATE INDEX "index_users_on_openid_identifier" ON "users" ("openid_identifier") + SQL (0.3ms) DROP TABLE "altered_users" + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128), "salt" varchar(128) DEFAULT '' NOT NULL, "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer, "openid_identifier" varchar(255)) + SQL (0.2ms) PRAGMA index_list("users") + SQL (0.1ms) PRAGMA index_info('index_users_on_openid_identifier') + SQL (0.1ms) PRAGMA index_list("altered_users") + SQL (0.3ms) CREATE INDEX "temp_index_altered_users_on_openid_identifier" ON "altered_users" ("openid_identifier") + SQL (0.4ms) DROP TABLE "users" + SQL (0.6ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128), "salt" varchar(128), "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer, "openid_identifier" varchar(255)) + SQL (0.2ms) PRAGMA index_list("altered_users") + SQL (0.2ms) PRAGMA index_info('temp_index_altered_users_on_openid_identifier') + SQL (0.2ms) PRAGMA index_list("users") + SQL (0.4ms) CREATE INDEX "index_users_on_openid_identifier" ON "users" ("openid_identifier") + SQL (0.3ms) DROP TABLE "altered_users" + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091015153048') +Migrating to ChangePreferenceValueType (20091016174634) + SQL (0.2ms) PRAGMA index_list("preferences") + SQL (0.2ms) PRAGMA index_info('index_preferences_on_owner_and_attribute_and_preference') + SQL (0.5ms) DROP INDEX "index_preferences_on_owner_and_attribute_and_preference" + SQL (0.7ms) CREATE TEMPORARY TABLE "altered_preferences" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "attribute" varchar(100) NOT NULL, "owner_id" integer(30) NOT NULL, "owner_type" varchar(50) NOT NULL, "group_id" integer, "group_type" varchar(50), "value" varchar(255), "created_at" datetime, "updated_at" datetime)  + SQL (0.1ms) PRAGMA index_list("preferences") + SQL (0.6ms) DROP TABLE "preferences" + SQL (0.6ms) CREATE TABLE "preferences" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "attribute" varchar(100) NOT NULL, "owner_id" integer(30) NOT NULL, "owner_type" varchar(50) NOT NULL, "group_id" integer, "group_type" varchar(50), "value" text(255), "created_at" datetime, "updated_at" datetime) + SQL (0.1ms) PRAGMA index_list("altered_preferences") + SQL (0.4ms) DROP TABLE "altered_preferences" + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091016174634') +Migrating to CreateBillingIntegrations (20091017175558) + SQL (1.0ms) CREATE TABLE "billing_integrations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "name" varchar(255), "description" text, "active" boolean DEFAULT 't', "environment" varchar(255) DEFAULT 'development', "created_at" datetime, "updated_at" datetime)  + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091017175558') +Migrating to ChargeRefactoring (20091021133257) + SQL (2.0ms) ALTER TABLE "orders" ADD "completed_at" datetime + ChargeRefactoring::Order Load (0.3ms) SELECT "orders".* FROM "orders" + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_checkouts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "email" varchar(255), "ip_address" varchar(255), "special_instructions" text, "bill_address_id" integer, "completed_at" datetime, "created_at" datetime, "updated_at" datetime) + SQL (0.1ms) PRAGMA index_list("checkouts") + SQL (0.5ms) DROP TABLE "checkouts" + SQL (0.6ms) CREATE TABLE "checkouts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "email" varchar(255), "ip_address" varchar(255), "special_instructions" text, "bill_address_id" integer, "created_at" datetime, "updated_at" datetime)  + SQL (0.1ms) PRAGMA index_list("altered_checkouts") + SQL (0.3ms) DROP TABLE "altered_checkouts" + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "type" varchar(255), "amount" decimal DEFAULT 0.0 NOT NULL, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "adjustment_source_id" integer, "adjustment_source_type" varchar(255), "secondary_type" varchar(255)) + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.4ms) DROP TABLE "adjustments" + SQL (0.6ms) CREATE TABLE "adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "type" varchar(255), "amount" decimal, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "adjustment_source_id" integer, "adjustment_source_type" varchar(255), "secondary_type" varchar(255))  + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (1.6ms) DROP TABLE "altered_adjustments" + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) UPDATE "adjustments" SET type = secondary_type  + SQL (0.2ms) UPDATE "adjustments" SET type = 'CouponCredit' WHERE (type = 'Credit') + SQL (0.4ms) CREATE TEMPORARY TABLE "altered_adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "type" varchar(255), "amount" decimal, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "adjustment_source_id" integer, "adjustment_source_type" varchar(255), "secondary_type" varchar(255))  + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.5ms) DROP TABLE "adjustments" + SQL (0.4ms) CREATE TABLE "adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "type" varchar(255), "amount" decimal, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "adjustment_source_id" integer, "adjustment_source_type" varchar(255)) + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.3ms) DROP TABLE "altered_adjustments" + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091021133257') +Migrating to AddSomeIndexes (20091104151730) + SQL (0.1ms) PRAGMA index_list("taxons") + SQL (0.6ms) CREATE INDEX "index_taxons_on_permalink" ON "taxons" ("permalink") + SQL (0.2ms) PRAGMA index_list("taxons") + SQL (0.1ms) PRAGMA index_info('index_taxons_on_permalink') + SQL (0.4ms) CREATE INDEX "index_taxons_on_parent_id" ON "taxons" ("parent_id") + SQL (0.2ms) PRAGMA index_list("taxons") + SQL (0.2ms) PRAGMA index_info('index_taxons_on_parent_id') + SQL (0.2ms) PRAGMA index_info('index_taxons_on_permalink') + SQL (0.4ms) CREATE INDEX "index_taxons_on_taxonomy_id" ON "taxons" ("taxonomy_id") + SQL (0.1ms) PRAGMA index_list("assets") + SQL (4.9ms) CREATE INDEX "index_assets_on_viewable_id" ON "assets" ("viewable_id") + SQL (0.2ms) PRAGMA index_list("assets") + SQL (0.2ms) PRAGMA index_info('index_assets_on_viewable_id') + SQL (0.4ms) CREATE INDEX "index_assets_on_viewable_type_and_type" ON "assets" ("viewable_type", "type") + SQL (0.1ms) PRAGMA index_list("product_properties") + SQL (0.5ms) CREATE INDEX "index_product_properties_on_product_id" ON "product_properties" ("product_id") + SQL (0.2ms) PRAGMA index_list("option_values_variants") + SQL (0.2ms) PRAGMA index_info('index_option_values_variants_on_variant_id') + SQL (0.4ms) CREATE INDEX "index_option_values_variants_on_variant_id_and_option_value_id" ON "option_values_variants" ("variant_id", "option_value_id") + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091104151730') +Migrating to CheckoutStateMachine (20091126190904) + SQL (1.0ms) ALTER TABLE "checkouts" ADD "state" varchar(255) + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091126190904') +Migrating to StateForShipments (20091209153045) + SQL (1.0ms) ALTER TABLE "shipments" ADD "state" varchar(255) + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091209153045') +Migrating to MakeStateEventsPolymorphic (20091209202200) + SQL (0.4ms) CREATE TEMPORARY TABLE "altered_state_events" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stateful_id" integer, "user_id" integer, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "previous_state" varchar(255)) + SQL (0.7ms) PRAGMA index_list("state_events") + SQL (0.6ms) DROP TABLE "state_events" + SQL (0.6ms) CREATE TABLE "state_events" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stateful_id" integer, "user_id" integer, "name" varchar(255), "created_at" datetime, "updated_at" datetime, "previous_state" varchar(255))  + SQL (0.1ms) PRAGMA index_list("altered_state_events") + SQL (0.3ms) DROP TABLE "altered_state_events" + SQL (0.5ms) ALTER TABLE "state_events" ADD "stateful_type" varchar(255) + SQL (0.2ms) UPDATE "state_events" SET "stateful_type" = 'Order'  + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091209202200') +Migrating to ShipAddressIdForCheckouts (20091211203813) + SQL (0.8ms) ALTER TABLE "checkouts" ADD "ship_address_id" integer + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091211203813') +Migrating to ShippingMethodIdForCheckouts (20091212161118) + SQL (1.0ms) ALTER TABLE "checkouts" ADD "shipping_method_id" integer + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091212161118') +Migrating to CreditcardLastFourDigits (20091213222815) + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_creditcards" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "number" text, "month" varchar(255), "year" varchar(255), "verification_value" text, "cc_type" varchar(255), "last_digits" varchar(255), "first_name" varchar(255), "last_name" varchar(255), "created_at" datetime, "updated_at" datetime, "start_month" varchar(255), "start_year" varchar(255), "issue_number" varchar(255), "address_id" integer, "checkout_id" integer) + SQL (0.1ms) PRAGMA index_list("creditcards") + SQL (0.5ms) DROP TABLE "creditcards" + SQL (0.6ms) CREATE TABLE "creditcards" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "number" text, "month" varchar(255), "year" varchar(255), "verification_value" text, "cc_type" varchar(255), "last_digits" varchar(255), "first_name" varchar(255), "last_name" varchar(255), "created_at" datetime, "updated_at" datetime, "start_month" varchar(255), "start_year" varchar(255), "issue_number" varchar(255), "address_id" integer, "checkout_id" integer)  + SQL (0.1ms) PRAGMA index_list("altered_creditcards") + SQL (0.2ms) DROP TABLE "altered_creditcards" + CreditcardLastFourDigits::Creditcard Load (0.3ms) SELECT "creditcards".* FROM "creditcards" + SQL (2.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091213222815') +Migrating to PopulateLegacyShipmentState (20091214183826) + PopulateLegacyShipmentState::Shipment Load (0.4ms) SELECT "shipments".* FROM "shipments" + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20091214183826') +Migrating to AddCostPrice (20100105090147) + SQL (1.0ms) ALTER TABLE "variants" ADD "cost_price" decimal(8,2) DEFAULT NULL + SQL (3.0ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100105090147') +Migrating to ShipmentIdForInventoryUnits (20100105132138) + SQL (0.9ms) ALTER TABLE "inventory_units" ADD "shipment_id" integer + SQL (0.2ms) PRAGMA index_list("inventory_units") + SQL (0.1ms) PRAGMA index_info('index_inventory_units_on_order_id') + SQL (0.1ms) PRAGMA index_info('index_inventory_units_on_variant_id') + SQL (0.6ms) CREATE INDEX "index_inventory_units_on_shipment_id" ON "inventory_units" ("shipment_id") + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Shipment Load (0.3ms) SELECT "shipments".* FROM "shipments" + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100105132138') +Migrating to CimFieldsForCreditcards (20100111205525) + SQL (1.0ms) ALTER TABLE "creditcards" ADD "gateway_customer_profile_id" varchar(255) + SQL (1.3ms) ALTER TABLE "creditcards" ADD "gateway_payment_profile_id" varchar(255) + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100111205525') +Migrating to CreateReturnAuthorizations (20100112151511) + SQL (1.9ms) CREATE TABLE "return_authorizations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "number" varchar(255), "amount" decimal(8,2) DEFAULT 0.0 NOT NULL, "order_id" integer, "reason" text, "state" varchar(255), "created_at" datetime, "updated_at" datetime) + SQL (1.7ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100112151511') +Migrating to AddReturnAuthorizationToInventoryUnits (20100113090919) + SQL (0.9ms) ALTER TABLE "inventory_units" ADD "return_authorization_id" integer + SQL (2.6ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100113090919') +Migrating to CreateTrackers (20100113203104) + SQL (1.3ms) CREATE TABLE "trackers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "environment" varchar(255), "analytics_id" varchar(255), "active" boolean DEFAULT 't', "created_at" datetime, "updated_at" datetime) + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100113203104') +Migrating to CreditcardIdForCreditcardTxns (20100121160010) + SQL (0.9ms) ALTER TABLE "creditcard_txns" ADD "creditcard_id" integer + SQL (1.6ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100121160010') +Migrating to OriginalCreditcardTxnIdForCreditcardTxns (20100121183934) + SQL (1.0ms) ALTER TABLE "creditcard_txns" ADD "original_creditcard_txn_id" integer + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100121183934') +Migrating to AddTestModeToBillingIntegration (20100125145351) + SQL (1.2ms) ALTER TABLE "billing_integrations" ADD "test_mode" boolean DEFAULT 't' + SQL (0.9ms) ALTER TABLE "billing_integrations" ADD "server" varchar(255) DEFAULT 'test' + SQL (1.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100125145351') +Migrating to CreateProductsProductGroups (20100126103714) + SQL (0.7ms) CREATE TABLE "product_groups_products" ("product_id" integer, "product_group_id" integer)  + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100126103714') +Migrating to CreatePaymentMethods (20100209025806) + SQL (0.8ms) CREATE TABLE "payment_methods" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "name" varchar(255), "description" text, "active" boolean DEFAULT 't', "environment" varchar(255) DEFAULT 'development', "created_at" datetime, "updated_at" datetime) + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100209025806') +Migrating to PolymorphicPayments (20100209144531) + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL, "creditcard_id" integer, "type" varchar(255))  + SQL (0.1ms) PRAGMA index_list("payments") + SQL (0.5ms) DROP TABLE "payments" + SQL (0.6ms) CREATE TABLE "payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL, "creditcard_id" integer) + SQL (0.1ms) PRAGMA index_list("altered_payments") + SQL (0.3ms) DROP TABLE "altered_payments" + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL, "creditcard_id" integer)  + SQL (0.1ms) PRAGMA index_list("payments") + SQL (0.6ms) DROP TABLE "payments" + SQL (0.4ms) CREATE TABLE "payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL) + SQL (0.1ms) PRAGMA index_list("altered_payments") + SQL (0.4ms) DROP TABLE "altered_payments" + SQL (0.4ms) CREATE TEMPORARY TABLE "altered_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payable_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL)  + SQL (0.1ms) PRAGMA index_list("payments") + SQL (0.4ms) DROP TABLE "payments" + SQL (0.5ms) CREATE TABLE "payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payable_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL) + SQL (0.1ms) PRAGMA index_list("altered_payments") + SQL (0.3ms) DROP TABLE "altered_payments" + SQL (0.7ms) ALTER TABLE "payments" ADD "payable_type" varchar(255) + SQL (0.7ms) ALTER TABLE "payments" ADD "payment_method" varchar(255) + SQL (0.6ms) ALTER TABLE "payments" ADD "source_id" integer + SQL (0.5ms) ALTER TABLE "payments" ADD "source_type" varchar(255) + SQL (0.1ms) UPDATE payments SET payable_type = 'Order' + Creditcard Load (0.3ms) SELECT "creditcards".* FROM "creditcards" + SQL (0.4ms) CREATE TEMPORARY TABLE "altered_creditcards" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "number" text, "month" varchar(255), "year" varchar(255), "verification_value" text, "cc_type" varchar(255), "last_digits" varchar(255), "first_name" varchar(255), "last_name" varchar(255), "created_at" datetime, "updated_at" datetime, "start_month" varchar(255), "start_year" varchar(255), "issue_number" varchar(255), "address_id" integer, "checkout_id" integer, "gateway_customer_profile_id" varchar(255), "gateway_payment_profile_id" varchar(255))  + SQL (0.1ms) PRAGMA index_list("creditcards") + SQL (0.5ms) DROP TABLE "creditcards" + SQL (0.7ms) CREATE TABLE "creditcards" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "number" text, "month" varchar(255), "year" varchar(255), "verification_value" text, "cc_type" varchar(255), "last_digits" varchar(255), "first_name" varchar(255), "last_name" varchar(255), "created_at" datetime, "updated_at" datetime, "start_month" varchar(255), "start_year" varchar(255), "issue_number" varchar(255), "address_id" integer, "gateway_customer_profile_id" varchar(255), "gateway_payment_profile_id" varchar(255)) + SQL (0.1ms) PRAGMA index_list("altered_creditcards") + SQL (0.3ms) DROP TABLE "altered_creditcards" + SQL (1.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100209144531') +Migrating to ChangePaymentsPaymentMethodToBelongsTo (20100213103131) + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payable_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL, "payable_type" varchar(255), "payment_method" varchar(255), "source_id" integer, "source_type" varchar(255))  + SQL (0.1ms) PRAGMA index_list("payments") + SQL (0.6ms) DROP TABLE "payments" + SQL (0.5ms) CREATE TABLE "payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "payable_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL, "payable_type" varchar(255), "source_id" integer, "source_type" varchar(255)) + SQL (0.1ms) PRAGMA index_list("altered_payments") + SQL (0.3ms) DROP TABLE "altered_payments" + SQL (0.6ms) ALTER TABLE "payments" ADD "payment_method_id" integer + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100213103131') +Migrating to AssignCreditcardTxnsToPayment (20100214212536) + SQL (0.8ms) ALTER TABLE "creditcard_txns" ADD "payment_id" integer + SQL (0.2ms) SELECT * FROM creditcard_txns + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_creditcard_txns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "creditcard_payment_id" integer, "amount" decimal DEFAULT 0.0 NOT NULL, "txn_type" integer, "response_code" varchar(255), "avs_response" text, "cvv_response" text, "created_at" datetime, "updated_at" datetime, "creditcard_id" integer, "original_creditcard_txn_id" integer, "payment_id" integer) + SQL (0.1ms) PRAGMA index_list("creditcard_txns") + SQL (0.7ms) DROP TABLE "creditcard_txns" + SQL (1.6ms) CREATE TABLE "creditcard_txns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "amount" decimal DEFAULT 0.0 NOT NULL, "txn_type" integer, "response_code" varchar(255), "avs_response" text, "cvv_response" text, "created_at" datetime, "updated_at" datetime, "creditcard_id" integer, "original_creditcard_txn_id" integer, "payment_id" integer)  + SQL (0.1ms) PRAGMA index_list("altered_creditcard_txns") + SQL (0.3ms) DROP TABLE "altered_creditcard_txns" + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100214212536') +Migrating to StiForTransactions (20100223170312) + SQL (0.9ms) ALTER TABLE "creditcard_txns" RENAME TO "transactions" + SQL (0.6ms) ALTER TABLE "transactions" ADD "type" varchar(255) + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_transactions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "amount" decimal DEFAULT 0.0 NOT NULL, "txn_type" integer, "response_code" varchar(255), "avs_response" text, "cvv_response" text, "created_at" datetime, "updated_at" datetime, "creditcard_id" integer, "original_creditcard_txn_id" integer, "payment_id" integer, "type" varchar(255)) + SQL (0.1ms) PRAGMA index_list("transactions") + SQL (0.6ms) DROP TABLE "transactions" + SQL (0.5ms) CREATE TABLE "transactions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "amount" decimal DEFAULT 0.0 NOT NULL, "txn_type" integer, "response_code" varchar(255), "avs_response" text, "cvv_response" text, "created_at" datetime, "updated_at" datetime, "original_creditcard_txn_id" integer, "payment_id" integer, "type" varchar(255))  + SQL (0.1ms) PRAGMA index_list("altered_transactions") + SQL (0.2ms) DROP TABLE "altered_transactions" + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100223170312') +Migrating to DropBillingIntegrations (20100223183812) + SQL (0.7ms) DROP TABLE "billing_integrations" + SQL (2.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100223183812') +Migrating to DeletedAtForPaymentMethods (20100224153127) + SQL (1.1ms) ALTER TABLE "payment_methods" ADD "deleted_at" datetime DEFAULT NULL + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100224153127') +Migrating to AddAdjustmentsIndex (20100301163454) + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.7ms) CREATE INDEX "index_adjustments_on_order_id" ON "adjustments" ("order_id") + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100301163454') +Migrating to FixByPopularity (20100306153445) + SQL (0.3ms) UPDATE "product_scopes" SET name='descend_by_popularity' WHERE (name='by_popularity') + SQL (3.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100306153445') +Migrating to AddAltTextToImages (20100317120946) + SQL (1.0ms) ALTER TABLE "assets" ADD "alt" text + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100317120946') +Migrating to AddDisplayToPaymentMethods (20100427121301) + SQL (1.1ms) ALTER TABLE "payment_methods" ADD "display" varchar(255) DEFAULT NULL + SQL (2.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100427121301') +Migrating to AddAddressesCheckoutsIndexes (20100504142133) + SQL (0.1ms) PRAGMA index_list("addresses") + SQL (0.8ms) CREATE INDEX "index_addresses_on_firstname" ON "addresses" ("firstname") + SQL (0.2ms) PRAGMA index_list("addresses") + SQL (0.2ms) PRAGMA index_info('index_addresses_on_firstname') + SQL (0.4ms) CREATE INDEX "index_addresses_on_lastname" ON "addresses" ("lastname") + SQL (0.1ms) PRAGMA index_list("checkouts") + SQL (1.5ms) CREATE INDEX "index_checkouts_on_order_id" ON "checkouts" ("order_id") + SQL (0.2ms) PRAGMA index_list("checkouts") + SQL (0.2ms) PRAGMA index_info('index_checkouts_on_order_id') + SQL (0.6ms) CREATE INDEX "index_checkouts_on_bill_address_id" ON "checkouts" ("bill_address_id") + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100504142133') +Migrating to AddIconToTaxons (20100506180619) + SQL (0.9ms) ALTER TABLE "taxons" ADD "icon_file_name" varchar(255) + SQL (0.6ms) ALTER TABLE "taxons" ADD "icon_content_type" varchar(255) + SQL (0.7ms) ALTER TABLE "taxons" ADD "icon_file_size" integer + SQL (0.7ms) ALTER TABLE "taxons" ADD "icon_updated_at" datetime + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100506180619') +Migrating to AddDescriptionToTaxons (20100506185838) + SQL (1.9ms) ALTER TABLE "taxons" ADD "description" text + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100506185838') +Migrating to IndexForShipmentsNumber (20100528155333) + SQL (0.1ms) PRAGMA index_list("shipments") + SQL (0.5ms) CREATE INDEX "index_shipments_on_number" ON "shipments" ("number") + SQL (2.1ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100528155333') +Migrating to AddIndexOnUsersPersistenceToken (20100528185820) + SQL (0.2ms) PRAGMA index_list("users") + SQL (0.1ms) PRAGMA index_info('index_users_on_openid_identifier') + SQL (0.8ms) CREATE INDEX "index_users_on_persistence_token" ON "users" ("persistence_token") + SQL (3.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100528185820') +Migrating to AddDefaultToTaxCategories (20100605152042) + SQL (0.9ms) ALTER TABLE "tax_categories" ADD "is_default" boolean DEFAULT 'f' + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100605152042') +Migrating to AddDisplayToShippingMethods (20100624110730) + SQL (0.9ms) ALTER TABLE "shipping_methods" ADD "display_on" varchar(255) DEFAULT NULL + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100624110730') +Migrating to RenamePaymentMethodDisplay (20100624123336) + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_payment_methods" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "name" varchar(255), "description" text, "active" boolean DEFAULT 't', "environment" varchar(255) DEFAULT 'development', "created_at" datetime, "updated_at" datetime, "deleted_at" datetime, "display_on" varchar(255))  + SQL (0.1ms) PRAGMA index_list("payment_methods") + SQL (0.5ms) DROP TABLE "payment_methods" + SQL (1.0ms) CREATE TABLE "payment_methods" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "name" varchar(255), "description" text, "active" boolean DEFAULT 't', "environment" varchar(255) DEFAULT 'development', "created_at" datetime, "updated_at" datetime, "deleted_at" datetime, "display_on" varchar(255)) + SQL (0.1ms) PRAGMA index_list("altered_payment_methods") + SQL (0.3ms) DROP TABLE "altered_payment_methods" + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100624123336') +Migrating to RenamePreferencesField (20100624175547) + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_preferences" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(100) NOT NULL, "owner_id" integer(30) NOT NULL, "owner_type" varchar(50) NOT NULL, "group_id" integer, "group_type" varchar(50), "value" text(255), "created_at" datetime, "updated_at" datetime)  + SQL (0.1ms) PRAGMA index_list("preferences") + SQL (0.6ms) DROP TABLE "preferences" + SQL (0.6ms) CREATE TABLE "preferences" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(100) NOT NULL, "owner_id" integer(30) NOT NULL, "owner_type" varchar(50) NOT NULL, "group_id" integer, "group_type" varchar(50), "value" text(255), "created_at" datetime, "updated_at" datetime) + SQL (0.1ms) PRAGMA index_list("altered_preferences") + SQL (0.3ms) DROP TABLE "altered_preferences" + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100624175547') +Migrating to AddGuestFlag (20100811163637) + SQL (0.9ms) ALTER TABLE "users" ADD "guest" boolean + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100811163637') +Migrating to DropOrderToken (20100811205836) + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "number" varchar(15), "item_total" decimal DEFAULT 0.0 NOT NULL, "total" decimal DEFAULT 0.0 NOT NULL, "created_at" datetime, "updated_at" datetime, "state" varchar(255), "token" varchar(255), "adjustment_total" decimal DEFAULT 0.0 NOT NULL, "credit_total" decimal DEFAULT 0.0 NOT NULL, "completed_at" datetime) + SQL (0.2ms) PRAGMA index_list("orders") + SQL (0.1ms) PRAGMA index_info('index_orders_on_number') + SQL (0.1ms) PRAGMA index_list("altered_orders") + SQL (0.3ms) CREATE INDEX "temp_index_altered_orders_on_number" ON "altered_orders" ("number") + SQL (0.7ms) DROP TABLE "orders" + SQL (0.6ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "number" varchar(15), "item_total" decimal DEFAULT 0.0 NOT NULL, "total" decimal DEFAULT 0.0 NOT NULL, "created_at" datetime, "updated_at" datetime, "state" varchar(255), "adjustment_total" decimal DEFAULT 0.0 NOT NULL, "credit_total" decimal DEFAULT 0.0 NOT NULL, "completed_at" datetime) + SQL (0.2ms) PRAGMA index_list("altered_orders") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_orders_on_number') + SQL (0.1ms) PRAGMA index_list("orders") + SQL (0.3ms) CREATE INDEX "index_orders_on_number" ON "orders" ("number") + SQL (0.3ms) DROP TABLE "altered_orders" + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100811205836') +Migrating to PaymentsStateAndAssignedToOrderOnly (20100812162326) + SQL (0.4ms) CREATE TEMPORARY TABLE "altered_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL, "payable_type" varchar(255), "source_id" integer, "source_type" varchar(255), "payment_method_id" integer) + SQL (0.1ms) PRAGMA index_list("payments") + SQL (1.2ms) DROP TABLE "payments" + SQL (1.0ms) CREATE TABLE "payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL, "payable_type" varchar(255), "source_id" integer, "source_type" varchar(255), "payment_method_id" integer)  + SQL (0.1ms) PRAGMA index_list("altered_payments") + SQL (0.3ms) DROP TABLE "altered_payments" + SQL (0.4ms) CREATE TEMPORARY TABLE "altered_payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL, "payable_type" varchar(255), "source_id" integer, "source_type" varchar(255), "payment_method_id" integer) + SQL (0.1ms) PRAGMA index_list("payments") + SQL (0.6ms) DROP TABLE "payments" + SQL (0.5ms) CREATE TABLE "payments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "created_at" datetime, "updated_at" datetime, "amount" decimal DEFAULT 0.0 NOT NULL, "source_id" integer, "source_type" varchar(255), "payment_method_id" integer)  + SQL (0.2ms) PRAGMA index_list("altered_payments") + SQL (0.3ms) DROP TABLE "altered_payments" + SQL (0.5ms) ALTER TABLE "payments" ADD "state" varchar(255) + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100812162326') +Migrating to CreateAddressKeysForOrder (20100813023502) + SQL (0.8ms) ALTER TABLE "orders" ADD "bill_address_id" integer + SQL (0.8ms) ALTER TABLE "orders" ADD "ship_address_id" integer + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100813023502') +Migrating to PaymentTotalForOrders (20100813185745) + SQL (0.8ms) ALTER TABLE "orders" ADD "payment_total" decimal(8,2) DEFAULT 0.0 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100813185745') +Migrating to ShippingMethodIdForOrders (20100816212146) + SQL (0.9ms) ALTER TABLE "orders" ADD "shipping_method_id" integer + SQL (1.7ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100816212146') +Migrating to AddShipmentAndPaymentState (20100817152723) + SQL (0.9ms) ALTER TABLE "orders" ADD "shipment_state" varchar(255) + SQL (0.7ms) ALTER TABLE "orders" ADD "payment_state" varchar(255) + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100817152723') +Migrating to RefactorAdjustments (20100819170125) + SQL (0.9ms) ALTER TABLE "adjustments" ADD "mandatory" boolean + SQL (1.3ms) ALTER TABLE "adjustments" ADD "frozen" boolean + SQL (0.4ms) CREATE TEMPORARY TABLE "altered_adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "type" varchar(255), "amount" decimal, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "source_id" integer, "adjustment_source_type" varchar(255), "mandatory" boolean, "frozen" boolean)  + SQL (0.2ms) PRAGMA index_list("adjustments") + SQL (0.1ms) PRAGMA index_info('index_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.3ms) CREATE INDEX "temp_index_altered_adjustments_on_order_id" ON "altered_adjustments" ("order_id") + SQL (0.8ms) DROP TABLE "adjustments" + SQL (0.6ms) CREATE TABLE "adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "type" varchar(255), "amount" decimal, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "source_id" integer, "adjustment_source_type" varchar(255), "mandatory" boolean, "frozen" boolean)  + SQL (0.2ms) PRAGMA index_list("altered_adjustments") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.4ms) CREATE INDEX "index_adjustments_on_order_id" ON "adjustments" ("order_id") + SQL (0.3ms) DROP TABLE "altered_adjustments" + SQL (0.4ms) CREATE TEMPORARY TABLE "altered_adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "type" varchar(255), "amount" decimal, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "source_id" integer, "source_type" varchar(255), "mandatory" boolean, "frozen" boolean)  + SQL (0.2ms) PRAGMA index_list("adjustments") + SQL (0.1ms) PRAGMA index_info('index_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.4ms) CREATE INDEX "temp_index_altered_adjustments_on_order_id" ON "altered_adjustments" ("order_id") + SQL (0.5ms) DROP TABLE "adjustments" + SQL (0.5ms) CREATE TABLE "adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "type" varchar(255), "amount" decimal, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "source_id" integer, "source_type" varchar(255), "mandatory" boolean, "frozen" boolean)  + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.3ms) CREATE INDEX "index_adjustments_on_order_id" ON "adjustments" ("order_id") + SQL (0.3ms) DROP TABLE "altered_adjustments" + SQL (0.5ms) ALTER TABLE "adjustments" ADD "originator_id" integer + SQL (0.5ms) ALTER TABLE "adjustments" ADD "originator_type" varchar(255) + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "type" varchar(255), "amount" decimal, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "source_id" integer, "source_type" varchar(255), "mandatory" boolean, "frozen" boolean, "originator_id" integer, "originator_type" varchar(255))  + SQL (0.2ms) PRAGMA index_list("adjustments") + SQL (0.1ms) PRAGMA index_info('index_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.3ms) CREATE INDEX "temp_index_altered_adjustments_on_order_id" ON "altered_adjustments" ("order_id") + SQL (0.4ms) DROP TABLE "adjustments" + SQL (0.5ms) CREATE TABLE "adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "amount" decimal, "description" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "source_id" integer, "source_type" varchar(255), "mandatory" boolean, "frozen" boolean, "originator_id" integer, "originator_type" varchar(255))  + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.3ms) CREATE INDEX "index_adjustments_on_order_id" ON "adjustments" ("order_id") + SQL (0.3ms) DROP TABLE "altered_adjustments" + SQL (0.4ms) CREATE TEMPORARY TABLE "altered_adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "amount" decimal, "label" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "source_id" integer, "source_type" varchar(255), "mandatory" boolean, "frozen" boolean, "originator_id" integer, "originator_type" varchar(255))  + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.1ms) PRAGMA index_info('index_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.2ms) CREATE INDEX "temp_index_altered_adjustments_on_order_id" ON "altered_adjustments" ("order_id") + SQL (0.4ms) DROP TABLE "adjustments" + SQL (0.5ms) CREATE TABLE "adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "amount" decimal, "label" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "source_id" integer, "source_type" varchar(255), "mandatory" boolean, "frozen" boolean, "originator_id" integer, "originator_type" varchar(255))  + SQL (0.2ms) PRAGMA index_list("altered_adjustments") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.3ms) CREATE INDEX "index_adjustments_on_order_id" ON "adjustments" ("order_id") + SQL (0.3ms) DROP TABLE "altered_adjustments" + SQL (0.4ms) CREATE TEMPORARY TABLE "altered_adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "amount" decimal, "label" varchar(255), "position" integer, "created_at" datetime, "updated_at" datetime, "source_id" integer, "source_type" varchar(255), "mandatory" boolean, "frozen" boolean, "originator_id" integer, "originator_type" varchar(255))  + SQL (0.2ms) PRAGMA index_list("adjustments") + SQL (0.1ms) PRAGMA index_info('index_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.3ms) CREATE INDEX "temp_index_altered_adjustments_on_order_id" ON "altered_adjustments" ("order_id") + SQL (0.4ms) DROP TABLE "adjustments" + SQL (0.4ms) CREATE TABLE "adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "amount" decimal, "label" varchar(255), "created_at" datetime, "updated_at" datetime, "source_id" integer, "source_type" varchar(255), "mandatory" boolean, "frozen" boolean, "originator_id" integer, "originator_type" varchar(255))  + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.3ms) CREATE INDEX "index_adjustments_on_order_id" ON "adjustments" ("order_id") + SQL (0.3ms) DROP TABLE "altered_adjustments" + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100819170125') +Migrating to ResponseCodeAndAvsResponseForPayments (20100820135707) + SQL (0.8ms) ALTER TABLE "payments" ADD "response_code" varchar(255) + SQL (0.6ms) ALTER TABLE "payments" ADD "avs_response" varchar(255) + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100820135707') +Migrating to ChangeGuestFlagToAnonymous (20100901171814) + SQL (0.6ms) CREATE TEMPORARY TABLE "altered_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128), "salt" varchar(128), "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer, "openid_identifier" varchar(255), "anonymous" boolean)  + SQL (0.2ms) PRAGMA index_list("users") + SQL (0.1ms) PRAGMA index_info('index_users_on_persistence_token') + SQL (0.1ms) PRAGMA index_info('index_users_on_openid_identifier') + SQL (0.1ms) PRAGMA index_list("altered_users") + SQL (0.3ms) CREATE INDEX "temp_index_altered_users_on_persistence_token" ON "altered_users" ("persistence_token") + SQL (0.2ms) PRAGMA index_list("altered_users") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_users_on_persistence_token') + SQL (0.3ms) CREATE INDEX "temp_index_altered_users_on_openid_identifier" ON "altered_users" ("openid_identifier") + SQL (0.7ms) DROP TABLE "users" + SQL (0.7ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128), "salt" varchar(128), "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer, "openid_identifier" varchar(255), "anonymous" boolean)  + SQL (0.2ms) PRAGMA index_list("altered_users") + SQL (0.2ms) PRAGMA index_info('temp_index_altered_users_on_openid_identifier') + SQL (0.2ms) PRAGMA index_info('temp_index_altered_users_on_persistence_token') + SQL (0.1ms) PRAGMA index_list("users") + SQL (0.4ms) CREATE INDEX "index_users_on_openid_identifier" ON "users" ("openid_identifier") + SQL (0.2ms) PRAGMA index_list("users") + SQL (0.2ms) PRAGMA index_info('index_users_on_openid_identifier') + SQL (0.4ms) CREATE INDEX "index_users_on_persistence_token" ON "users" ("persistence_token") + SQL (0.4ms) DROP TABLE "altered_users" + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100901171814') +Migrating to EmailForOrders (20100903203949) + SQL (1.2ms) ALTER TABLE "orders" ADD "email" varchar(255) + SQL (2.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100903203949') +Migrating to CreateMailMethods (20100923162011) + SQL (0.7ms) CREATE TABLE "mail_methods" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "environment" varchar(255), "active" boolean DEFAULT 't', "created_at" datetime, "updated_at" datetime) + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100923162011') +Migrating to RenameFrozenToLocked (20100929151905) + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "amount" decimal, "label" varchar(255), "created_at" datetime, "updated_at" datetime, "source_id" integer, "source_type" varchar(255), "mandatory" boolean, "locked" boolean, "originator_id" integer, "originator_type" varchar(255))  + SQL (0.2ms) PRAGMA index_list("adjustments") + SQL (0.1ms) PRAGMA index_info('index_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("altered_adjustments") + SQL (0.3ms) CREATE INDEX "temp_index_altered_adjustments_on_order_id" ON "altered_adjustments" ("order_id") + SQL (0.7ms) DROP TABLE "adjustments" + SQL (0.7ms) CREATE TABLE "adjustments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "amount" decimal, "label" varchar(255), "created_at" datetime, "updated_at" datetime, "source_id" integer, "source_type" varchar(255), "mandatory" boolean, "locked" boolean, "originator_id" integer, "originator_type" varchar(255))  + SQL (0.2ms) PRAGMA index_list("altered_adjustments") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_adjustments_on_order_id') + SQL (0.1ms) PRAGMA index_list("adjustments") + SQL (0.4ms) CREATE INDEX "index_adjustments_on_order_id" ON "adjustments" ("order_id") + SQL (0.3ms) DROP TABLE "altered_adjustments" + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20100929151905') +Migrating to MoveSpecialInstructionsToOrders (20101008190536) + SQL (1.1ms) ALTER TABLE "orders" ADD "special_instructions" text + SQL (0.2ms) update orders set special_instructions = (select special_instructions from checkouts where order_id = orders.id) + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101008190536') +Migrating to CreateLogEntries (20101026184700) + SQL (0.8ms) CREATE TABLE "log_entries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "source_id" integer, "source_type" varchar(255), "details" text, "created_at" datetime, "updated_at" datetime)  + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026184700') +Migrating to MigrateTransactionsToPaymentState (20101026184714) + Transaction Load (0.4ms) select * from transactions group by payment_id having count(payment_id) = 1 and txn_type = 1 + Transaction Load (0.4ms) select * from transactions where txn_type=4 + Transaction Load (1.9ms) select * from transactions where txn_type = 2 + Transaction Load (0.2ms) select * from transactions where txn_type = 3 + Transaction Load (0.2ms) select * from transactions where txn_type = 5 + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026184714') +Migrating to DeleteInProgressOrders (20101026184746) + SQL (1.7ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) DELETE FROM "orders" WHERE ("orders"."state" = 'in_progress') + SQL (0.2ms) delete from adjustments where order_id not in (select id from orders) + SQL (0.2ms) delete from checkouts where order_id not in (select id from orders) + SQL (0.2ms) delete from shipments where order_id not in (select id from orders) + SQL (0.4ms) delete from payments where order_id not in (select id from orders) + SQL (0.2ms) delete from line_items where order_id not in (select id from orders) + SQL (0.2ms) delete from inventory_units where order_id not in (select id from orders) + SQL (1.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026184746') +Migrating to MigrateCheckoutToOrders (20101026184808) + Order Load (0.5ms) SELECT "orders".* FROM "orders" WHERE ("orders"."id" >= 0) ORDER BY orders.id ASC LIMIT 1000 + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026184808') +Migrating to MigrateAdjustments (20101026184833) + SQL (1.8ms) update adjustments set amount = 0.0 where amount is null + SQL (0.2ms) update adjustments set mandatory = 'true', locked = 'true' + SQL (1.7ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026184833') +Migrating to RemoveShippedState (20101026184855) + Order Load (0.4ms) SELECT "orders".* FROM "orders" WHERE ("orders"."state" = 'shipped') + SQL (1.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026184855') +Migrating to PreventNilPaymentTotal (20101026184916) + SQL (0.3ms) update orders set payment_total = 0.0 where payment_total is null + SQL (2.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026184916') +Migrating to PreventNilEmail (20101026184932) + SQL (0.3ms) update orders set email = 'guest@example.com' where email is null + SQL (0.2ms) update orders set email = 'guest@example.com' where email = '' + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026184932') +Migrating to GenerateAnonymousUsers (20101026184959) + Order Load (0.5ms) SELECT "orders".* FROM "orders" WHERE ("orders"."user_id" IS NULL) + SQL (2.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026184959') +Migrating to UpdateOrderState (20101026185022) + Order Load (0.4ms) SELECT "orders".* FROM "orders" + SQL (1.8ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026185022') +Migrating to CleanupLegacyTables (20101026192225) + SQL (0.8ms) DROP TABLE "checkouts" + SQL (0.7ms) DROP TABLE "transactions" + SQL (0.5ms) DROP TABLE "open_id_authentication_associations" + SQL (2.4ms) DROP TABLE "open_id_authentication_nonces" + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101026192225') +Migrating to RemoveNumberAndCvvFromCredicard (20101028151745) + SQL (0.5ms) CREATE TEMPORARY TABLE "altered_creditcards" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "number" text, "month" varchar(255), "year" varchar(255), "verification_value" text, "cc_type" varchar(255), "last_digits" varchar(255), "first_name" varchar(255), "last_name" varchar(255), "created_at" datetime, "updated_at" datetime, "start_month" varchar(255), "start_year" varchar(255), "issue_number" varchar(255), "address_id" integer, "gateway_customer_profile_id" varchar(255), "gateway_payment_profile_id" varchar(255)) + SQL (0.1ms) PRAGMA index_list("creditcards") + SQL (0.5ms) DROP TABLE "creditcards" + SQL (0.8ms) CREATE TABLE "creditcards" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "month" varchar(255), "year" varchar(255), "verification_value" text, "cc_type" varchar(255), "last_digits" varchar(255), "first_name" varchar(255), "last_name" varchar(255), "created_at" datetime, "updated_at" datetime, "start_month" varchar(255), "start_year" varchar(255), "issue_number" varchar(255), "address_id" integer, "gateway_customer_profile_id" varchar(255), "gateway_payment_profile_id" varchar(255))  + SQL (0.1ms) PRAGMA index_list("altered_creditcards") + SQL (0.3ms) DROP TABLE "altered_creditcards" + SQL (0.4ms) CREATE TEMPORARY TABLE "altered_creditcards" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "month" varchar(255), "year" varchar(255), "verification_value" text, "cc_type" varchar(255), "last_digits" varchar(255), "first_name" varchar(255), "last_name" varchar(255), "created_at" datetime, "updated_at" datetime, "start_month" varchar(255), "start_year" varchar(255), "issue_number" varchar(255), "address_id" integer, "gateway_customer_profile_id" varchar(255), "gateway_payment_profile_id" varchar(255)) + SQL (0.1ms) PRAGMA index_list("creditcards") + SQL (0.6ms) DROP TABLE "creditcards" + SQL (0.5ms) CREATE TABLE "creditcards" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "month" varchar(255), "year" varchar(255), "cc_type" varchar(255), "last_digits" varchar(255), "first_name" varchar(255), "last_name" varchar(255), "created_at" datetime, "updated_at" datetime, "start_month" varchar(255), "start_year" varchar(255), "issue_number" varchar(255), "address_id" integer, "gateway_customer_profile_id" varchar(255), "gateway_payment_profile_id" varchar(255))  + SQL (0.1ms) PRAGMA index_list("altered_creditcards") + SQL (0.3ms) DROP TABLE "altered_creditcards" + SQL (2.0ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101028151745') +Migrating to DropAnonymousFieldForUser (20101103212716) + SQL (0.6ms) CREATE TEMPORARY TABLE "altered_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128), "salt" varchar(128), "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer, "openid_identifier" varchar(255), "anonymous" boolean) + SQL (0.2ms) PRAGMA index_list("users") + SQL (0.5ms) PRAGMA index_info('index_users_on_persistence_token') + SQL (0.2ms) PRAGMA index_info('index_users_on_openid_identifier') + SQL (0.1ms) PRAGMA index_list("altered_users") + SQL (0.5ms) CREATE INDEX "temp_index_altered_users_on_persistence_token" ON "altered_users" ("persistence_token") + SQL (0.2ms) PRAGMA index_list("altered_users") + SQL (0.1ms) PRAGMA index_info('temp_index_altered_users_on_persistence_token') + SQL (0.3ms) CREATE INDEX "temp_index_altered_users_on_openid_identifier" ON "altered_users" ("openid_identifier") + SQL (1.1ms) DROP TABLE "users" + SQL (1.1ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "crypted_password" varchar(128), "salt" varchar(128), "remember_token" varchar(255), "remember_token_expires_at" varchar(255), "created_at" datetime, "updated_at" datetime, "persistence_token" varchar(255), "single_access_token" varchar(255), "perishable_token" varchar(255), "login_count" integer DEFAULT 0 NOT NULL, "failed_login_count" integer DEFAULT 0 NOT NULL, "last_request_at" datetime, "current_login_at" datetime, "last_login_at" datetime, "current_login_ip" varchar(255), "last_login_ip" varchar(255), "login" varchar(255), "ship_address_id" integer, "bill_address_id" integer, "openid_identifier" varchar(255)) + SQL (0.2ms) PRAGMA index_list("altered_users") + SQL (0.2ms) PRAGMA index_info('temp_index_altered_users_on_openid_identifier') + SQL (0.1ms) PRAGMA index_info('temp_index_altered_users_on_persistence_token') + SQL (0.1ms) PRAGMA index_list("users") + SQL (0.4ms) CREATE INDEX "index_users_on_openid_identifier" ON "users" ("openid_identifier") + SQL (0.2ms) PRAGMA index_list("users") + SQL (0.1ms) PRAGMA index_info('index_users_on_openid_identifier') + SQL (0.4ms) CREATE INDEX "index_users_on_persistence_token" ON "users" ("persistence_token") + SQL (0.4ms) DROP TABLE "altered_users" + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101103212716') +Migrating to RenamedRmaCancelledState (20101111133551) + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + ReturnAuthorization Load (0.2ms) SELECT "return_authorizations".* FROM "return_authorizations" WHERE ("return_authorizations"."state" = 'cancelled') + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101111133551') +Migrating to FixProblematicIndexNames (20101117031806) + SQL (0.1ms) PRAGMA index_list("preferences") +Index name 'index_preferences_on_index_preferences_on_owner_and_attribute_and_preference' on table 'preferences' does not exist. Skipping. + SQL (0.1ms) PRAGMA index_list("preferences") + SQL (0.7ms) CREATE UNIQUE INDEX "ix_prefs_on_owner_attr_pref" ON "preferences" ("owner_id", "owner_type", "name", "group_id", "group_type") + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20101117031806') + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (2.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (0.2ms) PRAGMA index_list("addresses") + SQL (0.2ms) PRAGMA index_info('index_addresses_on_lastname') + SQL (0.1ms) PRAGMA index_info('index_addresses_on_firstname') + SQL (0.2ms) PRAGMA index_list("adjustments") + SQL (0.1ms) PRAGMA index_info('index_adjustments_on_order_id') + SQL (0.2ms) PRAGMA index_list("assets") + SQL (0.2ms) PRAGMA index_info('index_assets_on_viewable_type_and_type') + SQL (0.2ms) PRAGMA index_info('index_assets_on_viewable_id') + SQL (0.1ms) PRAGMA index_list("calculators") + SQL (0.1ms) PRAGMA index_list("configurations") + SQL (0.2ms) PRAGMA index_info('index_configurations_on_name_and_type') + SQL (0.1ms) PRAGMA index_list("countries") + SQL (0.1ms) PRAGMA index_list("coupons") + SQL (0.1ms) PRAGMA index_list("creditcards") + SQL (0.1ms) PRAGMA index_list("gateways") + SQL (0.2ms) PRAGMA index_list("inventory_units") + SQL (0.1ms) PRAGMA index_info('index_inventory_units_on_shipment_id') + SQL (0.1ms) PRAGMA index_info('index_inventory_units_on_order_id') + SQL (0.1ms) PRAGMA index_info('index_inventory_units_on_variant_id') + SQL (0.2ms) PRAGMA index_list("line_items") + SQL (0.1ms) PRAGMA index_info('index_line_items_on_variant_id') + SQL (0.1ms) PRAGMA index_info('index_line_items_on_order_id') + SQL (0.1ms) PRAGMA index_list("log_entries") + SQL (0.1ms) PRAGMA index_list("mail_methods") + SQL (0.1ms) PRAGMA index_list("option_types") + SQL (0.1ms) PRAGMA index_list("option_types_prototypes") + SQL (0.1ms) PRAGMA index_list("option_values") + SQL (0.2ms) PRAGMA index_list("option_values_variants") + SQL (0.2ms) PRAGMA index_info('index_option_values_variants_on_variant_id_and_option_value_id') + SQL (0.2ms) PRAGMA index_info('index_option_values_variants_on_variant_id') + SQL (0.1ms) PRAGMA index_list("orders") + SQL (0.1ms) PRAGMA index_info('index_orders_on_number') + SQL (0.1ms) PRAGMA index_list("payment_methods") + SQL (0.1ms) PRAGMA index_list("payments") + SQL (0.2ms) PRAGMA index_list("preferences") + SQL (0.3ms) PRAGMA index_info('ix_prefs_on_owner_attr_pref') + SQL (0.2ms) PRAGMA index_list("product_groups") + SQL (0.1ms) PRAGMA index_info('index_product_groups_on_permalink') + SQL (0.1ms) PRAGMA index_info('index_product_groups_on_name') + SQL (0.1ms) PRAGMA index_list("product_groups_products") + SQL (0.1ms) PRAGMA index_list("product_option_types") + SQL (0.1ms) PRAGMA index_list("product_properties") + SQL (0.1ms) PRAGMA index_info('index_product_properties_on_product_id') + SQL (0.1ms) PRAGMA index_list("product_scopes") + SQL (0.1ms) PRAGMA index_info('index_product_scopes_on_product_group_id') + SQL (0.1ms) PRAGMA index_info('index_product_scopes_on_name') + SQL (0.2ms) PRAGMA index_list("products") + SQL (0.1ms) PRAGMA index_info('index_products_on_permalink') + SQL (0.1ms) PRAGMA index_info('index_products_on_name') + SQL (0.1ms) PRAGMA index_info('index_products_on_deleted_at') + SQL (0.1ms) PRAGMA index_info('index_products_on_available_on') + SQL (0.2ms) PRAGMA index_list("products_taxons") + SQL (0.1ms) PRAGMA index_info('index_products_taxons_on_taxon_id') + SQL (0.1ms) PRAGMA index_info('index_products_taxons_on_product_id') + SQL (0.1ms) PRAGMA index_list("properties") + SQL (0.1ms) PRAGMA index_list("properties_prototypes") + SQL (0.1ms) PRAGMA index_list("prototypes") + SQL (0.1ms) PRAGMA index_list("question_categories") + SQL (0.1ms) PRAGMA index_list("questions") + SQL (0.1ms) PRAGMA index_list("return_authorizations") + SQL (0.1ms) PRAGMA index_list("roles") + SQL (0.1ms) PRAGMA index_list("roles_users") + SQL (0.1ms) PRAGMA index_info('index_roles_users_on_user_id') + SQL (0.1ms) PRAGMA index_info('index_roles_users_on_role_id') + SQL (0.1ms) PRAGMA index_list("shipments") + SQL (0.1ms) PRAGMA index_info('index_shipments_on_number') + SQL (0.1ms) PRAGMA index_list("shipping_categories") + SQL (0.1ms) PRAGMA index_list("shipping_methods") + SQL (0.1ms) PRAGMA index_list("state_events") + SQL (0.1ms) PRAGMA index_list("states") + SQL (0.1ms) PRAGMA index_list("tax_categories") + SQL (0.1ms) PRAGMA index_list("tax_rates") + SQL (0.1ms) PRAGMA index_list("taxonomies") + SQL (0.2ms) PRAGMA index_list("taxons") + SQL (0.1ms) PRAGMA index_info('index_taxons_on_taxonomy_id') + SQL (0.1ms) PRAGMA index_info('index_taxons_on_parent_id') + SQL (0.1ms) PRAGMA index_info('index_taxons_on_permalink') + SQL (0.1ms) PRAGMA index_list("trackers") + SQL (0.2ms) PRAGMA index_list("users") + SQL (0.1ms) PRAGMA index_info('index_users_on_persistence_token') + SQL (0.1ms) PRAGMA index_info('index_users_on_openid_identifier') + SQL (0.1ms) PRAGMA index_list("variants") + SQL (0.1ms) PRAGMA index_info('index_variants_on_product_id') + SQL (0.1ms) PRAGMA index_list("zone_members") + SQL (0.1ms) PRAGMA index_list("zones") + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" + SQL (4.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.2ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.2ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.3ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + AppConfiguration Load (0.3ms) SELECT "configurations"."id" FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (0.5ms) INSERT INTO "configurations" ("created_at", "name", "type", "updated_at") VALUES ('2010-11-22 20:50:57.375758', 'Default configuration', 'AppConfiguration', '2010-11-22 20:50:57.375758') + Preference Load (0.4ms) SELECT "preferences".* FROM "preferences" WHERE ("preferences".owner_id = 1 AND "preferences".owner_type = 'Configuration') + QuestionCategory Load (0.3ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.3ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:50:58.418228', 'foo', 1, '2010-11-22 20:50:58.418228') + Question Load (0.3ms) SELECT "questions".* FROM "questions" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) INSERT INTO "questions" ("answer", "created_at", "position", "question", "question_category_id", "updated_at") VALUES ('value for answer', '2010-11-22 20:50:58.432221', 1, 'value for question', 1, '2010-11-22 20:50:58.432221') + QuestionCategory Load (0.3ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.3ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:50:58.443573', 'foo', 1, '2010-11-22 20:50:58.443573') + Question Load (0.3ms) SELECT "questions".* FROM "questions" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) INSERT INTO "questions" ("answer", "created_at", "position", "question", "question_category_id", "updated_at") VALUES ('value for answer', '2010-11-22 20:50:58.448474', 1, 'value for question', 1, '2010-11-22 20:50:58.448474') + QuestionCategory Load (0.3ms) SELECT "question_categories".* FROM "question_categories" WHERE ("question_categories"."id" = 1) LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.3ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.3ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:50:58.461357', 'foo', 1, '2010-11-22 20:50:58.461357') + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.4ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:50:58.495537', 'foo', 1, '2010-11-22 20:50:58.495537') + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.4ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:50:58.510502', 'foo', 1, '2010-11-22 20:50:58.510502') + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.3ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.4ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:50:58.524455', 'foo', 1, '2010-11-22 20:50:58.524455') + Question Load (0.2ms) SELECT "questions".* FROM "questions" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) INSERT INTO "questions" ("answer", "created_at", "position", "question", "question_category_id", "updated_at") VALUES ('value for answer', '2010-11-22 20:50:58.529992', 1, 'value for question', 1, '2010-11-22 20:50:58.529992') + Question Load (0.3ms) SELECT "questions".* FROM "questions" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) INSERT INTO "questions" ("answer", "created_at", "position", "question", "question_category_id", "updated_at") VALUES ('value for answer', '2010-11-22 20:50:58.534925', 2, 'value for question', 1, '2010-11-22 20:50:58.534925') + SQL (0.2ms) UPDATE "questions" SET position = (position - 1) WHERE (1 = 1 AND position > 1) + Question Load (0.3ms) SELECT "questions".* FROM "questions" WHERE (1 = 1 AND id != 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) UPDATE "questions" SET "position" = 2, "updated_at" = '2010-11-22 20:50:58.540340' WHERE ("questions"."id" = 1) + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.3ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:50:58.549611', 'value for name', 1, '2010-11-22 20:50:58.549611') + QuestionCategory Load (0.3ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + QuestionCategory Load (1.1ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.4ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:50:58.695720', 'value for name', 1, '2010-11-22 20:50:58.695720') + Question Load (0.2ms) SELECT "questions".* FROM "questions" WHERE ("questions".question_category_id = 1) + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" IS NULL) LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" IS NULL) LIMIT 1 + QuestionCategory Load (0.3ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'test') LIMIT 1 + QuestionCategory Load (0.3ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.4ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:50:58.720977', 'test', 1, '2010-11-22 20:50:58.720977') + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + QuestionCategory Load (0.3ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:50:58.727687', 'value for name', 2, '2010-11-22 20:50:58.727687') + SQL (0.2ms) UPDATE "question_categories" SET position = (position - 1) WHERE (1 = 1 AND position > 1) + QuestionCategory Load (0.4ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1 AND id != 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) UPDATE "question_categories" SET "position" = 2, "updated_at" = '2010-11-22 20:50:58.733619' WHERE ("question_categories"."id" = 1) + QuestionCategory Load (0.3ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.3ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:50:58.743788', 'value for name', 1, '2010-11-22 20:50:58.743788') + QuestionCategory Load (0.3ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + SQL (4.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.2ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + QuestionCategory Load (0.3ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.3ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.6ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:51:12.213834', 'foo', 1, '2010-11-22 20:51:12.213834') + Question Load (0.3ms) SELECT "questions".* FROM "questions" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) INSERT INTO "questions" ("answer", "created_at", "position", "question", "question_category_id", "updated_at") VALUES ('value for answer', '2010-11-22 20:51:12.233776', 1, 'value for question', 1, '2010-11-22 20:51:12.233776') + QuestionCategory Load (0.3ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.3ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:51:12.244290', 'foo', 1, '2010-11-22 20:51:12.244290') + Question Load (0.2ms) SELECT "questions".* FROM "questions" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) INSERT INTO "questions" ("answer", "created_at", "position", "question", "question_category_id", "updated_at") VALUES ('value for answer', '2010-11-22 20:51:12.249038', 1, 'value for question', 1, '2010-11-22 20:51:12.249038') + QuestionCategory Load (0.3ms) SELECT "question_categories".* FROM "question_categories" WHERE ("question_categories"."id" = 1) LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.4ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:51:12.261560', 'foo', 1, '2010-11-22 20:51:12.261560') + QuestionCategory Load (0.3ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.4ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:51:12.295066', 'foo', 1, '2010-11-22 20:51:12.295066') + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.4ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:51:12.308867', 'foo', 1, '2010-11-22 20:51:12.308867') + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.3ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.3ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:51:12.322691', 'foo', 1, '2010-11-22 20:51:12.322691') + Question Load (0.2ms) SELECT "questions".* FROM "questions" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) INSERT INTO "questions" ("answer", "created_at", "position", "question", "question_category_id", "updated_at") VALUES ('value for answer', '2010-11-22 20:51:12.327618', 1, 'value for question', 1, '2010-11-22 20:51:12.327618') + Question Load (0.5ms) SELECT "questions".* FROM "questions" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) INSERT INTO "questions" ("answer", "created_at", "position", "question", "question_category_id", "updated_at") VALUES ('value for answer', '2010-11-22 20:51:12.332831', 2, 'value for question', 1, '2010-11-22 20:51:12.332831') + SQL (0.2ms) UPDATE "questions" SET position = (position - 1) WHERE (1 = 1 AND position > 1) + Question Load (0.3ms) SELECT "questions".* FROM "questions" WHERE (1 = 1 AND id != 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) UPDATE "questions" SET "position" = 2, "updated_at" = '2010-11-22 20:51:12.338028' WHERE ("questions"."id" = 1) + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.3ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:51:12.347364', 'value for name', 1, '2010-11-22 20:51:12.347364') + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.3ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:51:12.356039', 'value for name', 1, '2010-11-22 20:51:12.356039') + Question Load (0.2ms) SELECT "questions".* FROM "questions" WHERE ("questions".question_category_id = 1) + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" IS NULL) LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" IS NULL) LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'test') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (2.0ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:51:12.379206', 'test', 1, '2010-11-22 20:51:12.379206') + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + QuestionCategory Load (0.3ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:51:12.524332', 'value for name', 2, '2010-11-22 20:51:12.524332') + SQL (0.2ms) UPDATE "question_categories" SET position = (position - 1) WHERE (1 = 1 AND position > 1) + QuestionCategory Load (0.3ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1 AND id != 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) UPDATE "question_categories" SET "position" = 2, "updated_at" = '2010-11-22 20:51:12.529778' WHERE ("question_categories"."id" = 1) + QuestionCategory Load (0.3ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.4ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:51:12.539123', 'value for name', 1, '2010-11-22 20:51:12.539123') + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + SQL (4.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.2ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.6ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.3ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (4.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.2ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.3ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (4.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.2ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (4.9ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.2ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.6ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.3ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (4.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.2ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (4.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.2ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (3.8ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.8ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.3ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (4.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.2ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (4.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.2ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.2ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (4.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.7ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.3ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (4.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (2.9ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.6ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.3ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.6ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.6ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:53:56.093789', 'foo', 1, '2010-11-22 20:53:56.093789') + Question Load (0.3ms) SELECT "questions".* FROM "questions" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) INSERT INTO "questions" ("answer", "created_at", "position", "question", "question_category_id", "updated_at") VALUES ('value for answer', '2010-11-22 20:53:56.111482', 1, 'value for question', 1, '2010-11-22 20:53:56.111482') + QuestionCategory Load (0.3ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.3ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:53:56.122013', 'foo', 1, '2010-11-22 20:53:56.122013') + Question Load (0.3ms) SELECT "questions".* FROM "questions" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) INSERT INTO "questions" ("answer", "created_at", "position", "question", "question_category_id", "updated_at") VALUES ('value for answer', '2010-11-22 20:53:56.127002', 1, 'value for question', 1, '2010-11-22 20:53:56.127002') + QuestionCategory Load (0.3ms) SELECT "question_categories".* FROM "question_categories" WHERE ("question_categories"."id" = 1) LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.3ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.3ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:53:56.139955', 'foo', 1, '2010-11-22 20:53:56.139955') + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.3ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:53:56.173649', 'foo', 1, '2010-11-22 20:53:56.173649') + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.4ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:53:56.187679', 'foo', 1, '2010-11-22 20:53:56.187679') + QuestionCategory Load (0.3ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.3ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.4ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:53:56.203276', 'foo', 1, '2010-11-22 20:53:56.203276') + Question Load (0.2ms) SELECT "questions".* FROM "questions" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) INSERT INTO "questions" ("answer", "created_at", "position", "question", "question_category_id", "updated_at") VALUES ('value for answer', '2010-11-22 20:53:56.208168', 1, 'value for question', 1, '2010-11-22 20:53:56.208168') + Question Load (0.3ms) SELECT "questions".* FROM "questions" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) INSERT INTO "questions" ("answer", "created_at", "position", "question", "question_category_id", "updated_at") VALUES ('value for answer', '2010-11-22 20:53:56.213502', 2, 'value for question', 1, '2010-11-22 20:53:56.213502') + SQL (0.2ms) UPDATE "questions" SET position = (position - 1) WHERE (1 = 1 AND position > 1) + Question Load (0.4ms) SELECT "questions".* FROM "questions" WHERE (1 = 1 AND id != 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) UPDATE "questions" SET "position" = 2, "updated_at" = '2010-11-22 20:53:56.218767' WHERE ("questions"."id" = 1) + QuestionCategory Load (0.3ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + QuestionCategory Load (0.3ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.4ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:53:56.370293', 'value for name', 1, '2010-11-22 20:53:56.370293') + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + QuestionCategory Load (0.3ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.4ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:53:56.379458', 'value for name', 1, '2010-11-22 20:53:56.379458') + Question Load (0.2ms) SELECT "questions".* FROM "questions" WHERE ("questions".question_category_id = 1) + QuestionCategory Load (0.3ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" IS NULL) LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" IS NULL) LIMIT 1 + QuestionCategory Load (0.3ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'test') LIMIT 1 + QuestionCategory Load (0.3ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.4ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:53:56.406891', 'test', 1, '2010-11-22 20:53:56.406891') + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + QuestionCategory Load (0.3ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:53:56.413445', 'value for name', 2, '2010-11-22 20:53:56.413445') + SQL (0.2ms) UPDATE "question_categories" SET position = (position - 1) WHERE (1 = 1 AND position > 1) + QuestionCategory Load (0.3ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1 AND id != 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) UPDATE "question_categories" SET "position" = 2, "updated_at" = '2010-11-22 20:53:56.418637' WHERE ("question_categories"."id" = 1) + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.4ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:53:56.428043', 'value for name', 1, '2010-11-22 20:53:56.428043') + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (4.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.2ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.3ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (4.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (2.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.4ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (4.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.2ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.3ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (4.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.2ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.6ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.2ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (4.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.3ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (4.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.3ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (4.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.3ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (4.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (2.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.6ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.7ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.3ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (4.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.6ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (2.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.2ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (4.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.3ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (4.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.2ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.9ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.7ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.2ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (4.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.2ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.3ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (4.8ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.2ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (4.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.7ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.2ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (4.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.2ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + Processing by FaqsController#index as HTML +Rendered /home/josh/Playground/spree-faq/app/views/faqs/index.html.erb within layouts/spree_application (0.9ms) +Completed 200 OK in 165ms (Views: 13.6ms | ActiveRecord: 23.7ms) + Processing by FaqsController#show as HTML + Parameters: {"id"=>1} + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + +Completed in 5ms + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (4.7ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.3ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + Processing by FaqsController#index as HTML +Rendered /home/josh/Playground/spree-faq/app/views/faqs/index.html.erb within layouts/spree_application (0.9ms) +Completed 200 OK in 168ms (Views: 13.5ms | ActiveRecord: 24.6ms) + Processing by FaqsController#show as HTML + Parameters: {"id"=>1} + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + +Completed in 5ms + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (4.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.4ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.2ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (2.1ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + Processing by FaqsController#index as HTML +Rendered /home/josh/Playground/spree-faq/app/views/faqs/index.html.erb within layouts/spree_application (1.1ms) +Completed 200 OK in 167ms (Views: 13.7ms | ActiveRecord: 25.0ms) + Processing by FaqsController#show as HTML + Parameters: {"id"=>1} + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + +Completed in 5ms + SQL (1.7ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (4.7ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.2ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.2ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + Processing by FaqsController#index as HTML +Rendered /home/josh/Playground/spree-faq/app/views/faqs/index.html.erb within layouts/spree_application (0.9ms) +Completed 200 OK in 164ms (Views: 13.2ms | ActiveRecord: 23.8ms) + Processing by FaqsController#show as HTML + Parameters: {"id"=>1} + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + +Completed in 5ms + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (4.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.3ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.5ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + Processing by FaqsController#index as HTML +Rendered /home/josh/Playground/spree-faq/app/views/faqs/index.html.erb within layouts/spree_application (0.9ms) +Completed 200 OK in 166ms (Views: 13.2ms | ActiveRecord: 24.9ms) + Processing by FaqsController#show as HTML + Parameters: {"id"=>1} +Completed in 7ms + SQL (4.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (2.5ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.2ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + Processing by FaqsController#index as HTML +Rendered /home/josh/Playground/spree-faq/app/views/faqs/index.html.erb within layouts/spree_application (0.9ms) +Completed 200 OK in 172ms (Views: 13.2ms | ActiveRecord: 24.0ms) + Processing by FaqsController#show as HTML + Parameters: {"id"=>1} +Completed in 6ms + SQL (4.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.2ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + Processing by FaqsController#index as HTML +Rendered /home/josh/Playground/spree-faq/app/views/faqs/index.html.erb within layouts/spree_application (0.8ms) +Completed 200 OK in 166ms (Views: 13.2ms | ActiveRecord: 22.5ms) + Processing by FaqsController#show as HTML + Parameters: {"id"=>1} +Completed in 6ms + SQL (4.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.3ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + Processing by FaqsController#index as HTML +Rendered /home/josh/Playground/spree-faq/app/views/faqs/index.html.erb within layouts/spree_application (0.9ms) +Completed 200 OK in 165ms (Views: 13.4ms | ActiveRecord: 23.5ms) + Processing by FaqsController#show as HTML + Parameters: {"id"=>1} +Completed in 7ms + SQL (4.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.2ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + Processing by FaqsController#index as HTML +Rendered /home/josh/Playground/spree-faq/app/views/faqs/index.html.erb within layouts/spree_application (0.9ms) +Completed 200 OK in 168ms (Views: 14.0ms | ActiveRecord: 23.2ms) + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (5.1ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.2ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.2ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.2ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + Processing by FaqsController#index as HTML +Rendered /home/josh/Playground/spree-faq/app/views/faqs/index.html.erb within layouts/spree_application (0.9ms) +Completed 200 OK in 172ms (Views: 13.3ms | ActiveRecord: 23.5ms) + SQL (4.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + MailMethod Load (0.3ms) SELECT "mail_methods".* FROM "mail_methods" WHERE ("mail_methods"."environment" = 'test') LIMIT 1 + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.5ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.4ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.4ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + SQL (1.3ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + Property Load (0.2ms) SELECT "properties".* FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1 + SQL (1.2ms) SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + SQL (1.3ms)  SELECT name + FROM sqlite_master + WHERE type = 'table' AND NOT name = 'sqlite_sequence' + + AppConfiguration Load (0.4ms) SELECT "configurations".* FROM "configurations" WHERE ("configurations"."type" = 'AppConfiguration') AND ("configurations"."name" = 'Default configuration') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.3ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.5ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:59:18.610166', 'foo', 1, '2010-11-22 20:59:18.610166') + Question Load (0.3ms) SELECT "questions".* FROM "questions" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) INSERT INTO "questions" ("answer", "created_at", "position", "question", "question_category_id", "updated_at") VALUES ('value for answer', '2010-11-22 20:59:18.627996', 1, 'value for question', 1, '2010-11-22 20:59:18.627996') + QuestionCategory Load (0.3ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.3ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:59:18.639009', 'foo', 1, '2010-11-22 20:59:18.639009') + Question Load (0.3ms) SELECT "questions".* FROM "questions" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) INSERT INTO "questions" ("answer", "created_at", "position", "question", "question_category_id", "updated_at") VALUES ('value for answer', '2010-11-22 20:59:18.644030', 1, 'value for question', 1, '2010-11-22 20:59:18.644030') + QuestionCategory Load (0.3ms) SELECT "question_categories".* FROM "question_categories" WHERE ("question_categories"."id" = 1) LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.3ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:59:18.657110', 'foo', 1, '2010-11-22 20:59:18.657110') + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.3ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:59:18.691921', 'foo', 1, '2010-11-22 20:59:18.691921') + QuestionCategory Load (0.4ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.4ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:59:18.707682', 'foo', 1, '2010-11-22 20:59:18.707682') + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'foo') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.4ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:59:18.721783', 'foo', 1, '2010-11-22 20:59:18.721783') + Question Load (0.3ms) SELECT "questions".* FROM "questions" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.3ms) INSERT INTO "questions" ("answer", "created_at", "position", "question", "question_category_id", "updated_at") VALUES ('value for answer', '2010-11-22 20:59:18.727169', 1, 'value for question', 1, '2010-11-22 20:59:18.727169') + Question Load (0.3ms) SELECT "questions".* FROM "questions" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) INSERT INTO "questions" ("answer", "created_at", "position", "question", "question_category_id", "updated_at") VALUES ('value for answer', '2010-11-22 20:59:18.732898', 2, 'value for question', 1, '2010-11-22 20:59:18.732898') + SQL (0.2ms) UPDATE "questions" SET position = (position - 1) WHERE (1 = 1 AND position > 1) + Question Load (0.3ms) SELECT "questions".* FROM "questions" WHERE (1 = 1 AND id != 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) UPDATE "questions" SET "position" = 2, "updated_at" = '2010-11-22 20:59:18.738437' WHERE ("questions"."id" = 1) + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + QuestionCategory Load (0.3ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.3ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:59:18.748093', 'value for name', 1, '2010-11-22 20:59:18.748093') + QuestionCategory Load (0.3ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.4ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:59:18.756895', 'value for name', 1, '2010-11-22 20:59:18.756895') + Question Load (0.2ms) SELECT "questions".* FROM "questions" WHERE ("questions".question_category_id = 1) + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" IS NULL) LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" IS NULL) LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'test') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.3ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:59:18.780543', 'test', 1, '2010-11-22 20:59:18.780543') + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + QuestionCategory Load (0.4ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:59:18.786953', 'value for name', 2, '2010-11-22 20:59:18.786953') + SQL (0.2ms) UPDATE "question_categories" SET position = (position - 1) WHERE (1 = 1 AND position > 1) + QuestionCategory Load (0.4ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1 AND id != 1) ORDER BY position DESC LIMIT 1 + SQL (0.2ms) UPDATE "question_categories" SET "position" = 2, "updated_at" = '2010-11-22 20:59:18.794062' WHERE ("question_categories"."id" = 1) + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories".* FROM "question_categories" WHERE (1 = 1) ORDER BY position DESC LIMIT 1 + SQL (0.4ms) INSERT INTO "question_categories" ("created_at", "name", "position", "updated_at") VALUES ('2010-11-22 20:59:18.802791', 'value for name', 1, '2010-11-22 20:59:18.802791') + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + QuestionCategory Load (0.2ms) SELECT "question_categories"."id" FROM "question_categories" WHERE ("question_categories"."name" = 'value for name') LIMIT 1 + Processing by FaqsController#index as HTML +Completed 200 OK in 15ms (Views: 12.7ms | ActiveRecord: 38.3ms) diff --git a/spec/test_app/public/404.html b/spec/test_app/public/404.html new file mode 100644 index 0000000..9a48320 --- /dev/null +++ b/spec/test_app/public/404.html @@ -0,0 +1,26 @@ + + + + The page you were looking for doesn't exist (404) + + + + + +
+

The page you were looking for doesn't exist.

+

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

+
+ + diff --git a/spec/test_app/public/422.html b/spec/test_app/public/422.html new file mode 100644 index 0000000..83660ab --- /dev/null +++ b/spec/test_app/public/422.html @@ -0,0 +1,26 @@ + + + + The change you wanted was rejected (422) + + + + + +
+

The change you wanted was rejected.

+

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

+
+ + diff --git a/spec/test_app/public/500.html b/spec/test_app/public/500.html new file mode 100644 index 0000000..b80307f --- /dev/null +++ b/spec/test_app/public/500.html @@ -0,0 +1,26 @@ + + + + We're sorry, but something went wrong (500) + + + + + +
+

We're sorry, but something went wrong.

+

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

+
+ + diff --git a/spec/test_app/public/favicon.ico b/spec/test_app/public/favicon.ico new file mode 100644 index 0000000..e69de29 diff --git a/spec/test_app/public/images/add-to-cart.png b/spec/test_app/public/images/add-to-cart.png new file mode 100644 index 0000000..4cccc77 Binary files /dev/null and b/spec/test_app/public/images/add-to-cart.png differ diff --git a/spec/test_app/public/images/admin/bg/active-tab.png b/spec/test_app/public/images/admin/bg/active-tab.png new file mode 100644 index 0000000..8024634 Binary files /dev/null and b/spec/test_app/public/images/admin/bg/active-tab.png differ diff --git a/spec/test_app/public/images/admin/bg/admin_tab_back.png b/spec/test_app/public/images/admin/bg/admin_tab_back.png new file mode 100644 index 0000000..143bc52 Binary files /dev/null and b/spec/test_app/public/images/admin/bg/admin_tab_back.png differ diff --git a/spec/test_app/public/images/admin/bg/admin_tab_selected_back.png b/spec/test_app/public/images/admin/bg/admin_tab_selected_back.png new file mode 100644 index 0000000..ed63dc2 Binary files /dev/null and b/spec/test_app/public/images/admin/bg/admin_tab_selected_back.png differ diff --git a/spec/test_app/public/images/admin/bg/content-back-blue.png b/spec/test_app/public/images/admin/bg/content-back-blue.png new file mode 100644 index 0000000..140aa48 Binary files /dev/null and b/spec/test_app/public/images/admin/bg/content-back-blue.png differ diff --git a/spec/test_app/public/images/admin/bg/content-back-green.png b/spec/test_app/public/images/admin/bg/content-back-green.png new file mode 100644 index 0000000..394070f Binary files /dev/null and b/spec/test_app/public/images/admin/bg/content-back-green.png differ diff --git a/spec/test_app/public/images/admin/bg/content-back.png b/spec/test_app/public/images/admin/bg/content-back.png new file mode 100644 index 0000000..eb44ace Binary files /dev/null and b/spec/test_app/public/images/admin/bg/content-back.png differ diff --git a/spec/test_app/public/images/admin/bg/flash-error.png b/spec/test_app/public/images/admin/bg/flash-error.png new file mode 100644 index 0000000..486cdc4 Binary files /dev/null and b/spec/test_app/public/images/admin/bg/flash-error.png differ diff --git a/spec/test_app/public/images/admin/bg/flash-notice.png b/spec/test_app/public/images/admin/bg/flash-notice.png new file mode 100644 index 0000000..729fb38 Binary files /dev/null and b/spec/test_app/public/images/admin/bg/flash-notice.png differ diff --git a/spec/test_app/public/images/admin/bg/green-stripes.gif b/spec/test_app/public/images/admin/bg/green-stripes.gif new file mode 100644 index 0000000..7efafcf Binary files /dev/null and b/spec/test_app/public/images/admin/bg/green-stripes.gif differ diff --git a/spec/test_app/public/images/admin/bg/green-stripes.png b/spec/test_app/public/images/admin/bg/green-stripes.png new file mode 100644 index 0000000..6459eb6 Binary files /dev/null and b/spec/test_app/public/images/admin/bg/green-stripes.png differ diff --git a/spec/test_app/public/images/admin/bg/grid_header_back.png b/spec/test_app/public/images/admin/bg/grid_header_back.png new file mode 100644 index 0000000..a3774a0 Binary files /dev/null and b/spec/test_app/public/images/admin/bg/grid_header_back.png differ diff --git a/spec/test_app/public/images/admin/bg/grid_header_back_green.png b/spec/test_app/public/images/admin/bg/grid_header_back_green.png new file mode 100644 index 0000000..51694de Binary files /dev/null and b/spec/test_app/public/images/admin/bg/grid_header_back_green.png differ diff --git a/spec/test_app/public/images/admin/bg/header-bg.png b/spec/test_app/public/images/admin/bg/header-bg.png new file mode 100644 index 0000000..2b70cbb Binary files /dev/null and b/spec/test_app/public/images/admin/bg/header-bg.png differ diff --git a/spec/test_app/public/images/admin/bg/header.png b/spec/test_app/public/images/admin/bg/header.png new file mode 100644 index 0000000..5eba367 Binary files /dev/null and b/spec/test_app/public/images/admin/bg/header.png differ diff --git a/spec/test_app/public/images/admin/bg/header_bg.jpg b/spec/test_app/public/images/admin/bg/header_bg.jpg new file mode 100755 index 0000000..fdb3073 Binary files /dev/null and b/spec/test_app/public/images/admin/bg/header_bg.jpg differ diff --git a/spec/test_app/public/images/admin/bg/menu-current.png b/spec/test_app/public/images/admin/bg/menu-current.png new file mode 100644 index 0000000..5ad3169 Binary files /dev/null and b/spec/test_app/public/images/admin/bg/menu-current.png differ diff --git a/spec/test_app/public/images/admin/bg/red-stripes.gif b/spec/test_app/public/images/admin/bg/red-stripes.gif new file mode 100644 index 0000000..9658243 Binary files /dev/null and b/spec/test_app/public/images/admin/bg/red-stripes.gif differ diff --git a/spec/test_app/public/images/admin/bg/red-stripes.png b/spec/test_app/public/images/admin/bg/red-stripes.png new file mode 100644 index 0000000..aab5cfc Binary files /dev/null and b/spec/test_app/public/images/admin/bg/red-stripes.png differ diff --git a/spec/test_app/public/images/admin/bg/spree_50.png b/spec/test_app/public/images/admin/bg/spree_50.png new file mode 100644 index 0000000..8d1ade4 Binary files /dev/null and b/spec/test_app/public/images/admin/bg/spree_50.png differ diff --git a/spec/test_app/public/images/admin/bg/subnav-divider.png b/spec/test_app/public/images/admin/bg/subnav-divider.png new file mode 100644 index 0000000..79014f4 Binary files /dev/null and b/spec/test_app/public/images/admin/bg/subnav-divider.png differ diff --git a/spec/test_app/public/images/admin/bg/subnav.png b/spec/test_app/public/images/admin/bg/subnav.png new file mode 100644 index 0000000..f686445 Binary files /dev/null and b/spec/test_app/public/images/admin/bg/subnav.png differ diff --git a/spec/test_app/public/images/admin/bg/tab-back.png b/spec/test_app/public/images/admin/bg/tab-back.png new file mode 100644 index 0000000..bd859aa Binary files /dev/null and b/spec/test_app/public/images/admin/bg/tab-back.png differ diff --git a/spec/test_app/public/images/admin/buttons/blue/left_01.png b/spec/test_app/public/images/admin/buttons/blue/left_01.png new file mode 100644 index 0000000..07d494e Binary files /dev/null and b/spec/test_app/public/images/admin/buttons/blue/left_01.png differ diff --git a/spec/test_app/public/images/admin/buttons/blue/right_01.png b/spec/test_app/public/images/admin/buttons/blue/right_01.png new file mode 100644 index 0000000..f49cd29 Binary files /dev/null and b/spec/test_app/public/images/admin/buttons/blue/right_01.png differ diff --git a/spec/test_app/public/images/admin/buttons/drag-handle-green.png b/spec/test_app/public/images/admin/buttons/drag-handle-green.png new file mode 100644 index 0000000..43f2d55 Binary files /dev/null and b/spec/test_app/public/images/admin/buttons/drag-handle-green.png differ diff --git a/spec/test_app/public/images/admin/buttons/green/left_01.png b/spec/test_app/public/images/admin/buttons/green/left_01.png new file mode 100644 index 0000000..c23c722 Binary files /dev/null and b/spec/test_app/public/images/admin/buttons/green/left_01.png differ diff --git a/spec/test_app/public/images/admin/buttons/green/right_01.png b/spec/test_app/public/images/admin/buttons/green/right_01.png new file mode 100644 index 0000000..7faa92f Binary files /dev/null and b/spec/test_app/public/images/admin/buttons/green/right_01.png differ diff --git a/spec/test_app/public/images/admin/buttons/left_01.png b/spec/test_app/public/images/admin/buttons/left_01.png new file mode 100644 index 0000000..ae846e4 Binary files /dev/null and b/spec/test_app/public/images/admin/buttons/left_01.png differ diff --git a/spec/test_app/public/images/admin/buttons/left_01_small.png b/spec/test_app/public/images/admin/buttons/left_01_small.png new file mode 100644 index 0000000..d294f31 Binary files /dev/null and b/spec/test_app/public/images/admin/buttons/left_01_small.png differ diff --git a/spec/test_app/public/images/admin/buttons/orange/left_03.png b/spec/test_app/public/images/admin/buttons/orange/left_03.png new file mode 100644 index 0000000..c9bb3a6 Binary files /dev/null and b/spec/test_app/public/images/admin/buttons/orange/left_03.png differ diff --git a/spec/test_app/public/images/admin/buttons/orange/right_03.png b/spec/test_app/public/images/admin/buttons/orange/right_03.png new file mode 100644 index 0000000..7559031 Binary files /dev/null and b/spec/test_app/public/images/admin/buttons/orange/right_03.png differ diff --git a/spec/test_app/public/images/admin/buttons/right_01.png b/spec/test_app/public/images/admin/buttons/right_01.png new file mode 100644 index 0000000..6593e13 Binary files /dev/null and b/spec/test_app/public/images/admin/buttons/right_01.png differ diff --git a/spec/test_app/public/images/admin/buttons/right_01_small.png b/spec/test_app/public/images/admin/buttons/right_01_small.png new file mode 100644 index 0000000..7801efa Binary files /dev/null and b/spec/test_app/public/images/admin/buttons/right_01_small.png differ diff --git a/spec/test_app/public/images/admin/icons/16x16/1.png b/spec/test_app/public/images/admin/icons/16x16/1.png new file mode 100644 index 0000000..c67d6f1 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/16x16/1.png differ diff --git a/spec/test_app/public/images/admin/icons/16x16/10.png b/spec/test_app/public/images/admin/icons/16x16/10.png new file mode 100644 index 0000000..0634e58 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/16x16/10.png differ diff --git a/spec/test_app/public/images/admin/icons/16x16/2.png b/spec/test_app/public/images/admin/icons/16x16/2.png new file mode 100644 index 0000000..c88cbcd Binary files /dev/null and b/spec/test_app/public/images/admin/icons/16x16/2.png differ diff --git a/spec/test_app/public/images/admin/icons/16x16/3.png b/spec/test_app/public/images/admin/icons/16x16/3.png new file mode 100644 index 0000000..b2b8ee1 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/16x16/3.png differ diff --git a/spec/test_app/public/images/admin/icons/16x16/4.png b/spec/test_app/public/images/admin/icons/16x16/4.png new file mode 100644 index 0000000..6024879 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/16x16/4.png differ diff --git a/spec/test_app/public/images/admin/icons/16x16/5.png b/spec/test_app/public/images/admin/icons/16x16/5.png new file mode 100644 index 0000000..fe88298 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/16x16/5.png differ diff --git a/spec/test_app/public/images/admin/icons/16x16/6.png b/spec/test_app/public/images/admin/icons/16x16/6.png new file mode 100644 index 0000000..0976c6b Binary files /dev/null and b/spec/test_app/public/images/admin/icons/16x16/6.png differ diff --git a/spec/test_app/public/images/admin/icons/16x16/7.png b/spec/test_app/public/images/admin/icons/16x16/7.png new file mode 100644 index 0000000..557dcd6 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/16x16/7.png differ diff --git a/spec/test_app/public/images/admin/icons/16x16/8.png b/spec/test_app/public/images/admin/icons/16x16/8.png new file mode 100644 index 0000000..4b7f308 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/16x16/8.png differ diff --git a/spec/test_app/public/images/admin/icons/16x16/9.png b/spec/test_app/public/images/admin/icons/16x16/9.png new file mode 100644 index 0000000..2e4e494 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/16x16/9.png differ diff --git a/spec/test_app/public/images/admin/icons/32x32/1.png b/spec/test_app/public/images/admin/icons/32x32/1.png new file mode 100644 index 0000000..f5a30f0 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/32x32/1.png differ diff --git a/spec/test_app/public/images/admin/icons/32x32/10.png b/spec/test_app/public/images/admin/icons/32x32/10.png new file mode 100644 index 0000000..0cd609a Binary files /dev/null and b/spec/test_app/public/images/admin/icons/32x32/10.png differ diff --git a/spec/test_app/public/images/admin/icons/32x32/11.png b/spec/test_app/public/images/admin/icons/32x32/11.png new file mode 100644 index 0000000..39d6e64 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/32x32/11.png differ diff --git a/spec/test_app/public/images/admin/icons/32x32/2.png b/spec/test_app/public/images/admin/icons/32x32/2.png new file mode 100644 index 0000000..9c6459c Binary files /dev/null and b/spec/test_app/public/images/admin/icons/32x32/2.png differ diff --git a/spec/test_app/public/images/admin/icons/32x32/3.png b/spec/test_app/public/images/admin/icons/32x32/3.png new file mode 100644 index 0000000..9dc32eb Binary files /dev/null and b/spec/test_app/public/images/admin/icons/32x32/3.png differ diff --git a/spec/test_app/public/images/admin/icons/32x32/4.png b/spec/test_app/public/images/admin/icons/32x32/4.png new file mode 100644 index 0000000..dcdc539 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/32x32/4.png differ diff --git a/spec/test_app/public/images/admin/icons/32x32/5.png b/spec/test_app/public/images/admin/icons/32x32/5.png new file mode 100644 index 0000000..a3a165d Binary files /dev/null and b/spec/test_app/public/images/admin/icons/32x32/5.png differ diff --git a/spec/test_app/public/images/admin/icons/32x32/6.png b/spec/test_app/public/images/admin/icons/32x32/6.png new file mode 100644 index 0000000..06b22dd Binary files /dev/null and b/spec/test_app/public/images/admin/icons/32x32/6.png differ diff --git a/spec/test_app/public/images/admin/icons/32x32/7.png b/spec/test_app/public/images/admin/icons/32x32/7.png new file mode 100644 index 0000000..7b37fef Binary files /dev/null and b/spec/test_app/public/images/admin/icons/32x32/7.png differ diff --git a/spec/test_app/public/images/admin/icons/32x32/8.png b/spec/test_app/public/images/admin/icons/32x32/8.png new file mode 100644 index 0000000..2dced96 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/32x32/8.png differ diff --git a/spec/test_app/public/images/admin/icons/32x32/9.png b/spec/test_app/public/images/admin/icons/32x32/9.png new file mode 100644 index 0000000..c16ccfd Binary files /dev/null and b/spec/test_app/public/images/admin/icons/32x32/9.png differ diff --git a/spec/test_app/public/images/admin/icons/accept.png b/spec/test_app/public/images/admin/icons/accept.png new file mode 100755 index 0000000..89c8129 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/accept.png differ diff --git a/spec/test_app/public/images/admin/icons/add.gif b/spec/test_app/public/images/admin/icons/add.gif new file mode 100644 index 0000000..ee70e1a Binary files /dev/null and b/spec/test_app/public/images/admin/icons/add.gif differ diff --git a/spec/test_app/public/images/admin/icons/add.png b/spec/test_app/public/images/admin/icons/add.png new file mode 100755 index 0000000..6332fef Binary files /dev/null and b/spec/test_app/public/images/admin/icons/add.png differ diff --git a/spec/test_app/public/images/admin/icons/arrow-down.gif b/spec/test_app/public/images/admin/icons/arrow-down.gif new file mode 100644 index 0000000..a967b9f Binary files /dev/null and b/spec/test_app/public/images/admin/icons/arrow-down.gif differ diff --git a/spec/test_app/public/images/admin/icons/cross.png b/spec/test_app/public/images/admin/icons/cross.png new file mode 100755 index 0000000..1514d51 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/cross.png differ diff --git a/spec/test_app/public/images/admin/icons/delete.gif b/spec/test_app/public/images/admin/icons/delete.gif new file mode 100644 index 0000000..72523e3 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/delete.gif differ diff --git a/spec/test_app/public/images/admin/icons/delete.png b/spec/test_app/public/images/admin/icons/delete.png new file mode 100755 index 0000000..1514d51 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/delete.png differ diff --git a/spec/test_app/public/images/admin/icons/drag.gif b/spec/test_app/public/images/admin/icons/drag.gif new file mode 100644 index 0000000..77e8a4d Binary files /dev/null and b/spec/test_app/public/images/admin/icons/drag.gif differ diff --git a/spec/test_app/public/images/admin/icons/edit.gif b/spec/test_app/public/images/admin/icons/edit.gif new file mode 100644 index 0000000..e1b9afd Binary files /dev/null and b/spec/test_app/public/images/admin/icons/edit.gif differ diff --git a/spec/test_app/public/images/admin/icons/edit.png b/spec/test_app/public/images/admin/icons/edit.png new file mode 100755 index 0000000..0bfecd5 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/edit.png differ diff --git a/spec/test_app/public/images/admin/icons/email.png b/spec/test_app/public/images/admin/icons/email.png new file mode 100755 index 0000000..7348aed Binary files /dev/null and b/spec/test_app/public/images/admin/icons/email.png differ diff --git a/spec/test_app/public/images/admin/icons/error.png b/spec/test_app/public/images/admin/icons/error.png new file mode 100755 index 0000000..628cf2d Binary files /dev/null and b/spec/test_app/public/images/admin/icons/error.png differ diff --git a/spec/test_app/public/images/admin/icons/exclamation.png b/spec/test_app/public/images/admin/icons/exclamation.png new file mode 100755 index 0000000..c37bd06 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/exclamation.png differ diff --git a/spec/test_app/public/images/admin/icons/feed.png b/spec/test_app/public/images/admin/icons/feed.png new file mode 100755 index 0000000..315c4f4 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/feed.png differ diff --git a/spec/test_app/public/images/admin/icons/pdf.png b/spec/test_app/public/images/admin/icons/pdf.png new file mode 100755 index 0000000..8f8095e Binary files /dev/null and b/spec/test_app/public/images/admin/icons/pdf.png differ diff --git a/spec/test_app/public/images/admin/icons/reorder.gif b/spec/test_app/public/images/admin/icons/reorder.gif new file mode 100644 index 0000000..1cbd306 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/reorder.gif differ diff --git a/spec/test_app/public/images/admin/icons/search.gif b/spec/test_app/public/images/admin/icons/search.gif new file mode 100644 index 0000000..6d5f4c7 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/search.gif differ diff --git a/spec/test_app/public/images/admin/icons/send-email.png b/spec/test_app/public/images/admin/icons/send-email.png new file mode 100755 index 0000000..4a6c5d3 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/send-email.png differ diff --git a/spec/test_app/public/images/admin/icons/stop.png b/spec/test_app/public/images/admin/icons/stop.png new file mode 100755 index 0000000..08f2493 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/stop.png differ diff --git a/spec/test_app/public/images/admin/icons/tick.png b/spec/test_app/public/images/admin/icons/tick.png new file mode 100755 index 0000000..a9925a0 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/tick.png differ diff --git a/spec/test_app/public/images/admin/icons/up.gif b/spec/test_app/public/images/admin/icons/up.gif new file mode 100644 index 0000000..3fe4851 Binary files /dev/null and b/spec/test_app/public/images/admin/icons/up.gif differ diff --git a/spec/test_app/public/images/admin/icons/xls.png b/spec/test_app/public/images/admin/icons/xls.png new file mode 100755 index 0000000..b977d7e Binary files /dev/null and b/spec/test_app/public/images/admin/icons/xls.png differ diff --git a/spec/test_app/public/images/admin/tabs/off-left.png b/spec/test_app/public/images/admin/tabs/off-left.png new file mode 100644 index 0000000..201e23c Binary files /dev/null and b/spec/test_app/public/images/admin/tabs/off-left.png differ diff --git a/spec/test_app/public/images/admin/tabs/off-right.png b/spec/test_app/public/images/admin/tabs/off-right.png new file mode 100644 index 0000000..d41182d Binary files /dev/null and b/spec/test_app/public/images/admin/tabs/off-right.png differ diff --git a/spec/test_app/public/images/admin/tabs/on-left.png b/spec/test_app/public/images/admin/tabs/on-left.png new file mode 100644 index 0000000..1e65102 Binary files /dev/null and b/spec/test_app/public/images/admin/tabs/on-left.png differ diff --git a/spec/test_app/public/images/admin/tabs/on-right.png b/spec/test_app/public/images/admin/tabs/on-right.png new file mode 100644 index 0000000..e178f27 Binary files /dev/null and b/spec/test_app/public/images/admin/tabs/on-right.png differ diff --git a/spec/test_app/public/images/ajax_loader.gif b/spec/test_app/public/images/ajax_loader.gif new file mode 100644 index 0000000..d42f72c Binary files /dev/null and b/spec/test_app/public/images/ajax_loader.gif differ diff --git a/spec/test_app/public/images/amex_cid.gif b/spec/test_app/public/images/amex_cid.gif new file mode 100644 index 0000000..13d91de Binary files /dev/null and b/spec/test_app/public/images/amex_cid.gif differ diff --git a/spec/test_app/public/images/bg-button-hover.png b/spec/test_app/public/images/bg-button-hover.png new file mode 100644 index 0000000..82457c0 Binary files /dev/null and b/spec/test_app/public/images/bg-button-hover.png differ diff --git a/spec/test_app/public/images/bg-button-pressed.png b/spec/test_app/public/images/bg-button-pressed.png new file mode 100644 index 0000000..c6c7e8f Binary files /dev/null and b/spec/test_app/public/images/bg-button-pressed.png differ diff --git a/spec/test_app/public/images/bg-button.gif b/spec/test_app/public/images/bg-button.gif new file mode 100755 index 0000000..4cdb876 Binary files /dev/null and b/spec/test_app/public/images/bg-button.gif differ diff --git a/spec/test_app/public/images/bg-button.png b/spec/test_app/public/images/bg-button.png new file mode 100644 index 0000000..83183d3 Binary files /dev/null and b/spec/test_app/public/images/bg-button.png differ diff --git a/spec/test_app/public/images/blue/left_01.png b/spec/test_app/public/images/blue/left_01.png new file mode 100755 index 0000000..07d494e Binary files /dev/null and b/spec/test_app/public/images/blue/left_01.png differ diff --git a/spec/test_app/public/images/blue/right_01.png b/spec/test_app/public/images/blue/right_01.png new file mode 100755 index 0000000..f49cd29 Binary files /dev/null and b/spec/test_app/public/images/blue/right_01.png differ diff --git a/spec/test_app/public/images/body-back.png b/spec/test_app/public/images/body-back.png new file mode 100644 index 0000000..f1bf777 Binary files /dev/null and b/spec/test_app/public/images/body-back.png differ diff --git a/spec/test_app/public/images/bottom_shine.png b/spec/test_app/public/images/bottom_shine.png new file mode 100755 index 0000000..160a8cb Binary files /dev/null and b/spec/test_app/public/images/bottom_shine.png differ diff --git a/spec/test_app/public/images/breadcrumb.gif b/spec/test_app/public/images/breadcrumb.gif new file mode 100644 index 0000000..0364808 Binary files /dev/null and b/spec/test_app/public/images/breadcrumb.gif differ diff --git a/spec/test_app/public/images/button-dark-hover.png b/spec/test_app/public/images/button-dark-hover.png new file mode 100644 index 0000000..5d3e6fb Binary files /dev/null and b/spec/test_app/public/images/button-dark-hover.png differ diff --git a/spec/test_app/public/images/button-dark.png b/spec/test_app/public/images/button-dark.png new file mode 100644 index 0000000..92b60e8 Binary files /dev/null and b/spec/test_app/public/images/button-dark.png differ diff --git a/spec/test_app/public/images/buttons/bg-button-hover.png b/spec/test_app/public/images/buttons/bg-button-hover.png new file mode 100644 index 0000000..82457c0 Binary files /dev/null and b/spec/test_app/public/images/buttons/bg-button-hover.png differ diff --git a/spec/test_app/public/images/buttons/bg-button-pressed.png b/spec/test_app/public/images/buttons/bg-button-pressed.png new file mode 100644 index 0000000..c6c7e8f Binary files /dev/null and b/spec/test_app/public/images/buttons/bg-button-pressed.png differ diff --git a/spec/test_app/public/images/buttons/bg-button.gif b/spec/test_app/public/images/buttons/bg-button.gif new file mode 100755 index 0000000..4cdb876 Binary files /dev/null and b/spec/test_app/public/images/buttons/bg-button.gif differ diff --git a/spec/test_app/public/images/buttons/bg-button.png b/spec/test_app/public/images/buttons/bg-button.png new file mode 100644 index 0000000..83183d3 Binary files /dev/null and b/spec/test_app/public/images/buttons/bg-button.png differ diff --git a/spec/test_app/public/images/buttons/blue/left_01.png b/spec/test_app/public/images/buttons/blue/left_01.png new file mode 100755 index 0000000..07d494e Binary files /dev/null and b/spec/test_app/public/images/buttons/blue/left_01.png differ diff --git a/spec/test_app/public/images/buttons/blue/right_01.png b/spec/test_app/public/images/buttons/blue/right_01.png new file mode 100755 index 0000000..f49cd29 Binary files /dev/null and b/spec/test_app/public/images/buttons/blue/right_01.png differ diff --git a/spec/test_app/public/images/buttons/button-dark-hover.png b/spec/test_app/public/images/buttons/button-dark-hover.png new file mode 100644 index 0000000..5d3e6fb Binary files /dev/null and b/spec/test_app/public/images/buttons/button-dark-hover.png differ diff --git a/spec/test_app/public/images/buttons/button-dark.png b/spec/test_app/public/images/buttons/button-dark.png new file mode 100644 index 0000000..92b60e8 Binary files /dev/null and b/spec/test_app/public/images/buttons/button-dark.png differ diff --git a/spec/test_app/public/images/buttons/drag-handle-green.png b/spec/test_app/public/images/buttons/drag-handle-green.png new file mode 100755 index 0000000..43f2d55 Binary files /dev/null and b/spec/test_app/public/images/buttons/drag-handle-green.png differ diff --git a/spec/test_app/public/images/buttons/green/left_01.png b/spec/test_app/public/images/buttons/green/left_01.png new file mode 100755 index 0000000..c23c722 Binary files /dev/null and b/spec/test_app/public/images/buttons/green/left_01.png differ diff --git a/spec/test_app/public/images/buttons/green/right_01.png b/spec/test_app/public/images/buttons/green/right_01.png new file mode 100755 index 0000000..7faa92f Binary files /dev/null and b/spec/test_app/public/images/buttons/green/right_01.png differ diff --git a/spec/test_app/public/images/buttons/left_01.png b/spec/test_app/public/images/buttons/left_01.png new file mode 100755 index 0000000..ae846e4 Binary files /dev/null and b/spec/test_app/public/images/buttons/left_01.png differ diff --git a/spec/test_app/public/images/buttons/left_01_small.png b/spec/test_app/public/images/buttons/left_01_small.png new file mode 100755 index 0000000..cb1363f Binary files /dev/null and b/spec/test_app/public/images/buttons/left_01_small.png differ diff --git a/spec/test_app/public/images/buttons/orange/left_03.png b/spec/test_app/public/images/buttons/orange/left_03.png new file mode 100755 index 0000000..c9bb3a6 Binary files /dev/null and b/spec/test_app/public/images/buttons/orange/left_03.png differ diff --git a/spec/test_app/public/images/buttons/orange/right_03.png b/spec/test_app/public/images/buttons/orange/right_03.png new file mode 100755 index 0000000..7559031 Binary files /dev/null and b/spec/test_app/public/images/buttons/orange/right_03.png differ diff --git a/spec/test_app/public/images/buttons/right_01.png b/spec/test_app/public/images/buttons/right_01.png new file mode 100755 index 0000000..6593e13 Binary files /dev/null and b/spec/test_app/public/images/buttons/right_01.png differ diff --git a/spec/test_app/public/images/buttons/right_01_small.png b/spec/test_app/public/images/buttons/right_01_small.png new file mode 100755 index 0000000..91196ba Binary files /dev/null and b/spec/test_app/public/images/buttons/right_01_small.png differ diff --git a/spec/test_app/public/images/buttons/sxsw-ribbon-v1.png b/spec/test_app/public/images/buttons/sxsw-ribbon-v1.png new file mode 100644 index 0000000..03fcbf2 Binary files /dev/null and b/spec/test_app/public/images/buttons/sxsw-ribbon-v1.png differ diff --git a/spec/test_app/public/images/buttons/top-shine.png b/spec/test_app/public/images/buttons/top-shine.png new file mode 100644 index 0000000..7617808 Binary files /dev/null and b/spec/test_app/public/images/buttons/top-shine.png differ diff --git a/spec/test_app/public/images/calendar_date_select/calendar.gif b/spec/test_app/public/images/calendar_date_select/calendar.gif new file mode 100644 index 0000000..6b7b7ca Binary files /dev/null and b/spec/test_app/public/images/calendar_date_select/calendar.gif differ diff --git a/spec/test_app/public/images/cart-empty.png b/spec/test_app/public/images/cart-empty.png new file mode 100644 index 0000000..df1a37a Binary files /dev/null and b/spec/test_app/public/images/cart-empty.png differ diff --git a/spec/test_app/public/images/cart-empty_x32.png b/spec/test_app/public/images/cart-empty_x32.png new file mode 100644 index 0000000..0f2b511 Binary files /dev/null and b/spec/test_app/public/images/cart-empty_x32.png differ diff --git a/spec/test_app/public/images/cart-full.png b/spec/test_app/public/images/cart-full.png new file mode 100644 index 0000000..6d9f2dc Binary files /dev/null and b/spec/test_app/public/images/cart-full.png differ diff --git a/spec/test_app/public/images/cart-full_x32.png b/spec/test_app/public/images/cart-full_x32.png new file mode 100644 index 0000000..8b038bc Binary files /dev/null and b/spec/test_app/public/images/cart-full_x32.png differ diff --git a/spec/test_app/public/images/checkout.png b/spec/test_app/public/images/checkout.png new file mode 100644 index 0000000..41dcb70 Binary files /dev/null and b/spec/test_app/public/images/checkout.png differ diff --git a/spec/test_app/public/images/creditcard.gif b/spec/test_app/public/images/creditcard.gif new file mode 100644 index 0000000..5c0ec44 Binary files /dev/null and b/spec/test_app/public/images/creditcard.gif differ diff --git a/spec/test_app/public/images/datepicker/backstripes.gif b/spec/test_app/public/images/datepicker/backstripes.gif new file mode 100644 index 0000000..63f1403 Binary files /dev/null and b/spec/test_app/public/images/datepicker/backstripes.gif differ diff --git a/spec/test_app/public/images/datepicker/bg_header.jpg b/spec/test_app/public/images/datepicker/bg_header.jpg new file mode 100644 index 0000000..10dbd74 Binary files /dev/null and b/spec/test_app/public/images/datepicker/bg_header.jpg differ diff --git a/spec/test_app/public/images/datepicker/bullet1.gif b/spec/test_app/public/images/datepicker/bullet1.gif new file mode 100644 index 0000000..ae352c2 Binary files /dev/null and b/spec/test_app/public/images/datepicker/bullet1.gif differ diff --git a/spec/test_app/public/images/datepicker/bullet2.gif b/spec/test_app/public/images/datepicker/bullet2.gif new file mode 100644 index 0000000..04b293d Binary files /dev/null and b/spec/test_app/public/images/datepicker/bullet2.gif differ diff --git a/spec/test_app/public/images/datepicker/cal.gif b/spec/test_app/public/images/datepicker/cal.gif new file mode 100644 index 0000000..8526cf5 Binary files /dev/null and b/spec/test_app/public/images/datepicker/cal.gif differ diff --git a/spec/test_app/public/images/datepicker/gradient-e5e5e5-ffffff.gif b/spec/test_app/public/images/datepicker/gradient-e5e5e5-ffffff.gif new file mode 100644 index 0000000..72a0d3e Binary files /dev/null and b/spec/test_app/public/images/datepicker/gradient-e5e5e5-ffffff.gif differ diff --git a/spec/test_app/public/images/discover_cid.gif b/spec/test_app/public/images/discover_cid.gif new file mode 100644 index 0000000..097c75b Binary files /dev/null and b/spec/test_app/public/images/discover_cid.gif differ diff --git a/spec/test_app/public/images/drag-handle-green.png b/spec/test_app/public/images/drag-handle-green.png new file mode 100755 index 0000000..43f2d55 Binary files /dev/null and b/spec/test_app/public/images/drag-handle-green.png differ diff --git a/spec/test_app/public/images/favicon.ico b/spec/test_app/public/images/favicon.ico new file mode 100644 index 0000000..b5b89e3 Binary files /dev/null and b/spec/test_app/public/images/favicon.ico differ diff --git a/spec/test_app/public/images/green/left_01.png b/spec/test_app/public/images/green/left_01.png new file mode 100755 index 0000000..c23c722 Binary files /dev/null and b/spec/test_app/public/images/green/left_01.png differ diff --git a/spec/test_app/public/images/green/right_01.png b/spec/test_app/public/images/green/right_01.png new file mode 100755 index 0000000..7faa92f Binary files /dev/null and b/spec/test_app/public/images/green/right_01.png differ diff --git a/spec/test_app/public/images/grid.png b/spec/test_app/public/images/grid.png new file mode 100644 index 0000000..129d4a2 Binary files /dev/null and b/spec/test_app/public/images/grid.png differ diff --git a/spec/test_app/public/images/left_01.png b/spec/test_app/public/images/left_01.png new file mode 100755 index 0000000..ae846e4 Binary files /dev/null and b/spec/test_app/public/images/left_01.png differ diff --git a/spec/test_app/public/images/left_01_small.png b/spec/test_app/public/images/left_01_small.png new file mode 100755 index 0000000..cb1363f Binary files /dev/null and b/spec/test_app/public/images/left_01_small.png differ diff --git a/spec/test_app/public/images/master_cid.jpg b/spec/test_app/public/images/master_cid.jpg new file mode 100644 index 0000000..b6b77e7 Binary files /dev/null and b/spec/test_app/public/images/master_cid.jpg differ diff --git a/spec/test_app/public/images/menu-current.png b/spec/test_app/public/images/menu-current.png new file mode 100644 index 0000000..9b73247 Binary files /dev/null and b/spec/test_app/public/images/menu-current.png differ diff --git a/spec/test_app/public/images/menu-hover.png b/spec/test_app/public/images/menu-hover.png new file mode 100644 index 0000000..f061455 Binary files /dev/null and b/spec/test_app/public/images/menu-hover.png differ diff --git a/spec/test_app/public/images/noimage/mini.jpg b/spec/test_app/public/images/noimage/mini.jpg new file mode 100644 index 0000000..3538aa6 Binary files /dev/null and b/spec/test_app/public/images/noimage/mini.jpg differ diff --git a/spec/test_app/public/images/noimage/product.jpg b/spec/test_app/public/images/noimage/product.jpg new file mode 100644 index 0000000..76b2d41 Binary files /dev/null and b/spec/test_app/public/images/noimage/product.jpg differ diff --git a/spec/test_app/public/images/noimage/small.jpg b/spec/test_app/public/images/noimage/small.jpg new file mode 100644 index 0000000..b636e84 Binary files /dev/null and b/spec/test_app/public/images/noimage/small.jpg differ diff --git a/spec/test_app/public/images/openid-inputicon.gif b/spec/test_app/public/images/openid-inputicon.gif new file mode 100644 index 0000000..cde836c Binary files /dev/null and b/spec/test_app/public/images/openid-inputicon.gif differ diff --git a/spec/test_app/public/images/orange/left_03.png b/spec/test_app/public/images/orange/left_03.png new file mode 100755 index 0000000..c9bb3a6 Binary files /dev/null and b/spec/test_app/public/images/orange/left_03.png differ diff --git a/spec/test_app/public/images/orange/right_03.png b/spec/test_app/public/images/orange/right_03.png new file mode 100755 index 0000000..7559031 Binary files /dev/null and b/spec/test_app/public/images/orange/right_03.png differ diff --git a/spec/test_app/public/images/progress.gif b/spec/test_app/public/images/progress.gif new file mode 100644 index 0000000..e0deaaa Binary files /dev/null and b/spec/test_app/public/images/progress.gif differ diff --git a/spec/test_app/public/images/right_01.png b/spec/test_app/public/images/right_01.png new file mode 100755 index 0000000..6593e13 Binary files /dev/null and b/spec/test_app/public/images/right_01.png differ diff --git a/spec/test_app/public/images/right_01_small.png b/spec/test_app/public/images/right_01_small.png new file mode 100755 index 0000000..91196ba Binary files /dev/null and b/spec/test_app/public/images/right_01_small.png differ diff --git a/spec/test_app/public/images/separator.png b/spec/test_app/public/images/separator.png new file mode 100644 index 0000000..c137258 Binary files /dev/null and b/spec/test_app/public/images/separator.png differ diff --git a/spec/test_app/public/images/shadow-top.png b/spec/test_app/public/images/shadow-top.png new file mode 100644 index 0000000..0c1dd93 Binary files /dev/null and b/spec/test_app/public/images/shadow-top.png differ diff --git a/spec/test_app/public/images/shadow_top.png b/spec/test_app/public/images/shadow_top.png new file mode 100755 index 0000000..53fc5f5 Binary files /dev/null and b/spec/test_app/public/images/shadow_top.png differ diff --git a/spec/test_app/public/images/spinner.gif b/spec/test_app/public/images/spinner.gif new file mode 100644 index 0000000..274b4fd Binary files /dev/null and b/spec/test_app/public/images/spinner.gif differ diff --git a/spec/test_app/public/images/spree.jpg b/spec/test_app/public/images/spree.jpg new file mode 100644 index 0000000..237c19c Binary files /dev/null and b/spec/test_app/public/images/spree.jpg differ diff --git a/spec/test_app/public/images/spree/progress.gif b/spec/test_app/public/images/spree/progress.gif new file mode 100644 index 0000000..9cf90cf Binary files /dev/null and b/spec/test_app/public/images/spree/progress.gif differ diff --git a/spec/test_app/public/images/spree/spinner.gif b/spec/test_app/public/images/spree/spinner.gif new file mode 100644 index 0000000..e24bb17 Binary files /dev/null and b/spec/test_app/public/images/spree/spinner.gif differ diff --git a/spec/test_app/public/images/spree/spree.jpg b/spec/test_app/public/images/spree/spree.jpg new file mode 100644 index 0000000..237c19c Binary files /dev/null and b/spec/test_app/public/images/spree/spree.jpg differ diff --git a/spec/test_app/public/images/step-progress/completed-completed.gif b/spec/test_app/public/images/step-progress/completed-completed.gif new file mode 100644 index 0000000..6b1136e Binary files /dev/null and b/spec/test_app/public/images/step-progress/completed-completed.gif differ diff --git a/spec/test_app/public/images/step-progress/completed-current.gif b/spec/test_app/public/images/step-progress/completed-current.gif new file mode 100644 index 0000000..6a1ba68 Binary files /dev/null and b/spec/test_app/public/images/step-progress/completed-current.gif differ diff --git a/spec/test_app/public/images/step-progress/completed-first.gif b/spec/test_app/public/images/step-progress/completed-first.gif new file mode 100644 index 0000000..a43f825 Binary files /dev/null and b/spec/test_app/public/images/step-progress/completed-first.gif differ diff --git a/spec/test_app/public/images/step-progress/current-first.gif b/spec/test_app/public/images/step-progress/current-first.gif new file mode 100644 index 0000000..9aef49a Binary files /dev/null and b/spec/test_app/public/images/step-progress/current-first.gif differ diff --git a/spec/test_app/public/images/step-progress/current-incomplete.gif b/spec/test_app/public/images/step-progress/current-incomplete.gif new file mode 100644 index 0000000..0972228 Binary files /dev/null and b/spec/test_app/public/images/step-progress/current-incomplete.gif differ diff --git a/spec/test_app/public/images/step-progress/current-right.gif b/spec/test_app/public/images/step-progress/current-right.gif new file mode 100644 index 0000000..a2c652d Binary files /dev/null and b/spec/test_app/public/images/step-progress/current-right.gif differ diff --git a/spec/test_app/public/images/step-progress/incomplete-incomplete.gif b/spec/test_app/public/images/step-progress/incomplete-incomplete.gif new file mode 100644 index 0000000..9637b7f Binary files /dev/null and b/spec/test_app/public/images/step-progress/incomplete-incomplete.gif differ diff --git a/spec/test_app/public/images/step-progress/incomplete-right.gif b/spec/test_app/public/images/step-progress/incomplete-right.gif new file mode 100644 index 0000000..ae59e23 Binary files /dev/null and b/spec/test_app/public/images/step-progress/incomplete-right.gif differ diff --git a/spec/test_app/public/images/steps/1.png b/spec/test_app/public/images/steps/1.png new file mode 100644 index 0000000..f7cffbc Binary files /dev/null and b/spec/test_app/public/images/steps/1.png differ diff --git a/spec/test_app/public/images/steps/1_small.png b/spec/test_app/public/images/steps/1_small.png new file mode 100644 index 0000000..5543197 Binary files /dev/null and b/spec/test_app/public/images/steps/1_small.png differ diff --git a/spec/test_app/public/images/steps/2.png b/spec/test_app/public/images/steps/2.png new file mode 100644 index 0000000..a9fe83a Binary files /dev/null and b/spec/test_app/public/images/steps/2.png differ diff --git a/spec/test_app/public/images/steps/2_small.png b/spec/test_app/public/images/steps/2_small.png new file mode 100644 index 0000000..98674eb Binary files /dev/null and b/spec/test_app/public/images/steps/2_small.png differ diff --git a/spec/test_app/public/images/steps/3.png b/spec/test_app/public/images/steps/3.png new file mode 100644 index 0000000..e884e3e Binary files /dev/null and b/spec/test_app/public/images/steps/3.png differ diff --git a/spec/test_app/public/images/steps/3_small.png b/spec/test_app/public/images/steps/3_small.png new file mode 100644 index 0000000..45ca1f3 Binary files /dev/null and b/spec/test_app/public/images/steps/3_small.png differ diff --git a/spec/test_app/public/images/steps/4.png b/spec/test_app/public/images/steps/4.png new file mode 100644 index 0000000..3134b5e Binary files /dev/null and b/spec/test_app/public/images/steps/4.png differ diff --git a/spec/test_app/public/images/steps/4_small.png b/spec/test_app/public/images/steps/4_small.png new file mode 100644 index 0000000..fb582a9 Binary files /dev/null and b/spec/test_app/public/images/steps/4_small.png differ diff --git a/spec/test_app/public/images/steps/5.png b/spec/test_app/public/images/steps/5.png new file mode 100644 index 0000000..df211c2 Binary files /dev/null and b/spec/test_app/public/images/steps/5.png differ diff --git a/spec/test_app/public/images/steps/5_small.png b/spec/test_app/public/images/steps/5_small.png new file mode 100644 index 0000000..2c24d43 Binary files /dev/null and b/spec/test_app/public/images/steps/5_small.png differ diff --git a/spec/test_app/public/images/steps/6.png b/spec/test_app/public/images/steps/6.png new file mode 100644 index 0000000..8d5378c Binary files /dev/null and b/spec/test_app/public/images/steps/6.png differ diff --git a/spec/test_app/public/images/steps/6_small.png b/spec/test_app/public/images/steps/6_small.png new file mode 100644 index 0000000..e579440 Binary files /dev/null and b/spec/test_app/public/images/steps/6_small.png differ diff --git a/spec/test_app/public/images/sxsw-ribbon-v1.png b/spec/test_app/public/images/sxsw-ribbon-v1.png new file mode 100644 index 0000000..03fcbf2 Binary files /dev/null and b/spec/test_app/public/images/sxsw-ribbon-v1.png differ diff --git a/spec/test_app/public/images/tab_bottom.gif b/spec/test_app/public/images/tab_bottom.gif new file mode 100644 index 0000000..da70aaf Binary files /dev/null and b/spec/test_app/public/images/tab_bottom.gif differ diff --git a/spec/test_app/public/images/tile-header.png b/spec/test_app/public/images/tile-header.png new file mode 100644 index 0000000..8365cf3 Binary files /dev/null and b/spec/test_app/public/images/tile-header.png differ diff --git a/spec/test_app/public/images/tile-slider.png b/spec/test_app/public/images/tile-slider.png new file mode 100644 index 0000000..6ab3f95 Binary files /dev/null and b/spec/test_app/public/images/tile-slider.png differ diff --git a/spec/test_app/public/images/top-shine.png b/spec/test_app/public/images/top-shine.png new file mode 100644 index 0000000..7617808 Binary files /dev/null and b/spec/test_app/public/images/top-shine.png differ diff --git a/spec/test_app/public/images/tree-nav-icons/bullet.gif b/spec/test_app/public/images/tree-nav-icons/bullet.gif new file mode 100644 index 0000000..6305bae Binary files /dev/null and b/spec/test_app/public/images/tree-nav-icons/bullet.gif differ diff --git a/spec/test_app/public/images/tree-nav-icons/minus.gif b/spec/test_app/public/images/tree-nav-icons/minus.gif new file mode 100644 index 0000000..154e45a Binary files /dev/null and b/spec/test_app/public/images/tree-nav-icons/minus.gif differ diff --git a/spec/test_app/public/images/tree-nav-icons/plus.gif b/spec/test_app/public/images/tree-nav-icons/plus.gif new file mode 100644 index 0000000..93d2ade Binary files /dev/null and b/spec/test_app/public/images/tree-nav-icons/plus.gif differ diff --git a/spec/test_app/public/images/tree-nav-icons/treeview-loading.gif b/spec/test_app/public/images/tree-nav-icons/treeview-loading.gif new file mode 100644 index 0000000..0bbf3bc Binary files /dev/null and b/spec/test_app/public/images/tree-nav-icons/treeview-loading.gif differ diff --git a/spec/test_app/public/images/tree-nav-icons/treeview-sprite.gif b/spec/test_app/public/images/tree-nav-icons/treeview-sprite.gif new file mode 100644 index 0000000..a04eff6 Binary files /dev/null and b/spec/test_app/public/images/tree-nav-icons/treeview-sprite.gif differ diff --git a/spec/test_app/public/images/update.png b/spec/test_app/public/images/update.png new file mode 100644 index 0000000..4c5a58d Binary files /dev/null and b/spec/test_app/public/images/update.png differ diff --git a/spec/test_app/public/images/visa_cid.gif b/spec/test_app/public/images/visa_cid.gif new file mode 100644 index 0000000..2dc5403 Binary files /dev/null and b/spec/test_app/public/images/visa_cid.gif differ diff --git a/spec/test_app/public/images/wrapper-back-2.png b/spec/test_app/public/images/wrapper-back-2.png new file mode 100644 index 0000000..b2df535 Binary files /dev/null and b/spec/test_app/public/images/wrapper-back-2.png differ diff --git a/spec/test_app/public/images/wrapper-back.png b/spec/test_app/public/images/wrapper-back.png new file mode 100644 index 0000000..6006636 Binary files /dev/null and b/spec/test_app/public/images/wrapper-back.png differ diff --git a/spec/test_app/public/images/yui-menubaritem_submenuindicator.png b/spec/test_app/public/images/yui-menubaritem_submenuindicator.png new file mode 100644 index 0000000..030941c Binary files /dev/null and b/spec/test_app/public/images/yui-menubaritem_submenuindicator.png differ diff --git a/spec/test_app/public/images/yui-menubaritem_submenuindicator_disabled.png b/spec/test_app/public/images/yui-menubaritem_submenuindicator_disabled.png new file mode 100644 index 0000000..6c16122 Binary files /dev/null and b/spec/test_app/public/images/yui-menubaritem_submenuindicator_disabled.png differ diff --git a/spec/test_app/public/images/yui-menuitem_checkbox.png b/spec/test_app/public/images/yui-menuitem_checkbox.png new file mode 100644 index 0000000..1437a4f Binary files /dev/null and b/spec/test_app/public/images/yui-menuitem_checkbox.png differ diff --git a/spec/test_app/public/images/yui-menuitem_checkbox_disabled.png b/spec/test_app/public/images/yui-menuitem_checkbox_disabled.png new file mode 100644 index 0000000..5d5b998 Binary files /dev/null and b/spec/test_app/public/images/yui-menuitem_checkbox_disabled.png differ diff --git a/spec/test_app/public/images/yui-menuitem_submenuindicator.png b/spec/test_app/public/images/yui-menuitem_submenuindicator.png new file mode 100644 index 0000000..ea4f660 Binary files /dev/null and b/spec/test_app/public/images/yui-menuitem_submenuindicator.png differ diff --git a/spec/test_app/public/images/yui-menuitem_submenuindicator_disabled.png b/spec/test_app/public/images/yui-menuitem_submenuindicator_disabled.png new file mode 100644 index 0000000..427d60a Binary files /dev/null and b/spec/test_app/public/images/yui-menuitem_submenuindicator_disabled.png differ diff --git a/spec/test_app/public/images/yui-sprite.png b/spec/test_app/public/images/yui-sprite.png new file mode 100644 index 0000000..afd65e0 Binary files /dev/null and b/spec/test_app/public/images/yui-sprite.png differ diff --git a/spec/test_app/public/javascripts/additional-methods.js b/spec/test_app/public/javascripts/additional-methods.js new file mode 100644 index 0000000..49abf4c --- /dev/null +++ b/spec/test_app/public/javascripts/additional-methods.js @@ -0,0 +1,236 @@ +jQuery.validator.addMethod("maxWords", function(value, element, params) { + return this.optional(element) || value.match(/\b\w+\b/g).length < params; +}, jQuery.validator.format("Please enter {0} words or less.")); + +jQuery.validator.addMethod("minWords", function(value, element, params) { + return this.optional(element) || value.match(/\b\w+\b/g).length >= params; +}, jQuery.validator.format("Please enter at least {0} words.")); + +jQuery.validator.addMethod("rangeWords", function(value, element, params) { + return this.optional(element) || value.match(/\b\w+\b/g).length >= params[0] && value.match(/bw+b/g).length < params[1]; +}, jQuery.validator.format("Please enter between {0} and {1} words.")); + + +jQuery.validator.addMethod("letterswithbasicpunc", function(value, element) { + return this.optional(element) || /^[a-z-.,()'\"\s]+$/i.test(value); +}, "Letters or punctuation only please"); + +jQuery.validator.addMethod("alphanumeric", function(value, element) { + return this.optional(element) || /^\w+$/i.test(value); +}, "Letters, numbers, spaces or underscores only please"); + +jQuery.validator.addMethod("lettersonly", function(value, element) { + return this.optional(element) || /^[a-z]+$/i.test(value); +}, "Letters only please"); + +jQuery.validator.addMethod("nowhitespace", function(value, element) { + return this.optional(element) || /^\S+$/i.test(value); +}, "No white space please"); + +jQuery.validator.addMethod("ziprange", function(value, element) { + return this.optional(element) || /^90[2-5]\d\{2}-\d{4}$/.test(value); +}, "Your ZIP-code must be in the range 902xx-xxxx to 905-xx-xxxx"); + +/** +* Return true, if the value is a valid vehicle identification number (VIN). +* +* Works with all kind of text inputs. +* +* @example +* @desc Declares a required input element whose value must be a valid vehicle identification number. +* +* @name jQuery.validator.methods.vinUS +* @type Boolean +* @cat Plugins/Validate/Methods +*/ +jQuery.validator.addMethod( + "vinUS", + function(v){ + if (v.length != 17) + return false; + var i, n, d, f, cd, cdv; + var LL = ["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"]; + var VL = [1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9]; + var FL = [8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2]; + var rs = 0; + for(i = 0; i < 17; i++){ + f = FL[i]; + d = v.slice(i,i+1); + if(i == 8){ + cdv = d; + } + if(!isNaN(d)){ + d *= f; + } + else{ + for(n = 0; n < LL.length; n++){ + if(d.toUpperCase() === LL[n]){ + d = VL[n]; + d *= f; + if(isNaN(cdv) && n == 8){ + cdv = LL[n]; + } + break; + } + } + } + rs += d; + } + cd = rs % 11; + if(cd == 10){cd = "X";} + if(cd == cdv){return true;} + return false; + }, + "The specified vehicle identification number (VIN) is invalid." +); + +/** + * Return true, if the value is a valid date, also making this formal check dd/mm/yyyy. + * + * @example jQuery.validator.methods.date("01/01/1900") + * @result true + * + * @example jQuery.validator.methods.date("01/13/1990") + * @result false + * + * @example jQuery.validator.methods.date("01.01.1900") + * @result false + * + * @example + * @desc Declares an optional input element whose value must be a valid date. + * + * @name jQuery.validator.methods.dateITA + * @type Boolean + * @cat Plugins/Validate/Methods + */ +jQuery.validator.addMethod( + "dateITA", + function(value, element) { + var check = false; + var re = /^\d{1,2}\/\d{1,2}\/\d{4}$/ + if( re.test(value)){ + var adata = value.split('/'); + var gg = parseInt(adata[0],10); + var mm = parseInt(adata[1],10); + var aaaa = parseInt(adata[2],10); + var xdata = new Date(aaaa,mm-1,gg); + if ( ( xdata.getFullYear() == aaaa ) && ( xdata.getMonth () == mm - 1 ) && ( xdata.getDate() == gg ) ) + check = true; + else + check = false; + } else + check = false; + return this.optional(element) || check; + }, + "Please enter a correct date" +); + +jQuery.validator.addMethod("dateNL", function(value, element) { + return this.optional(element) || /^\d\d?[\.\/-]\d\d?[\.\/-]\d\d\d?\d?$/.test(value); + }, "Vul hier een geldige datum in." +); + +jQuery.validator.addMethod("time", function(value, element) { + return this.optional(element) || /^([01][0-9])|(2[0123]):([0-5])([0-9])$/.test(value); + }, "Please enter a valid time, between 00:00 and 23:59" +); + +/** + * matches US phone number format + * + * where the area code may not start with 1 and the prefix may not start with 1 + * allows '-' or ' ' as a separator and allows parens around area code + * some people may want to put a '1' in front of their number + * + * 1(212)-999-2345 + * or + * 212 999 2344 + * or + * 212-999-0983 + * + * but not + * 111-123-5434 + * and not + * 212 123 4567 + */ +jQuery.validator.addMethod("phone", function(phone_number, element) { + phone_number = phone_number.replace(/\s+/g, ""); + return this.optional(element) || phone_number.length > 9 && + phone_number.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/); +}, "Please specify a valid phone number"); + +// TODO check if value starts with <, otherwise don't try stripping anything +jQuery.validator.addMethod("strippedminlength", function(value, element, param) { + return jQuery(value).text().length >= param; +}, jQuery.validator.format("Please enter at least {0} characters")); + +// same as email, but TLD is optional +jQuery.validator.addMethod("email2", function(value, element, param) { + return this.optional(element) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value); +}, jQuery.validator.messages.email); + +// same as url, but TLD is optional +jQuery.validator.addMethod("url2", function(value, element, param) { + return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value); +}, jQuery.validator.messages.url); + +// NOTICE: Modified version of Castle.Components.Validator.CreditCardValidator +// Redistributed under the the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0 +// Valid Types: mastercard, visa, amex, dinersclub, enroute, discover, jcb, unknown, all (overrides all other settings) +jQuery.validator.addMethod("creditcardtypes", function(value, element, param) { + + if (/[^0-9-]+/.test(value)) + return false; + + value = value.replace(/\D/g, ""); + + var validTypes = 0x0000; + + if (param.mastercard) + validTypes |= 0x0001; + if (param.visa) + validTypes |= 0x0002; + if (param.amex) + validTypes |= 0x0004; + if (param.dinersclub) + validTypes |= 0x0008; + if (param.enroute) + validTypes |= 0x0010; + if (param.discover) + validTypes |= 0x0020; + if (param.jcb) + validTypes |= 0x0040; + if (param.unknown) + validTypes |= 0x0080; + if (param.all) + validTypes = 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040 | 0x0080; + + if (validTypes & 0x0001 && /^(51|52|53|54|55)/.test(value)) { //mastercard + return value.length == 16; + } + if (validTypes & 0x0002 && /^(4)/.test(value)) { //visa + return value.length == 16; + } + if (validTypes & 0x0004 && /^(34|37)/.test(value)) { //amex + return value.length == 15; + } + if (validTypes & 0x0008 && /^(300|301|302|303|304|305|36|38)/.test(value)) { //dinersclub + return value.length == 14; + } + if (validTypes & 0x0010 && /^(2014|2149)/.test(value)) { //enroute + return value.length == 15; + } + if (validTypes & 0x0020 && /^(6011)/.test(value)) { //discover + return value.length == 16; + } + if (validTypes & 0x0040 && /^(3)/.test(value)) { //jcb + return value.length == 16; + } + if (validTypes & 0x0040 && /^(2131|1800)/.test(value)) { //jcb + return value.length == 15; + } + if (validTypes & 0x0080) { //unknown + return true; + } + return false; +}, "Please enter a valid credit card number."); diff --git a/spec/test_app/public/javascripts/admin.js b/spec/test_app/public/javascripts/admin.js new file mode 100644 index 0000000..761ca61 --- /dev/null +++ b/spec/test_app/public/javascripts/admin.js @@ -0,0 +1,226 @@ +/** +This is a collection of javascript functions and whatnot +under the spree namespace that do stuff we find helpful. +Hopefully, this will evolve into a propper class. +**/ + +var spree; +if (!spree) spree = {}; + +jQuery.noConflict() ; + +jQuery(document).ajaxStart(function(){ + jQuery("#progress").slideDown(); +}); + +jQuery(document).ajaxStop(function(){ + jQuery("#progress").slideUp(); +}); + +jQuery.fn.visible = function(cond) { this[cond ? 'show' : 'hide' ]() }; + +// Apply to individual radio button that makes another element visible when checked +jQuery.fn.radioControlsVisibilityOfElement = function(dependentElementSelector){ + if(!this.get(0)){ return } + showValue = this.get(0).value; + radioGroup = $("input[name='" + this.get(0).name + "']"); + radioGroup.each(function(){ + jQuery(this).click(function(){ + jQuery(dependentElementSelector).visible(this.checked && this.value == showValue) + }); + if(this.checked){ this.click() } + }); +} + +var request = function(options) { + jQuery.ajax(jQuery.extend({ dataType: 'script', url: options.url, type: 'get' }, options)); + return false; +}; + +// remote links handler +jQuery('a[data-remote=true]').live('click', function() { + if(confirm_msg = jQuery(this).attr("data-confirm")){ + if (!confirm(confirm_msg)) return false; + } + if(method = jQuery(this).attr("data-method")){ + return request({ url: this.href, type: 'POST', data: {'_method': method} }); + } else { + update_target = jQuery(this).attr("data-update"); + link_container = jQuery(this).parent(); + if (update_target) { + if ($("#"+update_target).length == 0) { + if ($("#"+update_target.replace('_', '-')).length > 0) { + update_target = update_target.replace('_', '-') + } else { + alert("
not found, add it to view to allow AJAX request."); + return true; + } + } + } + jQuery.ajax({ dataType: 'script', url: this.href, type: 'get', + success: function(data){ + if (update_target) { + $("#"+update_target).html(data); + link_container.hide(); + } + } + }); + return false; + } +}); + +// remote forms handler +jQuery('form[data-remote=true]').live('submit', function() { + return request({ url : this.action, type : this.method, data : jQuery(this).serialize() }); +}); + + + + +// Product autocompletion +image_html = function(item){ + return ""; +} + +format_autocomplete = function(data){ + var html = ""; + + var product = data['product']; + + if(data['variant']==undefined){ + // product + + if(product['images'].length!=0){ + html = image_html(product); + } + + html += "

" + product['name'] + "

"; + html += "Sku: " + product['master']['sku'] + ""; + html += "On Hand: " + product['count_on_hand'] + "
"; + }else{ + // variant + var variant = data['variant']; + var name = product['name']; + + if(variant['images'].length!=0){ + html = image_html(variant); + }else{ + if(product['images'].length!=0){ + html = image_html(product); + } + } + + name += " - " + $.map(variant['option_values'], function(option_value){ + return option_value["option_type"]["presentation"] + ": " + option_value['name']; + }).join(", ") + + html += "

" + name + "

"; + html += "Sku: " + variant['sku'] + ""; + html += "On Hand: " + variant['count_on_hand'] + "
"; + } + + + return html +} + + +prep_autocomplete_data = function(data){ + return $.map(eval(data), function(row) { + + var product = row['product']; + + if(product['variants'].length>0 && expand_variants){ + //variants + return $.map(product['variants'], function(variant){ + + var name = product['name']; + name += " - " + $.map(variant['option_values'], function(option_value){ + return option_value["option_type"]["presentation"] + ": " + option_value['name']; + }).join(", "); + + return { + data: {product: product, variant: variant}, + value: name, + result: name + } + }); + }else{ + return { + data: {product: product}, + value: product['name'], + result: product['name'] + } + } + }); +} + +jQuery.fn.product_autocomplete = function(){ + $(this).autocomplete("/admin/products.json?authenticity_token=" + $('meta[name=csrf-token]').attr("content"), { + parse: prep_autocomplete_data, + formatItem: function(item) { + return format_autocomplete(item); + } + }).result(function(event, data, formatted) { + if (data){ + if(data['variant']==undefined){ + // product + $('#add_variant_id').val(data['product']['master']['id']); + }else{ + // variant + $('#add_variant_id').val(data['variant']['id']); + } + } + }); +} + + + +jQuery.fn.objectPicker = function(url){ + jQuery(this).tokenInput(url + "&authenticity_token=" + AUTH_TOKEN, { + searchDelay : 600, + hintText : strings.type_to_search, + noResultsText : strings.no_results, + searchingText : strings.searching, + prePopulateFromInput : true + }); +}; + +jQuery.fn.productPicker = function(){ + jQuery(this).objectPicker(ajax_urls.product_search_basic_json); +} +jQuery.fn.userPicker = function(){ + jQuery(this).objectPicker(ajax_urls.user_search_basic_json); +} + +jQuery(document).ready(function() { + + jQuery('.tokeninput.products').productPicker(); + jQuery('.tokeninput.users').userPicker(); + +}); + +function add_fields(target, association, content) { + var new_id = new Date().getTime(); + var regexp = new RegExp("new_" + association, "g"); + $(target).append(content.replace(regexp, new_id)); +} + +jQuery('a.remove_fields').live('click', function() { + $(this).prev("input[type=hidden]").val("1"); + $(this).closest(".fields").hide(); + return false; +}); + +jQuery(".observe_field").live('change', function() { + target = $(this).attr("data-update"); + ajax_indicator = $(this).attr("data-ajax-indicator") || '#busy_indicator'; + $(target).hide(); + $(ajax_indicator).show(); + $.get($(this).attr("data-base-url")+encodeURIComponent($(this).val()), + function(data) { + $(target).html(data); + $(ajax_indicator).hide(); + $(target).show(); + } + ); +}); diff --git a/spec/test_app/public/javascripts/admin/address_states.js b/spec/test_app/public/javascripts/admin/address_states.js new file mode 100644 index 0000000..56ddff6 --- /dev/null +++ b/spec/test_app/public/javascripts/admin/address_states.js @@ -0,0 +1,25 @@ +var update_state = function(region) { + var country = $('span#' + region + 'country :only-child').val(); + var states = state_mapper[country]; + + var state_select = $('span#' + region + 'state select'); + var state_input = $('span#' + region + 'state input'); + + if(states) { + state_select.html(''); + var states_with_blank = [["",""]].concat(states); + $.each(states_with_blank, function(pos,id_nm) { + var opt = $(document.createElement('option')) + .attr('value', id_nm[0]) + .html(id_nm[1]); + state_select.append(opt); + }); + state_select.enable().show();; + state_input.hide().disable(); + + } else { + state_input.enable().show(); + state_select.hide().disable(); + } + +}; \ No newline at end of file diff --git a/spec/test_app/public/javascripts/admin/checkouts/edit.js b/spec/test_app/public/javascripts/admin/checkouts/edit.js new file mode 100644 index 0000000..25cbc38 --- /dev/null +++ b/spec/test_app/public/javascripts/admin/checkouts/edit.js @@ -0,0 +1,129 @@ +jQuery(document).ready(function(){ + add_address = function(addr){ + var html = ""; + if(addr!=undefined){ + html += addr['firstname'] + " " + addr['lastname'] + ", "; + html += addr['address1'] + ", " + addr['address2'] + ", "; + html += addr['city'] + ", "; + + if(addr['state_id']!=null){ + html += addr['state']['name'] + ", "; + }else{ + html += addr['state_name'] + ", "; + } + + html += addr['country']['name']; + } + return html; + } + + format_autocomplete = function(data){ + var html = "

" + data['email'] +"

"; + html += "Billing: "; + html += add_address(data['bill_address']); + html += ""; + + html += "Shipping: "; + html += add_address(data['ship_address']); + html += ""; + + return html + } + + prep_autocomplete_data = function(data){ + return $.map(eval(data), function(row) { + return { + data: row['user'], + value: row['user']['email'], + result: row['user']['email'] + } + }); + } + + $("#customer_search").autocomplete("/admin/users.json?authenticity_token=" + $('meta[name=csrf-token]').attr("content"), { + minChars: 5, + delay: 1500, + parse: prep_autocomplete_data, + formatItem: function(item) { + return format_autocomplete(item); + } + }).result(function(event, data, formatted) { + $('#user_id').val(data['id']); + $('#guest_checkout_true').removeAttr("checked"); + $('#guest_checkout_false').attr("checked", "checked"); + $('#guest_checkout_false').removeAttr("disabled"); + $('#checkout_email').val(data['email']); + + var addr = data['bill_address']; + if(addr!=undefined){ + $('#checkout_bill_address_attributes_firstname').val(addr['firstname']); + $('#checkout_bill_address_attributes_lastname').val(addr['lastname']); + $('#checkout_bill_address_attributes_address1').val(addr['address1']); + $('#checkout_bill_address_attributes_address2').val(addr['address2']); + $('#checkout_bill_address_attributes_city').val(addr['city']); + $('#checkout_bill_address_attributes_zipcode').val(addr['zipcode']); + $('#checkout_bill_address_attributes_state_id').val(addr['state_id']); + $('#checkout_bill_address_attributes_country_id').val(addr['country_id']); + $('#checkout_bill_address_attributes_phone').val(addr['phone']); + } + + var addr = data['ship_address']; + if(addr!=undefined){ + $('#checkout_ship_address_attributes_firstname').val(addr['firstname']); + $('#checkout_ship_address_attributes_lastname').val(addr['lastname']); + $('#checkout_ship_address_attributes_address1').val(addr['address1']); + $('#checkout_ship_address_attributes_address2').val(addr['address2']); + $('#checkout_ship_address_attributes_city').val(addr['city']); + $('#checkout_ship_address_attributes_zipcode').val(addr['zipcode']); + $('#checkout_ship_address_attributes_state_id').val(addr['state_id']); + $('#checkout_ship_address_attributes_country_id').val(addr['country_id']); + $('#checkout_ship_address_attributes_phone').val(addr['phone']); + } + }); + + + $('input#checkout_use_billing').click(function() { + show_billing(!this.checked); + }); + + $('#guest_checkout_true').change(function() { + $('#customer_search').val(""); + $('#user_id').val(""); + $('#checkout_email').val(""); + $('#guest_checkout_false').attr("disabled", "true"); + + $('#checkout_bill_address_attributes_firstname').val(""); + $('#checkout_bill_address_attributes_lastname').val(""); + $('#checkout_bill_address_attributes_address1').val(""); + $('#checkout_bill_address_attributes_address2').val(""); + $('#checkout_bill_address_attributes_city').val(""); + $('#checkout_bill_address_attributes_zipcode').val(""); + $('#checkout_bill_address_attributes_state_id').val(""); + $('#checkout_bill_address_attributes_country_id').val(""); + $('#checkout_bill_address_attributes_phone').val(""); + + $('#checkout_ship_address_attributes_firstname').val(""); + $('#checkout_ship_address_attributes_lastname').val(""); + $('#checkout_ship_address_attributes_address1').val(""); + $('#checkout_ship_address_attributes_address2').val(""); + $('#checkout_ship_address_attributes_city').val(""); + $('#checkout_ship_address_attributes_zipcode').val(""); + $('#checkout_ship_address_attributes_state_id').val(""); + $('#checkout_ship_address_attributes_country_id').val(""); + $('#checkout_ship_address_attributes_phone').val(""); + }); + + var show_billing = function(show) { + if(show) { + $('#shipping').show(); + $('#shipping input').removeAttr('disabled', 'disabled'); + $('#shipping select').removeAttr('disabled', 'disabled'); + } else { + $('#shipping').hide(); + $('#shipping input').attr('disabled', 'disabled'); + $('#shipping select').attr('disabled', 'disabled'); + } + } + +}); + diff --git a/spec/test_app/public/javascripts/admin/orders/edit.js b/spec/test_app/public/javascripts/admin/orders/edit.js new file mode 100644 index 0000000..90f5508 --- /dev/null +++ b/spec/test_app/public/javascripts/admin/orders/edit.js @@ -0,0 +1,23 @@ +jQuery(document).ready(function(){ + + $("#add_product_name").product_autocomplete(); + + $("#add_line_item_to_order").live("click", function(){ + if($('#add_variant_id').val() == ''){ return false; } + update_target = jQuery(this).attr("data-update"); + jQuery.ajax({ dataType: 'script', url: this.href, type: "POST", + data: {"line_item[variant_id]": $('#add_variant_id').val(), + "line_item[quantity]": $('#add_quantity').val()}, + success: function(data){ + $("#"+update_target).html(data); + $('#add_product_name').val(''); + $('#add_variant_id').val(''); + $('#add_quantity').val(1) + } + }); + return false; + }); + +}); + + diff --git a/spec/test_app/public/javascripts/admin/orders/edit_form.js b/spec/test_app/public/javascripts/admin/orders/edit_form.js new file mode 100644 index 0000000..114de45 --- /dev/null +++ b/spec/test_app/public/javascripts/admin/orders/edit_form.js @@ -0,0 +1,15 @@ + $.each($('td.qty input'), function(i, inpt){ + $(inpt).delayedObserver(0.5, function(object, value) { + + var id = object.attr('id').replace("order_line_items_attributes_", "").replace("_quantity", ""); + id = "#order_line_items_attributes_" + id + "_id"; + + jQuery.ajax({ + type: "POST", + url: "/admin/orders/" + $('input#order_number').val() + "/line_items/" + $(id).val(), + data: ({_method: "put", "line_item[quantity]": value}), + success: function(html){ $('#order-form-wrapper').html(html)} + }); + + }); + }); diff --git a/spec/test_app/public/javascripts/admin/payments/new.js b/spec/test_app/public/javascripts/admin/payments/new.js new file mode 100644 index 0000000..bf164dd --- /dev/null +++ b/spec/test_app/public/javascripts/admin/payments/new.js @@ -0,0 +1,9 @@ +$(document).ready(function(){ + + $("#card_new").radioControlsVisibilityOfElement('#card_form'); + + $('select.jump_menu').change(function(){ + window.location = this.options[this.selectedIndex].value; + }); + +}); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/admin/unobtrusive_handlers.js b/spec/test_app/public/javascripts/admin/unobtrusive_handlers.js new file mode 100644 index 0000000..7b8ff31 --- /dev/null +++ b/spec/test_app/public/javascripts/admin/unobtrusive_handlers.js @@ -0,0 +1,15 @@ +$(document).ready(function(){ + + $(".select_properties_from_prototype").live("click", function(){ + $("#busy_indicator").show(); + var clicked_link = $(this); + jQuery.ajax({ dataType: 'script', url: clicked_link.attr("href"), type: 'get', + success: function(data){ + clicked_link.parent("td").parent("tr").hide(); + $("#busy_indicator").hide(); + } + }); + return false; + }); + +}); diff --git a/spec/test_app/public/javascripts/application.js b/spec/test_app/public/javascripts/application.js new file mode 100644 index 0000000..ca62ff5 --- /dev/null +++ b/spec/test_app/public/javascripts/application.js @@ -0,0 +1,12 @@ +(function($){ + $(document).ready(function(){ + + // Remove an item from the cart by setting its quantity to zero and posting the update form + $('form#updatecart a.delete').show().click(function(){ + $(this).parents('tr').find('input.line_item_quantity').val(0); + $(this).parents('form').submit(); + return false; + }); + + }); +})(jQuery); diff --git a/spec/test_app/public/javascripts/calculator.js b/spec/test_app/public/javascripts/calculator.js new file mode 100644 index 0000000..cfad998 --- /dev/null +++ b/spec/test_app/public/javascripts/calculator.js @@ -0,0 +1,15 @@ +$j(function() { + var original_calc_type = $j('#calc-type').attr('value'); + $j('div#calculator-settings-warning').hide(); + $j('#calc-type').change(function() { + if ($j('#calc-type').attr('value') == original_calc_type) { + $j('div.calculator-settings').show(); + $j('div#calculator-settings-warning').hide(); + $j('.calculator-settings input').removeAttr('disabled'); + } else { + $j('div.calculator-settings').hide(); + $j('div#calculator-settings-warning').show(); + $j('.calculator-settings input').attr('disabled', 'disabled'); + } + }); +}) diff --git a/spec/test_app/public/javascripts/checkout.js b/spec/test_app/public/javascripts/checkout.js new file mode 100644 index 0000000..02dce4c --- /dev/null +++ b/spec/test_app/public/javascripts/checkout.js @@ -0,0 +1,75 @@ +(function($){ + $(document).ready(function(){ + + $('#checkout_form_address').validate(); + + var get_states = function(region){ + var country = $('span#' + region + 'country :only-child').val(); + return state_mapper[country]; + } + + var update_state = function(region) { + var states = get_states(region); + + var state_select = $('span#' + region + 'state select'); + var state_input = $('span#' + region + 'state input'); + + if(states) { + var selected = state_select.val(); + state_select.html(''); + var states_with_blank = [["",""]].concat(states); + $.each(states_with_blank, function(pos,id_nm) { + var opt = $(document.createElement('option')) + .attr('value', id_nm[0]) + .html(id_nm[1]); + if(selected==id_nm[0]){ + opt.attr('selected', 'selected'); + } + state_select.append(opt); + }); + state_select.removeAttr('disabled').show(); + state_input.hide().attr('disabled', 'disabled'); + + } else { + state_input.removeAttr('disabled').show(); + state_select.hide().attr('disabled', 'disabled'); + } + + }; + + // Show fields for the selected payment method + $("input[type='radio'][name='order[payments_attributes][][payment_method_id]']").click(function(){ + $('#payment-methods li').hide(); + if(this.checked){ $('#payment_method_'+this.value).show(); } + }).triggerHandler('click'); + + $('span#bcountry select').change(function() { update_state('b'); }); + $('span#scountry select').change(function() { update_state('s'); }); + update_state('b'); + update_state('s'); + + $('input#order_use_billing').click(function() { + if($(this).is(':checked')) { + $('#shipping .inner input, #shipping .inner select, #shipping .inner label, #shipping .inner .req').hide(); + $('#shipping .inner input, #shipping .inner select').attr('disabled', 'disabled'); + } else { + $('#shipping .inner input, #shipping .inner select, #shipping .inner label, #shipping .inner .req').show(); + $('#shipping .inner input, #shipping .inner select').removeAttr('disabled', 'disabled'); + + //only want to enable relevant field + if(get_states('s')){ + $('span#sstate input').hide().attr('disabled', 'disabled'); + }else{ + $('span#sstate select').hide().attr('disabled', 'disabled'); + } + + } + }).triggerHandler('click'); + + $('form.edit_checkout').submit(function() { + $(this).find(':submit, :image').attr('disabled', true).removeClass('primary').addClass('disabled'); + }); + + + }); +})(jQuery); diff --git a/spec/test_app/public/javascripts/datepicker.js b/spec/test_app/public/javascripts/datepicker.js new file mode 100644 index 0000000..a62a010 --- /dev/null +++ b/spec/test_app/public/javascripts/datepicker.js @@ -0,0 +1,1445 @@ +/* + DatePicker v4.4 by frequency-decoder.com + + Released under a creative commons Attribution-ShareAlike 2.5 license (http://creativecommons.org/licenses/by-sa/2.5/) + + Please credit frequency-decoder in any derivative work - thanks. + + You are free: + + * to copy, distribute, display, and perform the work + * to make derivative works + * to make commercial use of the work + + Under the following conditions: + + by Attribution. + -------------- + You must attribute the work in the manner specified by the author or licensor. + + sa + -- + Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one. + + * For any reuse or distribution, you must make clear to others the license terms of this work. + * Any of these conditions can be waived if you get permission from the copyright holder. +*/ +var datePickerController; + +(function() { + +// Detect the browser language +datePicker.languageinfo = navigator.language ? navigator.language : navigator.userLanguage; +datePicker.languageinfo = datePicker.languageinfo ? datePicker.languageinfo.toLowerCase().replace(/-[a-z]+$/, "") : 'en'; + +// Load the appropriate language file +var scriptFiles = document.getElementsByTagName('head')[0].getElementsByTagName('script'); +var loc = scriptFiles[scriptFiles.length - 1].src.substr(0, scriptFiles[scriptFiles.length - 1].src.lastIndexOf("/")) + "/lang/" + datePicker.languageinfo + ".js"; + +var script = document.createElement('script'); +script.type = "text/javascript"; +script.src = loc; +script.setAttribute("charset", "utf-8"); +/*@cc_on +/*@if(@_win32) + var bases = document.getElementsByTagName('base'); + if (bases.length && bases[0].childNodes.length) { + bases[0].appendChild(script); + } else { + document.getElementsByTagName('head')[0].appendChild(script); + }; +@else @*/ +document.getElementsByTagName('head')[0].appendChild(script); +/*@end +@*/ +script = null; + +// Defaults should the locale file not load +datePicker.months = ["January","February","March","April","May","June","July","August","September","October","November","December"]; +datePicker.fullDay = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]; +datePicker.titles = ["Previous month","Next month","Previous year","Next year", "Today", "Show Calendar"]; + +datePicker.getDaysPerMonth = function(nMonth, nYear) { + nMonth = (nMonth + 12) % 12; + return (((0 == (nYear%4)) && ((0 != (nYear%100)) || (0 == (nYear%400)))) && nMonth == 1) ? 29: [31,28,31,30,31,30,31,31,30,31,30,31][nMonth]; +}; + +function datePicker(options) { + + this.defaults = {}; + for(opt in options) { this[opt] = this.defaults[opt] = options[opt]; }; + + this.date = new Date(); + this.yearinc = 1; + this.timer = null; + this.pause = 1000; + this.timerSet = false; + this.fadeTimer = null; + this.interval = new Date(); + this.firstDayOfWeek = this.defaults.firstDayOfWeek = this.dayInc = this.monthInc = this.yearInc = this.opacity = this.opacityTo = 0; + this.dateSet = null; + this.visible = false; + this.disabledDates = []; + this.enabledDates = []; + this.nbsp = String.fromCharCode( 160 ); + var o = this; + + o.events = { + onblur:function(e) { + o.removeKeyboardEvents(); + }, + onfocus:function(e) { + o.addKeyboardEvents(); + }, + onkeydown: function (e) { + o.stopTimer(); + if(!o.visible) return false; + + if(e == null) e = document.parentWindow.event; + var kc = e.keyCode ? e.keyCode : e.charCode; + + if( kc == 13 ) { + // close (return) + var td = document.getElementById(o.id + "-date-picker-hover"); + if(!td || td.className.search(/out-of-range|day-disabled/) != -1) return o.killEvent(e); + o.returnFormattedDate(); + o.hide(); + return o.killEvent(e); + } else if(kc == 27) { + // close (esc) + o.hide(); + return o.killEvent(e); + } else if(kc == 32 || kc == 0) { + // today (space) + o.date = new Date(); + o.updateTable(); + return o.killEvent(e); + }; + + // Internet Explorer fires the keydown event faster than the JavaScript engine can + // update the interface. The following attempts to fix this. + /*@cc_on + @if(@_win32) + if(new Date().getTime() - o.interval.getTime() < 100) return o.killEvent(e); + o.interval = new Date(); + @end + @*/ + + if ((kc > 49 && kc < 56) || (kc > 97 && kc < 104)) { + if (kc > 96) kc -= (96-48); + kc -= 49; + o.firstDayOfWeek = (o.firstDayOfWeek + kc) % 7; + o.updateTable(); + return o.killEvent(e); + }; + + if ( kc < 37 || kc > 40 ) return true; + + var d = new Date( o.date ).valueOf(); + + if ( kc == 37 ) { + // ctrl + left = previous month + if( e.ctrlKey ) { + d = new Date( o.date ); + d.setDate( Math.min(d.getDate(), datePicker.getDaysPerMonth(d.getMonth() - 1,d.getFullYear())) ); + d.setMonth( d.getMonth() - 1 ); + } else { + d = new Date( o.date.getFullYear(), o.date.getMonth(), o.date.getDate() - 1 ); + }; + } else if ( kc == 39 ) { + // ctrl + right = next month + if( e.ctrlKey ) { + d = new Date( o.date ); + d.setDate( Math.min(d.getDate(), datePicker.getDaysPerMonth(d.getMonth() + 1,d.getFullYear())) ); + d.setMonth( d.getMonth() + 1 ); + } else { + d = new Date( o.date.getFullYear(), o.date.getMonth(), o.date.getDate() + 1 ); + }; + } else if ( kc == 38 ) { + // ctrl + up = next year + if( e.ctrlKey ) { + d = new Date( o.date ); + d.setDate( Math.min(d.getDate(), datePicker.getDaysPerMonth(d.getMonth(),d.getFullYear() + 1)) ); + d.setFullYear( d.getFullYear() + 1 ); + } else { + d = new Date( o.date.getFullYear(), o.date.getMonth(), o.date.getDate() - 7 ); + }; + } else if ( kc == 40 ) { + // ctrl + down = prev year + if( e.ctrlKey ) { + d = new Date( o.date ); + d.setDate( Math.min(d.getDate(), datePicker.getDaysPerMonth(d.getMonth(),d.getFullYear() - 1)) ); + d.setFullYear( d.getFullYear() - 1 ); + } else { + d = new Date( o.date.getFullYear(), o.date.getMonth(), o.date.getDate() + 7 ); + }; + }; + + var tmpDate = new Date(d); + + if(o.outOfRange(tmpDate)) return o.killEvent(e); + + var cacheDate = new Date(o.date); + o.date = tmpDate; + + if(cacheDate.getFullYear() != o.date.getFullYear() || cacheDate.getMonth() != o.date.getMonth()) o.updateTable(); + else { + o.disableTodayButton(); + var tds = o.table.getElementsByTagName('td'); + var txt; + var start = o.date.getDate() - 6; + if(start < 0) start = 0; + + for(var i = start, td; td = tds[i]; i++) { + txt = Number(td.firstChild.nodeValue); + if(isNaN(txt) || txt != o.date.getDate()) continue; + o.removeHighlight(); + td.id = o.id + "-date-picker-hover"; + td.className = td.className.replace(/date-picker-hover/g, "") + " date-picker-hover"; + }; + }; + return o.killEvent(e); + }, + gotoToday: function(e) { + o.date = new Date(); + o.updateTable(); + return o.killEvent(e); + }, + onmousedown: function(e) { + if ( e == null ) e = document.parentWindow.event; + var el = e.target != null ? e.target : e.srcElement; + + var found = false; + while(el.parentNode) { + if(el.id && (el.id == "fd-"+o.id || el.id == "fd-but-"+o.id)) { + found = true; + break; + }; + try { + el = el.parentNode; + } catch(err) { + break; + }; + }; + if(found) return true; + o.stopTimer(); + datePickerController.hideAll(); + }, + onmouseover: function(e) { + o.stopTimer(); + var txt = this.firstChild.nodeValue; + if(this.className == "out-of-range" || txt.search(/^[\d]+$/) == -1) return; + + o.removeHighlight(); + + this.id = o.id+"-date-picker-hover"; + this.className = this.className.replace(/date-picker-hover/g, "") + " date-picker-hover"; + + o.date.setDate(this.firstChild.nodeValue); + o.disableTodayButton(); + }, + onclick: function(e) { + if(o.opacity != o.opacityTo || this.className.search(/out-of-range|day-disabled/) != -1) return false; + if ( e == null ) e = document.parentWindow.event; + var el = e.target != null ? e.target : e.srcElement; + while ( el.nodeType != 1 ) el = el.parentNode; + var d = new Date( o.date ); + var txt = el.firstChild.data; + if(txt.search(/^[\d]+$/) == -1) return; + var n = Number( txt ); + if(isNaN(n)) { return true; }; + d.setDate( n ); + o.date = d; + o.returnFormattedDate(); + if(!o.staticPos) o.hide(); + o.stopTimer(); + return o.killEvent(e); + }, + incDec: function(e) { + if ( e == null ) e = document.parentWindow.event; + var el = e.target != null ? e.target : e.srcElement; + + if(el && el.className && el.className.search('fd-disabled') != -1) { return false; } + datePickerController.addEvent(document, "mouseup", o.events.clearTimer); + o.timerInc = 800; + o.dayInc = arguments[1]; + o.yearInc = arguments[2]; + o.monthInc = arguments[3]; + o.timerSet = true; + + o.updateTable(); + return true; + }, + clearTimer: function(e) { + o.stopTimer(); + o.timerInc = 1000; + o.yearInc = 0; + o.monthInc = 0; + o.dayInc = 0; + datePickerController.removeEvent(document, "mouseup", o.events.clearTimer); + } + }; + o.stopTimer = function() { + o.timerSet = false; + window.clearTimeout(o.timer); + }; + o.removeHighlight = function() { + if(document.getElementById(o.id+"-date-picker-hover")) { + document.getElementById(o.id+"-date-picker-hover").className = document.getElementById(o.id+"-date-picker-hover").className.replace("date-picker-hover", ""); + document.getElementById(o.id+"-date-picker-hover").id = ""; + }; + }; + o.reset = function() { + for(def in o.defaults) { o[def] = o.defaults[def]; }; + }; + o.setOpacity = function(op) { + o.div.style.opacity = op/100; + o.div.style.filter = 'alpha(opacity=' + op + ')'; + o.opacity = op; + }; + o.fade = function() { + window.clearTimeout(o.fadeTimer); + o.fadeTimer = null; + delete(o.fadeTimer); + + var diff = Math.round(o.opacity + ((o.opacityTo - o.opacity) / 4)); + + o.setOpacity(diff); + + if(Math.abs(o.opacityTo - diff) > 3 && !o.noTransparency) { + o.fadeTimer = window.setTimeout(o.fade, 50); + } else { + o.setOpacity(o.opacityTo); + if(o.opacityTo == 0) { + o.div.style.display = "none"; + o.visible = false; + } else { + o.visible = true; + }; + }; + }; + o.killEvent = function(e) { + e = e || document.parentWindow.event; + + if(e.stopPropagation) { + e.stopPropagation(); + e.preventDefault(); + }; + + /*@cc_on + @if(@_win32) + e.cancelBubble = true; + e.returnValue = false; + @end + @*/ + return false; + }; + o.getElem = function() { + return document.getElementById(o.id.replace(/^fd-/, '')) || false; + }; + o.setRangeLow = function(range) { + if(String(range).search(/^(\d\d?\d\d)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$/) == -1) range = ''; + o.low = o.defaults.low = range; + if(o.staticPos) o.updateTable(true); + }; + o.setRangeHigh = function(range) { + if(String(range).search(/^(\d\d?\d\d)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$/) == -1) range = ''; + o.high = o.defaults.high = range; + if(o.staticPos) o.updateTable(true); + }; + o.setDisabledDays = function(dayArray) { + o.disableDays = o.defaults.disableDays = dayArray; + if(o.staticPos) o.updateTable(true); + }; + o.setDisabledDates = function(dateArray) { + var fin = []; + for(var i = dateArray.length; i-- ;) { + if(dateArray[i].match(/^(\d\d\d\d|\*\*\*\*)(0[1-9]|1[012]|\*\*)(0[1-9]|[12][0-9]|3[01])$/) != -1) fin[fin.length] = dateArray[i]; + }; + if(fin.length) { + o.disabledDates = fin; + o.enabledDates = []; + if(o.staticPos) o.updateTable(true); + }; + }; + o.setEnabledDates = function(dateArray) { + var fin = []; + for(var i = dateArray.length; i-- ;) { + if(dateArray[i].match(/^(\d\d\d\d|\*\*\*\*)(0[1-9]|1[012]|\*\*)(0[1-9]|[12][0-9]|3[01]|\*\*)$/) != -1 && dateArray[i] != "********") fin[fin.length] = dateArray[i]; + }; + if(fin.length) { + o.disabledDates = []; + o.enabledDates = fin; + if(o.staticPos) o.updateTable(true); + }; + }; + o.getDisabledDates = function(y, m) { + if(o.enabledDates.length) return o.getEnabledDates(y, m); + var obj = {}; + var d = datePicker.getDaysPerMonth(m - 1, y); + m = m < 10 ? "0" + String(m) : m; + for(var i = o.disabledDates.length; i-- ;) { + var tmp = o.disabledDates[i].replace("****", y).replace("**", m); + if(tmp < Number(String(y)+m+"01") || tmp > Number(y+String(m)+d)) continue; + obj[tmp] = 1; + }; + return obj; + }; + o.getEnabledDates = function(y, m) { + var obj = {}; + var d = datePicker.getDaysPerMonth(m - 1, y); + m = m < 10 ? "0" + String(m) : m; + var day,tmp,de,me,ye,disabled; + for(var dd = 1; dd <= d; dd++) { + day = dd < 10 ? "0" + String(dd) : dd; + disabled = true; + for(var i = o.enabledDates.length; i-- ;) { + tmp = o.enabledDates[i]; + ye = String(o.enabledDates[i]).substr(0,4); + me = String(o.enabledDates[i]).substr(4,2); + de = String(o.enabledDates[i]).substr(6,2); + + if(ye == y && me == m && de == day) { + disabled = false; + break; + } + + if(ye == "****" || me == "**" || de == "**") { + if(ye == "****") tmp = tmp.replace(/^\*\*\*\*/, y); + if(me == "**") tmp = tmp = tmp.substr(0,4) + String(m) + tmp.substr(6,2); + if(de == "**") tmp = tmp.replace(/\*\*/, day); + + if(tmp == String(y + String(m) + day)) { + disabled = false; + break; + }; + }; + }; + if(disabled) obj[String(y + String(m) + day)] = 1; + }; + return obj; + }; + o.setFirstDayOfWeek = function(e) { + if ( e == null ) e = document.parentWindow.event; + var elem = e.target != null ? e.target : e.srcElement; + if(elem.tagName.toLowerCase() != "th") { + while(elem.tagName.toLowerCase() != "th") elem = elem.parentNode; + }; + var cnt = 0; + while(elem.previousSibling) { + elem = elem.previousSibling; + if(elem.tagName.toLowerCase() == "th") cnt++; + }; + o.firstDayOfWeek = (o.firstDayOfWeek + cnt) % 7; + o.updateTableHeaders(); + return o.killEvent(e); + }; + o.truePosition = function(element) { + var pos = o.cumulativeOffset(element); + if(window.opera) { return pos; } + var iebody = (document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body; + var dsocleft = document.all ? iebody.scrollLeft : window.pageXOffset; + var dsoctop = document.all ? iebody.scrollTop : window.pageYOffset; + var posReal = o.realOffset(element); + return [pos[0] - posReal[0] + dsocleft, pos[1] - posReal[1] + dsoctop]; + }; + o.realOffset = function(element) { + var t = 0, l = 0; + do { + t += element.scrollTop || 0; + l += element.scrollLeft || 0; + element = element.parentNode; + } while (element); + return [l, t]; + }; + o.cumulativeOffset = function(element) { + var t = 0, l = 0; + do { + t += element.offsetTop || 0; + l += element.offsetLeft || 0; + element = element.offsetParent; + } while (element); + return [l, t]; + }; + o.resize = function() { + if(!o.created || !o.getElem()) return; + + o.div.style.visibility = "hidden"; + if(!o.staticPos) { o.div.style.left = o.div.style.top = "0px"; } + o.div.style.display = "block"; + + var osh = o.div.offsetHeight; + var osw = o.div.offsetWidth; + + o.div.style.visibility = "visible"; + o.div.style.display = "none"; + + if(!o.staticPos) { + var elem = document.getElementById('fd-but-' + o.id); + var pos = o.truePosition(elem); + var trueBody = (document.compatMode && document.compatMode!="BackCompat") ? document.documentElement : document.body; + var scrollTop = window.devicePixelRatio || window.opera ? 0 : trueBody.scrollTop; + var scrollLeft = window.devicePixelRatio || window.opera ? 0 : trueBody.scrollLeft; + + if(parseInt(trueBody.clientWidth+scrollLeft) < parseInt(osw+pos[0])) { + o.div.style.left = Math.abs(parseInt((trueBody.clientWidth+scrollLeft) - osw)) + "px"; + } else { + o.div.style.left = pos[0] + "px"; + }; + + if(parseInt(trueBody.clientHeight+scrollTop) < parseInt(osh+pos[1]+elem.offsetHeight+2)) { + o.div.style.top = Math.abs(parseInt(pos[1] - (osh + 2))) + "px"; + } else { + o.div.style.top = Math.abs(parseInt(pos[1] + elem.offsetHeight + 2)) + "px"; + }; + }; + /*@cc_on + @if(@_jscript_version <= 5.6) + if(o.staticPos) return; + o.iePopUp.style.top = o.div.style.top; + o.iePopUp.style.left = o.div.style.left; + o.iePopUp.style.width = osw + "px"; + o.iePopUp.style.height = (osh - 2) + "px"; + @end + @*/ + }; + o.equaliseDates = function() { + var clearDayFound = false; + var tmpDate; + for(var i = o.low; i <= o.high; i++) { + tmpDate = String(i); + if(!o.disableDays[new Date(tmpDate.substr(0,4), tmpDate.substr(6,2), tmpDate.substr(4,2)).getDay() - 1]) { + clearDayFound = true; + break; + }; + }; + if(!clearDayFound) o.disableDays = o.defaults.disableDays = [0,0,0,0,0,0,0]; + }; + o.outOfRange = function(tmpDate) { + if(!o.low && !o.high) return false; + + var level = false; + if(!tmpDate) { + level = true; + tmpDate = o.date; + }; + + var d = (tmpDate.getDate() < 10) ? "0" + tmpDate.getDate() : tmpDate.getDate(); + var m = ((tmpDate.getMonth() + 1) < 10) ? "0" + (tmpDate.getMonth() + 1) : tmpDate.getMonth() + 1; + var y = tmpDate.getFullYear(); + var dt = String(y)+String(m)+String(d); + + if(o.low && parseInt(dt) < parseInt(o.low)) { + if(!level) return true; + o.date = new Date(o.low.substr(0,4), o.low.substr(4,2)-1, o.low.substr(6,2), 5, 0, 0); + return false; + }; + if(o.high && parseInt(dt) > parseInt(o.high)) { + if(!level) return true; + o.date = new Date( o.high.substr(0,4), o.high.substr(4,2)-1, o.high.substr(6,2), 5, 0, 0); + }; + return false; + }; + o.createButton = function() { + if(o.staticPos) { return; }; + + var but; + + if(!document.getElementById("fd-but-" + o.id)) { + var inp = o.getElem(); + + but = document.createElement('a'); + but.href = "#"; + + var span = document.createElement('span'); + span.appendChild(document.createTextNode(String.fromCharCode( 160 ))); + + but.className = "date-picker-control"; + but.title = (typeof(fdLocale) == "object" && options.locale && fdLocale.titles.length > 5) ? fdLocale.titles[5] : ""; + + but.id = "fd-but-" + o.id; + but.appendChild(span); + + if(inp.nextSibling) { + inp.parentNode.insertBefore(but, inp.nextSibling); + } else { + inp.parentNode.appendChild(but); + }; + } else { + but = document.getElementById("fd-but-" + o.id); + }; + + but.onclick = but.onpress = function(e) { + e = e || window.event; + var inpId = this.id.replace('fd-but-',''); + try { var dp = datePickerController.getDatePicker(inpId); } catch(err) { return false; }; + + if(e.type == "press") { + var kc = e.keyCode != null ? e.keyCode : e.charCode; + if(kc != 13) { return true; }; + if(dp.visible) { + hideAll(); + return false; + }; + }; + + if(!dp.visible) { + datePickerController.hideAll(inpId); + dp.show(); + } else { + datePickerController.hideAll(); + }; + return false; + }; + but = null; + }, + o.create = function() { + + function createTH(details) { + var th = document.createElement('th'); + if(details.thClassName) th.className = details.thClassName; + if(details.colspan) { + /*@cc_on + /*@if (@_win32) + th.setAttribute('colSpan',details.colspan); + @else @*/ + th.setAttribute('colspan',details.colspan); + /*@end + @*/ + }; + /*@cc_on + /*@if (@_win32) + th.unselectable = "on"; + /*@end@*/ + return th; + }; + + function createThAndButton(tr, obj) { + for(var i = 0, details; details = obj[i]; i++) { + var th = createTH(details); + tr.appendChild(th); + var but = document.createElement('span'); + but.className = details.className; + but.id = o.id + details.id; + but.appendChild(document.createTextNode(details.text)); + but.title = details.title || ""; + if(details.onmousedown) but.onmousedown = details.onmousedown; + if(details.onclick) but.onclick = details.onclick; + if(details.onmouseout) but.onmouseout = details.onmouseout; + th.appendChild(but); + }; + }; + + /*@cc_on + @if(@_jscript_version <= 5.6) + if(!document.getElementById("iePopUpHack")) { + o.iePopUp = document.createElement('iframe'); + o.iePopUp.src = "javascript:'';"; + o.iePopUp.setAttribute('className','iehack'); + o.iePopUp.scrolling="no"; + o.iePopUp.frameBorder="0"; + o.iePopUp.name = o.iePopUp.id = "iePopUpHack"; + document.body.appendChild(o.iePopUp); + } else { + o.iePopUp = document.getElementById("iePopUpHack"); + }; + @end + @*/ + + if(typeof(fdLocale) == "object" && o.locale) { + datePicker.titles = fdLocale.titles; + datePicker.months = fdLocale.months; + datePicker.fullDay = fdLocale.fullDay; + // Optional parameters + if(fdLocale.dayAbbr) datePicker.dayAbbr = fdLocale.dayAbbr; + if(fdLocale.firstDayOfWeek) o.firstDayOfWeek = o.defaults.firstDayOfWeek = fdLocale.firstDayOfWeek; + }; + + o.div = document.createElement('div'); + o.div.style.zIndex = 9999; + o.div.id = "fd-"+o.id; + o.div.className = "datePicker"; + + if(!o.staticPos) { + document.getElementsByTagName('body')[0].appendChild(o.div); + } else { + elem = o.getElem(); + if(!elem) { + o.div = null; + return; + }; + o.div.className += " staticDP"; + o.div.setAttribute("tabIndex", "0"); + o.div.onfocus = o.events.onfocus; + o.div.onblur = o.events.onblur; + elem.parentNode.insertBefore(o.div, elem.nextSibling); + if(o.hideInput && elem.type && elem.type == "text") elem.setAttribute("type", "hidden"); + }; + + //var nbsp = String.fromCharCode( 160 ); + var tr, row, col, tableHead, tableBody; + + o.table = document.createElement('table'); + o.div.appendChild( o.table ); + + tableHead = document.createElement('thead'); + o.table.appendChild( tableHead ); + + tr = document.createElement('tr'); + tableHead.appendChild(tr); + + // Title Bar + o.titleBar = createTH({thClassName:"date-picker-title", colspan:7}); + tr.appendChild( o.titleBar ); + tr = null; + + var span = document.createElement('span'); + span.className = "month-display"; + o.titleBar.appendChild(span); + + span = document.createElement('span'); + span.className = "year-display"; + o.titleBar.appendChild(span); + + span = null; + + tr = document.createElement('tr'); + tableHead.appendChild(tr); + + createThAndButton(tr, [{className:"prev-but", id:"-prev-year-but", text:"\u00AB", title:datePicker.titles[2], onmousedown:function(e) { o.events.incDec(e,0,-1,0); }, onmouseout:o.events.clearTimer },{className:"prev-but", id:"-prev-month-but", text:"\u2039", title:datePicker.titles[0], onmousedown:function(e) { o.events.incDec(e,0,0,-1); }, onmouseout:o.events.clearTimer },{colspan:3, className:"today-but", id:"-today-but", text:datePicker.titles.length > 4 ? datePicker.titles[4] : "Today", onclick:o.events.gotoToday},{className:"next-but", id:"-next-month-but", text:"\u203A", title:datePicker.titles[1], onmousedown:function(e) { o.events.incDec(e,0,0,1); }, onmouseout:o.events.clearTimer },{className:"next-but", id:"-next-year-but", text:"\u00BB", title:datePicker.titles[3], onmousedown:function(e) { o.events.incDec(e,0,1,0); }, onmouseout:o.events.clearTimer }]); + + tableBody = document.createElement('tbody'); + o.table.appendChild( tableBody ); + + for(var rows = 0; rows < 7; rows++) { + row = document.createElement('tr'); + + if(rows != 0) tableBody.appendChild(row); + else tableHead.appendChild(row); + + for(var cols = 0; cols < 7; cols++) { + col = (rows == 0) ? document.createElement('th') : document.createElement('td'); + + row.appendChild(col); + if(rows != 0) { + col.appendChild(document.createTextNode(o.nbsp)); + col.onmouseover = o.events.onmouseover; + col.onclick = o.events.onclick; + } else { + col.className = "date-picker-day-header"; + col.scope = "col"; + }; + col = null; + }; + row = null; + }; + + // Table headers + var but; + var ths = o.table.getElementsByTagName('thead')[0].getElementsByTagName('tr')[2].getElementsByTagName('th'); + for ( var y = 0; y < 7; y++ ) { + if(y > 0) { + but = document.createElement("span"); + but.className = "fd-day-header"; + but.onclick = ths[y].onclick = o.setFirstDayOfWeek; + but.appendChild(document.createTextNode(o.nbsp)); + ths[y].appendChild(but); + but = null; + } else { + ths[y].appendChild(document.createTextNode(o.nbsp)); + }; + }; + + o.ths = o.table.getElementsByTagName('thead')[0].getElementsByTagName('tr')[2].getElementsByTagName('th'); + o.trs = o.table.getElementsByTagName('tbody')[0].getElementsByTagName('tr'); + + o.updateTableHeaders(); + + tableBody = tableHead = tr = createThAndButton = createTH = null; + + if(o.low && o.high && (o.high - o.low < 7)) { o.equaliseDates(); }; + + o.created = true; + + if(o.staticPos) { + var yyN = document.getElementById(o.id); + datePickerController.addEvent(yyN, "change", o.changeHandler); + if(o.splitDate) { + var mmN = document.getElementById(o.id+'-mm'); + var ddN = document.getElementById(o.id+'-dd'); + datePickerController.addEvent(mmN, "change", o.changeHandler); + datePickerController.addEvent(ddN, "change", o.changeHandler); + }; + + o.show(); + } else { + o.createButton(); + o.resize(); + o.fade(); + }; + }; + o.changeHandler = function() { + o.setDateFromInput(); + o.updateTable(); + }; + o.setDateFromInput = function() { + function m2c(val) { + return String(val).length < 2 ? "00".substring(0, 2 - String(val).length) + String(val) : val; + }; + + o.dateSet = null; + + var elem = o.getElem(); + if(!elem) return; + + if(!o.splitDate) { + var date = datePickerController.dateFormat(elem.value, o.format.search(/m-d-y/i) != -1); + } else { + var mmN = document.getElementById(o.id+'-mm'); + var ddN = document.getElementById(o.id+'-dd'); + var tm = parseInt(mmN.tagName.toLowerCase() == "input" ? mmN.value : mmN.options[mmN.selectedIndex].value, 10); + var td = parseInt(ddN.tagName.toLowerCase() == "input" ? ddN.value : ddN.options[ddN.selectedIndex].value, 10); + var ty = parseInt(elem.tagName.toLowerCase() == "input" ? elem.value : elem.options[elem.selectedIndex || 0].value, 10); + var date = datePickerController.dateFormat(tm + "/" + td + "/" + ty, true); + }; + + var badDate = false; + if(!date) { + badDate = true; + date = String(new Date().getFullYear()) + m2c(new Date().getMonth()+1) + m2c(new Date().getDate()); + }; + + var d,m,y; + y = Number(date.substr(0, 4)); + m = Number(date.substr(4, 2)) - 1; + d = Number(date.substr(6, 2)); + + var dpm = datePicker.getDaysPerMonth(m, y); + if(d > dpm) d = dpm; + + if(new Date(y, m, d) == 'Invalid Date' || new Date(y, m, d) == 'NaN') { + badDate = true; + o.date = new Date(); + o.date.setHours(5); + return; + }; + + o.date = new Date(y, m, d); + o.date.setHours(5); + + if(!badDate) o.dateSet = new Date(o.date); + m2c = null; + }; + o.setSelectIndex = function(elem, indx) { + var len = elem.options.length; + indx = Number(indx); + for(var opt = 0; opt < len; opt++) { + if(elem.options[opt].value == indx) { + elem.selectedIndex = opt; + return; + }; + }; + }, + o.returnFormattedDate = function() { + + var elem = o.getElem(); + if(!elem) return; + + var d = (o.date.getDate() < 10) ? "0" + o.date.getDate() : o.date.getDate(); + var m = ((o.date.getMonth() + 1) < 10) ? "0" + (o.date.getMonth() + 1) : o.date.getMonth() + 1; + var yyyy = o.date.getFullYear(); + var disabledDates = o.getDisabledDates(yyyy, m); + var weekDay = ( o.date.getDay() + 6 ) % 7; + + if(!(o.disableDays[weekDay] || String(yyyy)+m+d in disabledDates)) { + + if(o.splitDate) { + var ddE = document.getElementById(o.id+"-dd"); + var mmE = document.getElementById(o.id+"-mm"); + + if(ddE.tagName.toLowerCase() == "input") { ddE.value = d; } + else { o.setSelectIndex(ddE, d); /*ddE.selectedIndex = d - 1;*/ }; + + if(mmE.tagName.toLowerCase() == "input") { mmE.value = m; } + else { o.setSelectIndex(mmE, m); /*mmE.selectedIndex = m - 1;*/ }; + + if(elem.tagName.toLowerCase() == "input") elem.value = yyyy; + else { + o.setSelectIndex(elem, yyyy); /* + for(var opt = 0; opt < elem.options.length; opt++) { + if(elem.options[opt].value == yyyy) { + elem.selectedIndex = opt; + break; + }; + }; + */ + }; + } else { + elem.value = o.format.replace('y',yyyy).replace('m',m).replace('d',d).replace(/-/g,o.divider); + }; + if(!elem.type || elem.type && elem.type != "hidden"){ elem.focus(); } + if(o.staticPos) { + o.dateSet = new Date( o.date ); + o.updateTable(); + }; + + // Programmatically fire the onchange event + if(document.createEvent) { + var onchangeEvent = document.createEvent('HTMLEvents'); + onchangeEvent.initEvent('change', true, false); + elem.dispatchEvent(onchangeEvent); + } else if(document.createEventObject) { + elem.fireEvent('onchange'); + }; + }; + }; + o.disableTodayButton = function() { + var today = new Date(); + document.getElementById(o.id + "-today-but").className = document.getElementById(o.id + "-today-but").className.replace("fd-disabled", ""); + if(o.outOfRange(today) || (o.date.getDate() == today.getDate() && o.date.getMonth() == today.getMonth() && o.date.getFullYear() == today.getFullYear())) { + document.getElementById(o.id + "-today-but").className += " fd-disabled"; + document.getElementById(o.id + "-today-but").onclick = null; + } else { + document.getElementById(o.id + "-today-but").onclick = o.events.gotoToday; + }; + }; + o.updateTableHeaders = function() { + var d, but; + var ths = o.ths; + for ( var y = 0; y < 7; y++ ) { + d = (o.firstDayOfWeek + y) % 7; + ths[y].title = datePicker.fullDay[d]; + + if(y > 0) { + but = ths[y].getElementsByTagName("span")[0]; + but.removeChild(but.firstChild); + but.appendChild(document.createTextNode(datePicker.dayAbbr ? datePicker.dayAbbr[d] : datePicker.fullDay[d].charAt(0))); + but.title = datePicker.fullDay[d]; + but = null; + } else { + ths[y].removeChild(ths[y].firstChild); + ths[y].appendChild(document.createTextNode(datePicker.dayAbbr ? datePicker.dayAbbr[d] : datePicker.fullDay[d].charAt(0))); + }; + }; + o.updateTable(); + }; + + o.updateTable = function(noCallback) { + + if(o.timerSet) { + var d = new Date(o.date); + d.setDate( Math.min(d.getDate()+o.dayInc, datePicker.getDaysPerMonth(d.getMonth()+o.monthInc,d.getFullYear()+o.yearInc)) ); + d.setMonth( d.getMonth() + o.monthInc ); + d.setFullYear( d.getFullYear() + o.yearInc ); + o.date = d; + }; + + if(!noCallback && "onupdate" in datePickerController && typeof(datePickerController.onupdate) == "function") datePickerController.onupdate(o); + + o.outOfRange(); + o.disableTodayButton(); + + // Set the tmpDate to the second day of this month (to avoid daylight savings time madness on Windows) + var tmpDate = new Date( o.date.getFullYear(), o.date.getMonth(), 2 ); + tmpDate.setHours(5); + + var tdm = tmpDate.getMonth(); + var tdy = tmpDate.getFullYear(); + + // Do the disableDates for this year and month + var disabledDates = o.getDisabledDates(o.date.getFullYear(), o.date.getMonth() + 1); + + var today = new Date(); + + // Previous buttons out of range + var b = document.getElementById(o.id + "-prev-year-but"); + b.className = b.className.replace("fd-disabled", ""); + if(o.outOfRange(new Date((tdy - 1), Number(tdm), datePicker.getDaysPerMonth(Number(tdm), tdy-1)))) { + b.className += " fd-disabled"; + if(o.yearInc == -1) o.stopTimer(); + }; + + b = document.getElementById(o.id + "-prev-month-but") + b.className = b.className.replace("fd-disabled", ""); + if(o.outOfRange(new Date(tdy, (Number(tdm) - 1), datePicker.getDaysPerMonth(Number(tdm)-1, tdy)))) { + b.className += " fd-disabled"; + if(o.monthInc == -1) o.stopTimer(); + }; + + // Next buttons out of range + b= document.getElementById(o.id + "-next-year-but") + b.className = b.className.replace("fd-disabled", ""); + if(o.outOfRange(new Date((tdy + 1), Number(tdm), 1))) { + b.className += " fd-disabled"; + if(o.yearInc == 1) o.stopTimer(); + }; + + b = document.getElementById(o.id + "-next-month-but") + b.className = b.className.replace("fd-disabled", ""); + if(o.outOfRange(new Date(tdy, Number(tdm) + 1, 1))) { + b.className += " fd-disabled"; + if(o.monthInc == 1) o.stopTimer(); + }; + + b = null; + + var cd = o.date.getDate(); + var cm = o.date.getMonth(); + var cy = o.date.getFullYear(); + + // Title Bar + var span = o.titleBar.getElementsByTagName("span"); + while(span[0].firstChild) span[0].removeChild(span[0].firstChild); + while(span[1].firstChild) span[1].removeChild(span[1].firstChild); + span[0].appendChild(document.createTextNode(datePicker.months[cm] + o.nbsp)); + span[1].appendChild(document.createTextNode(cy)); + + tmpDate.setDate( 1 ); + + var dt, cName, td, tds, i; + var weekDay = ( tmpDate.getDay() + 6 ) % 7; + var firstColIndex = (( (weekDay - o.firstDayOfWeek) + 7 ) % 7) - 1; + var dpm = datePicker.getDaysPerMonth(cm, cy); + + var todayD = today.getDate(); + var todayM = today.getMonth(); + var todayY = today.getFullYear(); + + var c = "class"; + /*@cc_on + @if(@_win32) + c = "className"; + @end + @*/ + + var stub = String(tdy) + (String(tdm+1).length < 2 ? "0" + (tdm+1) : tdm+1); + + for(var row = 0; row < 6; row++) { + + tds = o.trs[row].getElementsByTagName('td'); + + for(var col = 0; col < 7; col++) { + + td = tds[col]; + td.removeChild(td.firstChild); + + td.setAttribute("id", ""); + td.setAttribute("title", ""); + + i = (row * 7) + col; + + if(i > firstColIndex && i <= (firstColIndex + dpm)) { + dt = i - firstColIndex; + + tmpDate.setDate(dt); + td.appendChild(document.createTextNode(dt)); + + if(o.outOfRange(tmpDate)) { + td.setAttribute(c, "out-of-range"); + } else { + + cName = []; + weekDay = ( tmpDate.getDay() + 6 ) % 7; + + if(dt == todayD && tdm == todayM && tdy == todayY) { + cName.push("date-picker-today"); + }; + + if(o.dateSet != null && o.dateSet.getDate() == dt && o.dateSet.getMonth() == tdm && o.dateSet.getFullYear() == tdy) { + cName.push("date-picker-selected-date"); + }; + + if(o.disableDays[weekDay] || stub + String(dt < 10 ? "0" + dt : dt) in disabledDates) { + cName.push("day-disabled"); + } else if(o.highlightDays[weekDay]) { + cName.push("date-picker-highlight"); + }; + + if(cd == dt) { + td.setAttribute("id", o.id + "-date-picker-hover"); + cName.push("date-picker-hover"); + }; + + cName.push("dm-" + dt + '-' + (tdm + 1) + " " + " dmy-" + dt + '-' + (tdm + 1) + '-' + tdy); + td.setAttribute(c, cName.join(' ')); + td.setAttribute("title", datePicker.months[cm] + o.nbsp + dt + "," + o.nbsp + cy); + }; + } else { + td.appendChild(document.createTextNode(o.nbsp)); + td.setAttribute(c, "date-picker-unused"); + }; + }; + }; + + if(o.timerSet) { + o.timerInc = 50 + Math.round(((o.timerInc - 50) / 1.8)); + o.timer = window.setTimeout(o.updateTable, o.timerInc); + }; + }; + o.addKeyboardEvents = function() { + datePickerController.addEvent(document, "keypress", o.events.onkeydown); + /*@cc_on + @if(@_win32) + datePickerController.removeEvent(document, "keypress", o.events.onkeydown); + datePickerController.addEvent(document, "keydown", o.events.onkeydown); + @end + @*/ + if(window.devicePixelRatio) { + datePickerController.removeEvent(document, "keypress", o.events.onkeydown); + datePickerController.addEvent(document, "keydown", o.events.onkeydown); + }; + }; + o.removeKeyboardEvents =function() { + datePickerController.removeEvent(document, "keypress", o.events.onkeydown); + datePickerController.removeEvent(document, "keydown", o.events.onkeydown); + }; + o.show = function() { + var elem = o.getElem(); + if(!elem || o.visible || elem.disabled) return; + + o.reset(); + o.setDateFromInput(); + o.updateTable(); + + if(!o.staticPos) o.resize(); + + datePickerController.addEvent(o.staticPos ? o.table : document, "mousedown", o.events.onmousedown); + + if(!o.staticPos) { o.addKeyboardEvents(); }; + + o.opacityTo = o.noTransparency ? 99 : 90; + o.div.style.display = "block"; + /*@cc_on + @if(@_jscript_version <= 5.6) + if(!o.staticPos) o.iePopUp.style.display = "block"; + @end + @*/ + + o.fade(); + o.visible = true; + }; + o.hide = function() { + if(!o.visible) return; + o.stopTimer(); + if(o.staticPos) return; + + datePickerController.removeEvent(document, "mousedown", o.events.onmousedown); + datePickerController.removeEvent(document, "mouseup", o.events.clearTimer); + o.removeKeyboardEvents(); + + /*@cc_on + @if(@_jscript_version <= 5.6) + o.iePopUp.style.display = "none"; + @end + @*/ + + o.opacityTo = 0; + o.fade(); + o.visible = false; + var elem = o.getElem(); + if(!elem.type || elem.type && elem.type != "hidden") { elem.focus(); }; + }; + o.destroy = function() { + // Cleanup for Internet Explorer + datePickerController.removeEvent(o.staticPos ? o.table : document, "mousedown", o.events.onmousedown); + datePickerController.removeEvent(document, "mouseup", o.events.clearTimer); + o.removeKeyboardEvents(); + + if(o.staticPos) { + var yyN = document.getElementById(o.id); + datePickerController.removeEvent(yyN, "change", o.changeHandler); + if(o.splitDate) { + var mmN = document.getElementById(o.id+'-mm'); + var ddN = document.getElementById(o.id+'-dd'); + + datePickerController.removeEvent(mmN, "change", o.changeHandler); + datePickerController.removeEvent(ddN, "change", o.changeHandler); + }; + o.div.onfocus = o.div.onblur = null; + }; + + var ths = o.table.getElementsByTagName("th"); + for(var i = 0, th; th = ths[i]; i++) { + th.onmouseover = th.onmouseout = th.onmousedown = th.onclick = null; + }; + + var tds = o.table.getElementsByTagName("td"); + for(var i = 0, td; td = tds[i]; i++) { + td.onmouseover = td.onclick = null; + }; + + var butts = o.table.getElementsByTagName("span"); + for(var i = 0, butt; butt = butts[i]; i++) { + butt.onmousedown = butt.onclick = butt.onkeypress = null; + }; + + o.ths = o.trs = null; + + clearTimeout(o.fadeTimer); + clearTimeout(o.timer); + o.fadeTimer = o.timer = null; + + /*@cc_on + @if(@_jscript_version <= 5.6) + o.iePopUp = null; + @end + @*/ + + if(!o.staticPos && document.getElementById(o.id.replace(/^fd-/, 'fd-but-'))) { + var butt = document.getElementById(o.id.replace(/^fd-/, 'fd-but-')); + butt.onclick = butt.onpress = null; + }; + + if(o.div && o.div.parentNode) { + o.div.parentNode.removeChild(o.div); + }; + + o.titleBar = o.table = o.div = null; + o = null; + }; + o.create(); +}; + +datePickerController = function() { + var datePickers = {}; + var uniqueId = 0; + + var addEvent = function(obj, type, fn) { + if( obj.attachEvent ) { + obj["e"+type+fn] = fn; + obj[type+fn] = function(){obj["e"+type+fn]( window.event );}; + obj.attachEvent( "on"+type, obj[type+fn] ); + } else { + obj.addEventListener( type, fn, true ); + }; + }; + var removeEvent = function(obj, type, fn) { + try { + if( obj.detachEvent ) { + obj.detachEvent( "on"+type, obj[type+fn] ); + obj[type+fn] = null; + } else { + obj.removeEventListener( type, fn, true ); + }; + } catch(err) {}; + }; + var hideAll = function(exception) { + var dp; + for(dp in datePickers) { + if(!datePickers[dp].created || datePickers[dp].staticPos) continue; + if(exception && exception == datePickers[dp].id) { continue; }; + if(document.getElementById(datePickers[dp].id)) { datePickers[dp].hide(); }; + }; + }; + var cleanUp = function() { + var dp; + for(dp in datePickers) { + if(!document.getElementById(datePickers[dp].id)) { + if(!datePickers[dp].created) continue; + datePickers[dp].destroy(); + datePickers[dp] = null; + delete datePickers[dp]; + }; + }; + }; + var destroy = function() { + for(dp in datePickers) { + if(!datePickers[dp].created) continue; + datePickers[dp].destroy(); + datePickers[dp] = null; + delete datePickers[dp]; + }; + datePickers = null; + /*@cc_on + @if(@_jscript_version <= 5.6) + if(document.getElementById("iePopUpHack")) { + document.body.removeChild(document.getElementById("iePopUpHack")); + }; + @end + @*/ + datePicker.script = null; + removeEvent(window, 'load', datePickerController.create); + removeEvent(window, 'unload', datePickerController.destroy); + }; + var dateFormat = function(dateIn, favourMDY) { + var dateTest = [ + { regExp:/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/, d:1, m:3, y:5 }, // dmy + { regExp:/^(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])([- \/.])((\d\d)?\d\d)$/, d:3, m:1, y:5 }, // mdy + { regExp:/^(\d\d\d\d)([- \/.])(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])$/, d:5, m:3, y:1 } // ymd + ]; + + var start; + var cnt = 0; + while(cnt < 3) { + start = (cnt + (favourMDY ? 4 : 3)) % 3; + if(dateIn.match(dateTest[start].regExp)) { + res = dateIn.match(dateTest[start].regExp); + y = res[dateTest[start].y]; + m = res[dateTest[start].m]; + d = res[dateTest[start].d]; + if(m.length == 1) m = "0" + m; + if(d.length == 1) d = "0" + d; + if(y.length != 4) y = (parseInt(y) < 50) ? '20' + y : '19' + y; + return String(y)+m+d; + }; + cnt++; + }; + return 0; + }; + var joinNodeLists = function() { + if(!arguments.length) { return []; } + var nodeList = []; + for (var i = 0; i < arguments.length; i++) { + for (var j = 0, item; item = arguments[i][j]; j++) { + nodeList[nodeList.length] = item; + }; + }; + return nodeList; + }; + var addDatePicker = function(inpId, options) { + if(!(inpId in datePickers)) { + datePickers[inpId] = new datePicker(options); + }; + }; + var getDatePicker = function(inpId) { + if(!(inpId in datePickers)) { throw "No datePicker has been created for the form element with an id of '" + inpId.toString() + "'"; }; + return datePickers[inpId]; + }; + var grepRangeLimits = function(sel) { + var range = []; + for(var i = 0; i < sel.options.length; i++) { + if(sel.options[i].value.search(/^\d\d\d\d$/) == -1) { continue; }; + if(!range[0] || Number(sel.options[i].value) < range[0]) { range[0] = Number(sel.options[i].value); }; + if(!range[1] || Number(sel.options[i].value) > range[1]) { range[1] = Number(sel.options[i].value); }; + }; + return range; + }; + var create = function(inp) { + if(!(typeof document.createElement != "undefined" && typeof document.documentElement != "undefined" && typeof document.documentElement.offsetWidth == "number")) return; + + var inputs = (inp && inp.tagName) ? [inp] : joinNodeLists(document.getElementsByTagName('input'), document.getElementsByTagName('select')); + var regExp1 = /disable-days-([1-7]){1,6}/g; // the days to disable + var regExp2 = /no-transparency/g; // do not use transparency effects + var regExp3 = /highlight-days-([1-7]){1,7}/g; // the days to highlight in red + var regExp4 = /range-low-(\d\d\d\d-\d\d-\d\d)/g; // the lowest selectable date + var regExp5 = /range-high-(\d\d\d\d-\d\d-\d\d)/g; // the highest selectable date + var regExp6 = /format-(d-m-y|m-d-y|y-m-d)/g; // the input/output date format + var regExp7 = /divider-(dot|slash|space|dash)/g; // the character used to divide the date + var regExp8 = /no-locale/g; // do not attempt to detect the browser language + var regExp9 = /no-fade/g; // always show the datepicker + var regExp10 = /hide-input/g; // hide the input + + for(var i=0, inp; inp = inputs[i]; i++) { + if(inp.className && (inp.className.search(regExp6) != -1 || inp.className.search(/split-date/) != -1) && ((inp.tagName.toLowerCase() == "input" && (inp.type == "text" || inp.type == "hidden")) || inp.tagName.toLowerCase() == "select")) { + + if(inp.id && document.getElementById('fd-'+inp.id)) { continue; }; + + if(!inp.id) { inp.id = "fdDatePicker-" + uniqueId++; }; + + var options = { + id:inp.id, + low:"", + high:"", + divider:"/", + format:"d-m-y", + highlightDays:[0,0,0,0,0,1,1], + disableDays:[0,0,0,0,0,0,0], + locale:inp.className.search(regExp8) == -1, + splitDate:0, + noTransparency:inp.className.search(regExp2) != -1, + staticPos:inp.className.search(regExp9) != -1, + hideInput:inp.className.search(regExp10) != -1 + }; + + if(!options.staticPos) { + options.hideInput = false; + } else { + options.noTransparency = true; + }; + + // Split the date into three parts ? + if(inp.className.search(/split-date/) != -1) { + if(document.getElementById(inp.id+'-dd') && document.getElementById(inp.id+'-mm') && document.getElementById(inp.id+'-dd').tagName.search(/input|select/i) != -1 && document.getElementById(inp.id+'-mm').tagName.search(/input|select/i) != -1) { + options.splitDate = 1; + }; + }; + + // Date format(variations of d-m-y) + if(inp.className.search(regExp6) != -1) { + options.format = inp.className.match(regExp6)[0].replace('format-',''); + }; + + // What divider to use, a "/", "-", "." or " " + if(inp.className.search(regExp7) != -1) { + var dividers = { dot:".", space:" ", dash:"-", slash:"/" }; + options.divider = (inp.className.search(regExp7) != -1 && inp.className.match(regExp7)[0].replace('divider-','') in dividers) ? dividers[inp.className.match(regExp7)[0].replace('divider-','')] : "/"; + }; + + // The days to highlight + if(inp.className.search(regExp3) != -1) { + var tmp = inp.className.match(regExp3)[0].replace(/highlight-days-/, ''); + options.highlightDays = [0,0,0,0,0,0,0]; + for(var j = 0; j < tmp.length; j++) { + options.highlightDays[tmp.charAt(j) - 1] = 1; + }; + }; + + // The days to disable + if(inp.className.search(regExp1) != -1) { + var tmp = inp.className.match(regExp1)[0].replace(/disable-days-/, ''); + options.disableDays = [0,0,0,0,0,0,0]; + for(var j = 0; j < tmp.length; j++) { + options.disableDays[tmp.charAt(j) - 1] = 1; + }; + }; + + // The lower limit + if(inp.className.search(/range-low-today/i) != -1) { + options.low = datePickerController.dateFormat((new Date().getMonth() + 1) + "/" + new Date().getDate() + "/" + new Date().getFullYear(), true); + } else if(inp.className.search(regExp4) != -1) { + options.low = datePickerController.dateFormat(inp.className.match(regExp4)[0].replace(/range-low-/, ''), false); + if(!options.low) { + options.low = ''; + }; + }; + + // The higher limit + if(inp.className.search(/range-high-today/i) != -1 && inp.className.search(/range-low-today/i) == -1) { + options.high = datePickerController.dateFormat((new Date().getMonth() + 1) + "/" + new Date().getDate() + "/" + new Date().getFullYear(), true); + } else if(inp.className.search(regExp5) != -1) { + options.high = datePickerController.dateFormat(inp.className.match(regExp5)[0].replace(/range-high-/, ''), false); + if(!options.high) { + options.high = ''; + }; + }; + + // Always round lower & higher limits if a selectList involved + if(inp.tagName.search(/select/i) != -1) { + var range = grepRangeLimits(inp); + options.low = options.low ? range[0] + String(options.low).substr(4,4) : datePickerController.dateFormat(range[0] + "/01/01"); + options.high = options.high ? range[1] + String(options.low).substr(4,4) : datePickerController.dateFormat(range[1] + "/12/31"); + }; + + addDatePicker(inp.id, options); + }; + }; + } + + return { + addEvent:addEvent, + removeEvent:removeEvent, + create:create, + destroy:destroy, + cleanUp:cleanUp, + addDatePicker:addDatePicker, + getDatePicker:getDatePicker, + dateFormat:dateFormat, + datePickers:datePickers, + hideAll:hideAll + }; +}(); + +})(); + +datePickerController.addEvent(window, 'load', datePickerController.create); +datePickerController.addEvent(window, 'unload', datePickerController.destroy); diff --git a/spec/test_app/public/javascripts/gateway.js b/spec/test_app/public/javascripts/gateway.js new file mode 100644 index 0000000..f8dc477 --- /dev/null +++ b/spec/test_app/public/javascripts/gateway.js @@ -0,0 +1,13 @@ +$j(function() { + var original_gtwy_type = $j('#gtwy-type').attr('value'); + $j('div#gateway-settings-warning').hide(); + $j('#gtwy-type').change(function() { + if ($j('#gtwy-type').attr('value') == original_gtwy_type) { + $j('div.gateway-settings').show(); + $j('div#gateway-settings-warning').hide(); + } else { + $j('div.gateway-settings').hide(); + $j('div#gateway-settings-warning').show(); + } + }); +}) \ No newline at end of file diff --git a/spec/test_app/public/javascripts/jquery-1.4.2.min.js b/spec/test_app/public/javascripts/jquery-1.4.2.min.js new file mode 100644 index 0000000..7c24308 --- /dev/null +++ b/spec/test_app/public/javascripts/jquery-1.4.2.min.js @@ -0,0 +1,154 @@ +/*! + * jQuery JavaScript Library v1.4.2 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Sat Feb 13 22:33:48 2010 -0500 + */ +(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/, +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))&& +(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, +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=== +"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, +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
<%= t("category") %> - <%= t("questions") %> -  <%= t("category") %> + <%= t("questions") %> + <% end %> + + <%= hook :admin_question_categories_header_actions %> +
<%= h category.name %><%= category.questions.count %>
<%= h category.name %><%= category.questions.count %> - <%= link_to_edit category.id %>  - <%= link_to_delete category.id %> + <%= hook :admin_question_categories_index_row_actions, locals do %> + <%= link_to_edit category %>  + <%= link_to_delete category %> + <% end %>
a"; +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, +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= +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= +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, +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]; +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, +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=== +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, +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= +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"); +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, +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("."); +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), +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= +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()&& +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; +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", +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, +"_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, +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, +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(); +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|| +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()}, +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, +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)}, +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)}}, +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= +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=== +"="?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, +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"&& +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=""; +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}}(); +(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)}: +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= +{},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=== +"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", +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")? +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=== +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= +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}, +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)})}, +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, +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); +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, +""):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]); +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)||["", +""])[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= +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]? +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= +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= +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, +"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= +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= +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!== +"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}, +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(" "), +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, +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&& +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)? +"&":"?")+(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=== +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= +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", +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|| +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); +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=== +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=== +"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; +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=== +"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]|| +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; +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= +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, +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
"; +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); +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, +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- +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": +"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 +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); diff --git a/spec/test_app/public/javascripts/jquery-ui.js b/spec/test_app/public/javascripts/jquery-ui.js new file mode 100644 index 0000000..3efce20 --- /dev/null +++ b/spec/test_app/public/javascripts/jquery-ui.js @@ -0,0 +1,188 @@ +/* + * jQuery UI 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI + */ +jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/* + * jQuery UI Draggable 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(b);if(!this.handle){return false}return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;if(c.cursorAt){this._adjustOffsetFromHelper(c.cursorAt)}if(c.containment){this._setContainment()}this._trigger("start",b);this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,b)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,d){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!d){var c=this._uiHash();this._trigger("drag",b,c);this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,b)}return false},_mouseStop:function(c){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,c)}if(this.dropped){d=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!d)||(this.options.revert=="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",c);b._clear()})}else{this._trigger("stop",c);this._clear()}return false},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target){c=true}});return c},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c])):(d.helper=="clone"?this.element.clone():this.element);if(!b.parents("body").length){b.appendTo((d.appendTo=="parent"?this.element[0].parentNode:d.appendTo))}if(b[0]!=this.element[0]&&!(/(fixed|absolute)/).test(b.css("position"))){b.css("position","absolute")}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)&&e.containment.constructor!=Array){var c=a(e.containment)[0];if(!c){return}var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.leftthis.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.topthis.containment[3])?g:(!(g-this.offset.click.topthis.containment[2])?f:(!(f-this.offset.click.left').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-y=p&&n<=k)||(m>=p&&m<=k)||(nk))&&((e>=g&&e<=c)||(d>=g&&d<=c)||(ec));break;default:return false;break}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,g){var b=a.ui.ddmanager.droppables[e.options.scope];var f=g?g.type:null;var h=(e.currentItem||e.element).find(":data(droppable)").andSelf();droppablesLoop:for(var d=0;d=0;b--){this.items[b].item.removeData("sortable-item")}},_mouseCapture:function(e,f){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(e);var d=null,c=this,b=a(e.target).parents().each(function(){if(a.data(this,"sortable-item")==c){d=a(this);return false}});if(a.data(e.target,"sortable-item")==c){d=a(e.target)}if(!d){return false}if(this.options.handle&&!f){var g=false;a(this.options.handle,d).find("*").andSelf().each(function(){if(this==e.target){g=true}});if(!g){return false}}this.currentItem=d;this._removeCurrentsFromItems();return true},_mouseStart:function(e,f,b){var g=this.options,c=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;if(g.cursorAt){this._adjustOffsetFromHelper(g.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(g.containment){this._setContainment()}if(g.cursor){if(a("body").css("cursor")){this._storedCursor=a("body").css("cursor")}a("body").css("cursor",g.cursor)}if(g.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",g.opacity)}if(g.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",g.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",e,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!b){for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("activate",e,c._uiHash(this))}}if(a.ui.ddmanager){a.ui.ddmanager.current=this}if(a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,e)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(e);return true},_mouseDrag:function(f){this.position=this._generatePosition(f);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var g=this.options,b=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-f.pageY=0;d--){var e=this.items[d],c=e.item[0],h=this._intersectsWithPointer(e);if(!h){continue}if(c!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=c&&!a.ui.contains(this.placeholder[0],c)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],c):true)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(e)){this._rearrange(f,e)}else{break}this._trigger("change",f,this._uiHash());break}}this._contactContainers(f);if(a.ui.ddmanager){a.ui.ddmanager.drag(this,f)}this._trigger("sort",f,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(c,d){if(!c){return}if(a.ui.ddmanager&&!this.options.dropBehaviour){a.ui.ddmanager.drop(this,c)}if(this.options.revert){var b=this;var e=b.placeholder.offset();b.reverting=true;a(this.helper).animate({left:e.left-this.offset.parent.left-b.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-b.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){b._clear(c)})}else{this._clear(c,d)}return false},cancel:function(){var b=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,b._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,b._uiHash(this));this.containers[c].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){a(this.domPosition.prev).after(this.currentItem)}else{a(this.domPosition.parent).prepend(this.currentItem)}return true},serialize:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};a(b).each(function(){var e=(a(d.item||this).attr(d.attribute||"id")||"").match(d.expression||(/(.+)[-=_](.+)/));if(e){c.push((d.key||e[1]+"[]")+"="+(d.key&&d.expression?e[1]:e[2]))}});return c.join("&")},toArray:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};b.each(function(){c.push(a(d.item||this).attr(d.attribute||"id")||"")});return c},_intersectsWith:function(m){var e=this.positionAbs.left,d=e+this.helperProportions.width,k=this.positionAbs.top,j=k+this.helperProportions.height;var f=m.left,c=f+m.width,n=m.top,i=n+m.height;var o=this.offset.click.top,h=this.offset.click.left;var g=(k+o)>n&&(k+o)f&&(e+h)m[this.floating?"width":"height"])){return g}else{return(f0?"down":"up")},_getDragHorizontalDirection:function(){var b=this.positionAbs.left-this.lastPositionAbs.left;return b!=0&&(b>0?"right":"left")},refresh:function(b){this._refreshItems(b);this.refreshPositions()},_connectWith:function(){var b=this.options;return b.connectWith.constructor==String?[b.connectWith]:b.connectWith},_getItemsAsjQuery:function(b){var l=this;var g=[];var e=[];var h=this._connectWith();if(h&&b){for(var d=h.length-1;d>=0;d--){var k=a(h[d]);for(var c=k.length-1;c>=0;c--){var f=a.data(k[c],"sortable");if(f&&f!=this&&!f.options.disabled){e.push([a.isFunction(f.options.items)?f.options.items.call(f.element):a(f.options.items,f.element).not(".ui-sortable-helper"),f])}}}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var d=e.length-1;d>=0;d--){e[d][0].each(function(){g.push(this)})}return a(g)},_removeCurrentsFromItems:function(){var d=this.currentItem.find(":data(sortable-item)");for(var c=0;c=0;e--){var m=a(l[e]);for(var d=m.length-1;d>=0;d--){var g=a.data(m[d],"sortable");if(g&&g!=this&&!g.options.disabled){f.push([a.isFunction(g.options.items)?g.options.items.call(g.element[0],b,{item:this.currentItem}):a(g.options.items,g.element),g]);this.containers.push(g)}}}}for(var e=f.length-1;e>=0;e--){var k=f[e][1];var c=f[e][0];for(var d=0,n=c.length;d=0;d--){var e=this.items[d];if(e.instance!=this.currentContainer&&this.currentContainer&&e.item[0]!=this.currentItem[0]){continue}var c=this.options.toleranceElement?a(this.options.toleranceElement,e.item):e.item;if(!b){e.width=c.outerWidth();e.height=c.outerHeight()}var f=c.offset();e.left=f.left;e.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var d=this.containers.length-1;d>=0;d--){var f=this.containers[d].element.offset();this.containers[d].containerCache.left=f.left;this.containers[d].containerCache.top=f.top;this.containers[d].containerCache.width=this.containers[d].element.outerWidth();this.containers[d].containerCache.height=this.containers[d].element.outerHeight()}}},_createPlaceholder:function(d){var b=d||this,e=b.options;if(!e.placeholder||e.placeholder.constructor==String){var c=e.placeholder;e.placeholder={element:function(){var f=a(document.createElement(b.currentItem[0].nodeName)).addClass(c||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!c){f.style.visibility="hidden"}return f},update:function(f,g){if(c&&!e.forcePlaceholderSize){return}if(!g.height()){g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10))}if(!g.width()){g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=a(e.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);e.placeholder.update(b,b.placeholder)},_contactContainers:function(d){for(var c=this.containers.length-1;c>=0;c--){if(this._intersectsWith(this.containers[c].containerCache)){if(!this.containers[c].containerCache.over){if(this.currentContainer!=this.containers[c]){var h=10000;var g=null;var e=this.positionAbs[this.containers[c].floating?"left":"top"];for(var b=this.items.length-1;b>=0;b--){if(!a.ui.contains(this.containers[c].element[0],this.items[b].item[0])){continue}var f=this.items[b][this.containers[c].floating?"left":"top"];if(Math.abs(f-e)this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.topthis.containment[3])?g:(!(g-this.offset.click.topthis.containment[2])?f:(!(f-this.offset.click.left=0;c--){if(a.ui.contains(this.containers[c].element[0],this.currentItem[0])&&!e){f.push((function(g){return function(h){g._trigger("receive",h,this._uiHash(this))}}).call(this,this.containers[c]));f.push((function(g){return function(h){g._trigger("update",h,this._uiHash(this))}}).call(this,this.containers[c]))}}}for(var c=this.containers.length-1;c>=0;c--){if(!e){f.push((function(g){return function(h){g._trigger("deactivate",h,this._uiHash(this))}}).call(this,this.containers[c]))}if(this.containers[c].containerCache.over){f.push((function(g){return function(h){g._trigger("out",h,this._uiHash(this))}}).call(this,this.containers[c]));this.containers[c].containerCache.over=0}}if(this._storedCursor){a("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",d,this._uiHash());for(var c=0;c *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}})})(jQuery);;/* + * jQuery UI Effects 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/ + */ +jQuery.effects||(function(d){d.effects={version:"1.7.2",save:function(g,h){for(var f=0;f');var j=f.parent();if(f.css("position")=="static"){j.css({position:"relative"});f.css({position:"relative"})}else{var i=f.css("top");if(isNaN(parseInt(i,10))){i="auto"}var h=f.css("left");if(isNaN(parseInt(h,10))){h="auto"}j.css({position:f.css("position"),top:i,left:h,zIndex:f.css("z-index")}).show();f.css({position:"relative",top:0,left:0})}j.css(g);return j},removeWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent().replaceWith(f)}return f},setTransition:function(g,i,f,h){h=h||{};d.each(i,function(k,j){unit=g.cssUnit(j);if(unit[0]>0){h[j]=unit[0]*f+unit[1]}});return h},animateClass:function(h,i,k,j){var f=(typeof k=="function"?k:(j?j:null));var g=(typeof k=="string"?k:null);return this.each(function(){var q={};var o=d(this);var p=o.attr("style")||"";if(typeof p=="object"){p=p.cssText}if(h.toggle){o.hasClass(h.toggle)?h.remove=h.toggle:h.add=h.toggle}var l=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.addClass(h.add)}if(h.remove){o.removeClass(h.remove)}var m=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.removeClass(h.add)}if(h.remove){o.addClass(h.remove)}for(var r in m){if(typeof m[r]!="function"&&m[r]&&r.indexOf("Moz")==-1&&r.indexOf("length")==-1&&m[r]!=l[r]&&(r.match(/color/i)||(!r.match(/color/i)&&!isNaN(parseInt(m[r],10))))&&(l.position!="static"||(l.position=="static"&&!r.match(/left|top|bottom|right/)))){q[r]=m[r]}}o.animate(q,i,g,function(){if(typeof d(this).attr("style")=="object"){d(this).attr("style")["cssText"]="";d(this).attr("style")["cssText"]=p}else{d(this).attr("style",p)}if(h.add){d(this).addClass(h.add)}if(h.remove){d(this).removeClass(h.remove)}if(f){f.apply(this,arguments)}})})}};function c(g,f){var i=g[1]&&g[1].constructor==Object?g[1]:{};if(f){i.mode=f}var h=g[1]&&g[1].constructor!=Object?g[1]:(i.duration?i.duration:g[2]);h=d.fx.off?0:typeof h==="number"?h:d.fx.speeds[h]||d.fx.speeds._default;var j=i.callback||(d.isFunction(g[1])&&g[1])||(d.isFunction(g[2])&&g[2])||(d.isFunction(g[3])&&g[3]);return[g[0],i,h,j]}d.fn.extend({_show:d.fn.show,_hide:d.fn.hide,__toggle:d.fn.toggle,_addClass:d.fn.addClass,_removeClass:d.fn.removeClass,_toggleClass:d.fn.toggleClass,effect:function(g,f,h,i){return d.effects[g]?d.effects[g].call(this,{method:g,options:f||{},duration:h,callback:i}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._show.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"show"))}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._hide.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"hide"))}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))||(d.isFunction(arguments[0])||typeof arguments[0]=="boolean")){return this.__toggle.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"toggle"))}},addClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{add:g},f,i,h]):this._addClass(g)},removeClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{remove:g},f,i,h]):this._removeClass(g)},toggleClass:function(g,f,i,h){return((typeof f!=="boolean")&&f)?d.effects.animateClass.apply(this,[{toggle:g},f,i,h]):this._toggleClass(g,f)},morph:function(f,h,g,j,i){return d.effects.animateClass.apply(this,[{add:h,remove:f},g,j,i])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(f){var g=this.css(f),h=[];d.each(["em","px","%","pt"],function(j,k){if(g.indexOf(k)>0){h=[parseFloat(g),k]}});return h}});d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(g,f){d.fx.step[f]=function(h){if(h.state==0){h.start=e(h.elem,f);h.end=b(h.end)}h.elem.style[f]="rgb("+[Math.max(Math.min(parseInt((h.pos*(h.end[0]-h.start[0]))+h.start[0],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[1]-h.start[1]))+h.start[1],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[2]-h.start[2]))+h.start[2],10),255),0)].join(",")+")"}});function b(g){var f;if(g&&g.constructor==Array&&g.length==3){return g}if(f=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(g)){return[parseInt(f[1],10),parseInt(f[2],10),parseInt(f[3],10)]}if(f=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(g)){return[parseFloat(f[1])*2.55,parseFloat(f[2])*2.55,parseFloat(f[3])*2.55]}if(f=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(g)){return[parseInt(f[1],16),parseInt(f[2],16),parseInt(f[3],16)]}if(f=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(g)){return[parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16),parseInt(f[3]+f[3],16)]}if(f=/rgba\(0, 0, 0, 0\)/.exec(g)){return a.transparent}return a[d.trim(g).toLowerCase()]}function e(h,f){var g;do{g=d.curCSS(h,f);if(g!=""&&g!="transparent"||d.nodeName(h,"body")){break}f="backgroundColor"}while(h=h.parentNode);return b(g)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};d.easing.jswing=d.easing.swing;d.extend(d.easing,{def:"easeOutQuad",swing:function(g,h,f,j,i){return d.easing[d.easing.def](g,h,f,j,i)},easeInQuad:function(g,h,f,j,i){return j*(h/=i)*h+f},easeOutQuad:function(g,h,f,j,i){return -j*(h/=i)*(h-2)+f},easeInOutQuad:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h+f}return -j/2*((--h)*(h-2)-1)+f},easeInCubic:function(g,h,f,j,i){return j*(h/=i)*h*h+f},easeOutCubic:function(g,h,f,j,i){return j*((h=h/i-1)*h*h+1)+f},easeInOutCubic:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h+f}return j/2*((h-=2)*h*h+2)+f},easeInQuart:function(g,h,f,j,i){return j*(h/=i)*h*h*h+f},easeOutQuart:function(g,h,f,j,i){return -j*((h=h/i-1)*h*h*h-1)+f},easeInOutQuart:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h+f}return -j/2*((h-=2)*h*h*h-2)+f},easeInQuint:function(g,h,f,j,i){return j*(h/=i)*h*h*h*h+f},easeOutQuint:function(g,h,f,j,i){return j*((h=h/i-1)*h*h*h*h+1)+f},easeInOutQuint:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h*h+f}return j/2*((h-=2)*h*h*h*h+2)+f},easeInSine:function(g,h,f,j,i){return -j*Math.cos(h/i*(Math.PI/2))+j+f},easeOutSine:function(g,h,f,j,i){return j*Math.sin(h/i*(Math.PI/2))+f},easeInOutSine:function(g,h,f,j,i){return -j/2*(Math.cos(Math.PI*h/i)-1)+f},easeInExpo:function(g,h,f,j,i){return(h==0)?f:j*Math.pow(2,10*(h/i-1))+f},easeOutExpo:function(g,h,f,j,i){return(h==i)?f+j:j*(-Math.pow(2,-10*h/i)+1)+f},easeInOutExpo:function(g,h,f,j,i){if(h==0){return f}if(h==i){return f+j}if((h/=i/2)<1){return j/2*Math.pow(2,10*(h-1))+f}return j/2*(-Math.pow(2,-10*--h)+2)+f},easeInCirc:function(g,h,f,j,i){return -j*(Math.sqrt(1-(h/=i)*h)-1)+f},easeOutCirc:function(g,h,f,j,i){return j*Math.sqrt(1-(h=h/i-1)*h)+f},easeInOutCirc:function(g,h,f,j,i){if((h/=i/2)<1){return -j/2*(Math.sqrt(1-h*h)-1)+f}return j/2*(Math.sqrt(1-(h-=2)*h)+1)+f},easeInElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h').appendTo(document.body).addClass(b.options.className).css({top:d.top,left:d.left,height:f.innerHeight(),width:f.innerWidth(),position:"absolute"}).animate(g,b.duration,b.options.easing,function(){c.remove();(b.callback&&b.callback.apply(f[0],arguments));f.dequeue()})})}})(jQuery);; \ No newline at end of file diff --git a/spec/test_app/public/javascripts/jquery.alerts/images/help.gif b/spec/test_app/public/javascripts/jquery.alerts/images/help.gif new file mode 100755 index 0000000..3b51425 Binary files /dev/null and b/spec/test_app/public/javascripts/jquery.alerts/images/help.gif differ diff --git a/spec/test_app/public/javascripts/jquery.alerts/images/important.gif b/spec/test_app/public/javascripts/jquery.alerts/images/important.gif new file mode 100755 index 0000000..41d4943 Binary files /dev/null and b/spec/test_app/public/javascripts/jquery.alerts/images/important.gif differ diff --git a/spec/test_app/public/javascripts/jquery.alerts/images/info.gif b/spec/test_app/public/javascripts/jquery.alerts/images/info.gif new file mode 100755 index 0000000..c81828d Binary files /dev/null and b/spec/test_app/public/javascripts/jquery.alerts/images/info.gif differ diff --git a/spec/test_app/public/javascripts/jquery.alerts/images/title.gif b/spec/test_app/public/javascripts/jquery.alerts/images/title.gif new file mode 100755 index 0000000..f92b596 Binary files /dev/null and b/spec/test_app/public/javascripts/jquery.alerts/images/title.gif differ diff --git a/spec/test_app/public/javascripts/jquery.alerts/jquery.alerts.css b/spec/test_app/public/javascripts/jquery.alerts/jquery.alerts.css new file mode 100755 index 0000000..5df7792 --- /dev/null +++ b/spec/test_app/public/javascripts/jquery.alerts/jquery.alerts.css @@ -0,0 +1,57 @@ +#popup_container { + font-family: Arial, sans-serif; + font-size: 12px; + min-width: 300px; /* Dialog will be no smaller than this */ + max-width: 600px; /* Dialog will wrap after this width */ + background: #FFF; + border: solid 5px #999; + color: #000; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; +} + +#popup_title { + font-size: 14px; + font-weight: bold; + text-align: center; + line-height: 1.75em; + color: #666; + background: #CCC url(images/title.gif) top repeat-x; + border: solid 1px #FFF; + border-bottom: solid 1px #999; + cursor: default; + padding: 0em; + margin: 0em; +} + +#popup_content { + background: 16px 16px no-repeat url(images/info.gif); + padding: 1em 1.75em; + margin: 0em; +} + +#popup_content.alert { + background-image: url(images/info.gif); +} + +#popup_content.confirm { + background-image: url(images/important.gif); +} + +#popup_content.prompt { + background-image: url(images/help.gif); +} + +#popup_message { + padding-left: 48px; +} + +#popup_panel { + text-align: center; + margin: 1em 0em 0em 1em; +} + +#popup_prompt { + margin: .5em 0em; +} \ No newline at end of file diff --git a/spec/test_app/public/javascripts/jquery.alerts/jquery.alerts.js b/spec/test_app/public/javascripts/jquery.alerts/jquery.alerts.js new file mode 100755 index 0000000..80b1c85 --- /dev/null +++ b/spec/test_app/public/javascripts/jquery.alerts/jquery.alerts.js @@ -0,0 +1,235 @@ +// jQuery Alert Dialogs Plugin +// +// Version 1.1 +// +// Cory S.N. LaViska +// A Beautiful Site (http://abeautifulsite.net/) +// 14 May 2009 +// +// Visit http://abeautifulsite.net/notebook/87 for more information +// +// Usage: +// jAlert( message, [title, callback] ) +// jConfirm( message, [title, callback] ) +// jPrompt( message, [value, title, callback] ) +// +// History: +// +// 1.00 - Released (29 December 2008) +// +// 1.01 - Fixed bug where unbinding would destroy all resize events +// +// License: +// +// This plugin is dual-licensed under the GNU General Public License and the MIT License and +// is copyright 2008 A Beautiful Site, LLC. +// +(function($) { + + $.alerts = { + + // These properties can be read/written by accessing $.alerts.propertyName from your scripts at any time + + verticalOffset: -75, // vertical offset of the dialog from center screen, in pixels + horizontalOffset: 0, // horizontal offset of the dialog from center screen, in pixels/ + repositionOnResize: true, // re-centers the dialog on window resize + overlayOpacity: .01, // transparency level of overlay + overlayColor: '#FFF', // base color of overlay + draggable: true, // make the dialogs draggable (requires UI Draggables plugin) + okButton: ' OK ', // text for the OK button + cancelButton: ' Cancel ', // text for the Cancel button + dialogClass: null, // if specified, this class will be applied to all dialogs + + // Public methods + + alert: function(message, title, callback) { + if( title == null ) title = 'Alert'; + $.alerts._show(title, message, null, 'alert', function(result) { + if( callback ) callback(result); + }); + }, + + confirm: function(message, title, callback) { + if( title == null ) title = 'Confirm'; + $.alerts._show(title, message, null, 'confirm', function(result) { + if( callback ) callback(result); + }); + }, + + prompt: function(message, value, title, callback) { + if( title == null ) title = 'Prompt'; + $.alerts._show(title, message, value, 'prompt', function(result) { + if( callback ) callback(result); + }); + }, + + // Private methods + + _show: function(title, msg, value, type, callback) { + + $.alerts._hide(); + $.alerts._overlay('show'); + + $("BODY").append( + ''); + + if( $.alerts.dialogClass ) $("#popup_container").addClass($.alerts.dialogClass); + + // IE6 Fix + var pos = ($.browser.msie && parseInt($.browser.version) <= 6 ) ? 'absolute' : 'fixed'; + + $("#popup_container").css({ + position: pos, + zIndex: 99999, + padding: 0, + margin: 0 + }); + + $("#popup_title").text(title); + $("#popup_content").addClass(type); + $("#popup_message").text(msg); + $("#popup_message").html( $("#popup_message").text().replace(/\n/g, '
') ); + + $("#popup_container").css({ + minWidth: $("#popup_container").outerWidth(), + maxWidth: $("#popup_container").outerWidth() + }); + + $.alerts._reposition(); + $.alerts._maintainPosition(true); + + switch( type ) { + case 'alert': + $("#popup_message").after(''); + $("#popup_ok").click( function() { + $.alerts._hide(); + callback(true); + }); + $("#popup_ok").focus().keypress( function(e) { + if( e.keyCode == 13 || e.keyCode == 27 ) $("#popup_ok").trigger('click'); + }); + break; + case 'confirm': + $("#popup_message").after(''); + $("#popup_ok").click( function() { + $.alerts._hide(); + if( callback ) callback(true); + }); + $("#popup_cancel").click( function() { + $.alerts._hide(); + if( callback ) callback(false); + }); + $("#popup_ok").focus(); + $("#popup_ok, #popup_cancel").keypress( function(e) { + if( e.keyCode == 13 ) $("#popup_ok").trigger('click'); + if( e.keyCode == 27 ) $("#popup_cancel").trigger('click'); + }); + break; + case 'prompt': + $("#popup_message").append('
').after(''); + $("#popup_prompt").width( $("#popup_message").width() ); + $("#popup_ok").click( function() { + var val = $("#popup_prompt").val(); + $.alerts._hide(); + if( callback ) callback( val ); + }); + $("#popup_cancel").click( function() { + $.alerts._hide(); + if( callback ) callback( null ); + }); + $("#popup_prompt, #popup_ok, #popup_cancel").keypress( function(e) { + if( e.keyCode == 13 ) $("#popup_ok").trigger('click'); + if( e.keyCode == 27 ) $("#popup_cancel").trigger('click'); + }); + if( value ) $("#popup_prompt").val(value); + $("#popup_prompt").focus().select(); + break; + } + + // Make draggable + if( $.alerts.draggable ) { + try { + $("#popup_container").draggable({ handle: $("#popup_title") }); + $("#popup_title").css({ cursor: 'move' }); + } catch(e) { /* requires jQuery UI draggables */ } + } + }, + + _hide: function() { + $("#popup_container").remove(); + $.alerts._overlay('hide'); + $.alerts._maintainPosition(false); + }, + + _overlay: function(status) { + switch( status ) { + case 'show': + $.alerts._overlay('hide'); + $("BODY").append(''); + $("#popup_overlay").css({ + position: 'absolute', + zIndex: 99998, + top: '0px', + left: '0px', + width: '100%', + height: $(document).height(), + background: $.alerts.overlayColor, + opacity: $.alerts.overlayOpacity + }); + break; + case 'hide': + $("#popup_overlay").remove(); + break; + } + }, + + _reposition: function() { + var top = (($(window).height() / 2) - ($("#popup_container").outerHeight() / 2)) + $.alerts.verticalOffset; + var left = (($(window).width() / 2) - ($("#popup_container").outerWidth() / 2)) + $.alerts.horizontalOffset; + if( top < 0 ) top = 0; + if( left < 0 ) left = 0; + + // IE6 fix + if( $.browser.msie && parseInt($.browser.version) <= 6 ) top = top + $(window).scrollTop(); + + $("#popup_container").css({ + top: top + 'px', + left: left + 'px' + }); + $("#popup_overlay").height( $(document).height() ); + }, + + _maintainPosition: function(status) { + if( $.alerts.repositionOnResize ) { + switch(status) { + case true: + $(window).bind('resize', $.alerts._reposition); + break; + case false: + $(window).unbind('resize', $.alerts._reposition); + break; + } + } + } + + } + + // Shortuct functions + jAlert = function(message, title, callback) { + $.alerts.alert(message, title, callback); + } + + jConfirm = function(message, title, callback) { + $.alerts.confirm(message, title, callback); + }; + + jPrompt = function(message, value, title, callback) { + $.alerts.prompt(message, value, title, callback); + }; + +})(jQuery); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/jquery.alerts/jquery.alerts.spree.css b/spec/test_app/public/javascripts/jquery.alerts/jquery.alerts.spree.css new file mode 100644 index 0000000..15913c0 --- /dev/null +++ b/spec/test_app/public/javascripts/jquery.alerts/jquery.alerts.spree.css @@ -0,0 +1,30 @@ +/* Spree Custom dialog styles */ +#popup_container.spree { + + color: #fff; + background: #005294; + border-color: #113F66; +} + +#popup_container.spree #popup_title { + color: #FFF; + font-weight: normal; + text-align: left; + background: #76A5CC; + border: solid 1px #005294; + padding-left: 1em; +} + +#popup_container.spree #popup_content { + background: none; +} + +#popup_container.spree #popup_message { + padding-left: 0em; +} + +#popup_container.spree INPUT[type='button'] { + border: outset 2px #76A5CC; + color: #fff; + background: #3778AE; +} \ No newline at end of file diff --git a/spec/test_app/public/javascripts/jquery.autocomplete.min.js b/spec/test_app/public/javascripts/jquery.autocomplete.min.js new file mode 100644 index 0000000..40ce05e --- /dev/null +++ b/spec/test_app/public/javascripts/jquery.autocomplete.min.js @@ -0,0 +1,13 @@ +/* + * jQuery Autocomplete plugin 1.1 + * + * Copyright (c) 2009 Jörn Zaefferer + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + * Revision: $Id: jquery.autocomplete.js 15 2009-08-22 10:30:27Z joern.zaefferer $ + */;(function($){$.fn.extend({autocomplete:function(urlOrData,options){var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:150},options);options.highlight=options.highlight||function(value){return value;};options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){new $.Autocompleter(this,options);});},result:function(handler){return this.bind("result",handler);},search:function(handler){return this.trigger("search",[handler]);},flushCache:function(){return this.trigger("flushCache");},setOptions:function(options){return this.trigger("setOptions",[options]);},unautocomplete:function(){return this.trigger("unautocomplete");}});$.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var $input=$(input).attr("autocomplete","off").addClass(options.inputClass);var timeout;var previousValue="";var cache=$.Autocompleter.Cache(options);var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config);var blockSubmit;$.browser.opera&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false;}});$input.bind(($.browser.opera?"keypress":"keydown")+".autocomplete",function(event){hasFocus=1;lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:event.preventDefault();if(select.visible()){select.prev();}else{onChange(0,true);}break;case KEY.DOWN:event.preventDefault();if(select.visible()){select.next();}else{onChange(0,true);}break;case KEY.PAGEUP:event.preventDefault();if(select.visible()){select.pageUp();}else{onChange(0,true);}break;case KEY.PAGEDOWN:event.preventDefault();if(select.visible()){select.pageDown();}else{onChange(0,true);}break;case options.multiple&&$.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.TAB:case KEY.RETURN:if(selectCurrent()){event.preventDefault();blockSubmit=true;return false;}break;case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break;}}).focus(function(){hasFocus++;}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults();}}).click(function(){if(hasFocus++>1&&!select.visible()){onChange(0,true);}}).bind("search",function(){var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i1){var seperator=options.multipleSeparator.length;var cursorAt=$(input).selection().start;var wordAt,progress=0;$.each(words,function(i,word){progress+=word.length;if(cursorAt<=progress){wordAt=i;return false;}progress+=seperator;});words[wordAt]=v;v=words.join(options.multipleSeparator);}v+=options.multipleSeparator;}$input.val(v);hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true;}function onChange(crap,skipPrevCheck){if(lastKeyPressCode==KEY.DEL){select.hide();return;}var currentValue=$input.val();if(!skipPrevCheck&¤tValue==previousValue)return;previousValue=currentValue;currentValue=lastWord(currentValue);if(currentValue.length>=options.minChars){$input.addClass(options.loadingClass);if(!options.matchCase)currentValue=currentValue.toLowerCase();request(currentValue,receiveData,hideResultsNow);}else{stopLoading();select.hide();}};function trimWords(value){if(!value)return[""];if(!options.multiple)return[$.trim(value)];return $.map(value.split(options.multipleSeparator),function(word){return $.trim(value).length?$.trim(word):null;});}function lastWord(value){if(!options.multiple)return value;var words=trimWords(value);if(words.length==1)return words[0];var cursorAt=$(input).selection().start;if(cursorAt==value.length){words=trimWords(value)}else{words=trimWords(value.replace(value.substring(cursorAt),""));}return words[words.length-1];}function autoFill(q,sValue){if(options.autoFill&&(lastWord($input.val()).toLowerCase()==q.toLowerCase())&&lastKeyPressCode!=KEY.BACKSPACE){$input.val($input.val()+sValue.substring(lastWord(previousValue).length));$(input).selection(previousValue.length,previousValue.length+sValue.length);}};function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200);};function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch){$input.search(function(result){if(!result){if(options.multiple){var words=trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""));}else{$input.val("");$input.trigger("result",null);}}});}};function receiveData(q,data){if(data&&data.length&&hasFocus){stopLoading();select.display(data,q);autoFill(q,data[0].value);select.show();}else{hideResultsNow();}};function request(term,success,failure){if(!options.matchCase)term=term.toLowerCase();var data=cache.load(term);if(data&&data.length){success(term,data);}else if((typeof options.url=="string")&&(options.url.length>0)){var extraParams={timestamp:+new Date()};$.each(options.extraParams,function(key,param){extraParams[key]=typeof param=="function"?param():param;});$.ajax({mode:"abort",port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term),limit:options.max},extraParams),success:function(data){var parsed=options.parse&&options.parse(data)||parse(data);cache.add(term,parsed);success(term,parsed);}});}else{select.emptyList();failure(term);}};function parse(data){var parsed=[];var rows=data.split("\n");for(var i=0;i]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"$1");},scroll:true,scrollHeight:180};$.Autocompleter.Cache=function(options){var data={};var length=0;function matchSubset(s,sub){if(!options.matchCase)s=s.toLowerCase();var i=s.indexOf(sub);if(options.matchContains=="word"){i=s.toLowerCase().search("\\b"+sub.toLowerCase());}if(i==-1)return false;return i==0||options.matchContains;};function add(q,value){if(length>options.cacheLength){flush();}if(!data[q]){length++;}data[q]=value;}function populate(){if(!options.data)return false;var stMatchSets={},nullData=0;if(!options.url)options.cacheLength=1;stMatchSets[""]=[];for(var i=0,ol=options.data.length;i0){var c=data[k];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub.push(x);}});}}return csub;}else +if(data[q]){return data[q];}else +if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var c=data[q.substr(0,i)];if(c){var csub=[];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub[csub.length]=x;}});return csub;}}}return null;}};};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",needsInit=true,element,list;function init(){if(!needsInit)return;element=$("
").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body);list=$("
    ").appendTo(element).mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()=='LI'){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE);}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);select();input.focus();return false;}).mousedown(function(){config.mouseDownOnSelect=true;}).mouseup(function(){config.mouseDownOnSelect=false;});if(options.width>0)element.css("width",options.width);needsInit=false;}function target(event){var element=event.target;while(element&&element.tagName!="LI")element=element.parentNode;if(!element)return[];return element;}function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight;});if((offset+activeItem[0].offsetHeight-list.scrollTop())>list[0].clientHeight){list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight());}else if(offset=listItems.size()){active=0;}}function limitNumberOfItems(available){return options.max&&options.max").html(options.highlight(formatted,term)).addClass(i%2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(li,"ac_data",data[i]);}listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0;}if($.fn.bgiframe)list.bgiframe();}return{display:function(d,q){init();data=d;term=q;fillList();},next:function(){moveSelect(1);},prev:function(){moveSelect(-1);},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active);}else{moveSelect(-8);}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active);}else{moveSelect(8);}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1;},visible:function(){return element&&element.is(":visible");},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0]);},show:function(){var offset=$(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:'auto'});if($.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight;});var scrollbarsVisible=listHeight>options.scrollHeight;list.css('height',scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")));}}}},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data");},emptyList:function(){list&&list.empty();},unbind:function(){element&&element.remove();}};};$.fn.selection=function(start,end){if(start!==undefined){return this.each(function(){if(this.createTextRange){var selRange=this.createTextRange();if(end===undefined||start==end){selRange.move("character",start);selRange.select();}else{selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}}else if(this.setSelectionRange){this.setSelectionRange(start,end);}else if(this.selectionStart){this.selectionStart=start;this.selectionEnd=end;}});}var field=this[0];if(field.createTextRange){var range=document.selection.createRange(),orig=field.value,teststring="<->",textLength=range.text.length;range.text=teststring;var caretAt=field.value.indexOf(teststring);field.value=orig;this.selection(caretAt,caretAt+textLength);return{start:caretAt,end:caretAt+textLength}}else if(field.selectionStart!==undefined){return{start:field.selectionStart,end:field.selectionEnd}}};})(jQuery); diff --git a/spec/test_app/public/javascripts/jquery.js b/spec/test_app/public/javascripts/jquery.js new file mode 100644 index 0000000..b1ae21d --- /dev/null +++ b/spec/test_app/public/javascripts/jquery.js @@ -0,0 +1,19 @@ +/* + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
    "]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
    ","
    "]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); +/* + * Sizzle CSS Selector Engine - v0.9.3 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

    ";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
    ";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
    ").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
    ';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/jquery.suggest.js b/spec/test_app/public/javascripts/jquery.suggest.js new file mode 100644 index 0000000..df8784f --- /dev/null +++ b/spec/test_app/public/javascripts/jquery.suggest.js @@ -0,0 +1,276 @@ + + /* + * jquery.suggest 1.1 - 2007-08-06 + * + * Uses code and techniques from following libraries: + * 1. http://www.dyve.net/jquery/?autocomplete + * 2. http://dev.jquery.com/browser/trunk/plugins/interface/iautocompleter.js + * + * All the new stuff written by Peter Vulgaris (www.vulgarisoip.com) + * Feel free to do whatever you want with this file + * + */ + + (function($) { + var defaults = { + delay: 100, + resultsClass: 'jquery-suggestion-results', + selectClass: 'jquery-suggestion-select', + matchClass: 'jquery-suggestion-match', + minchars: 2, + onSelect: function($input, $result) { + $input.val($result.data('autocomplete:value')); + }, + maxCacheSize: 65536, + source: '', + method: 'get', + dataType: 'json', + params: '', + queryParam: 'q' + }; + + $.suggest = function(input, options) { + options = $.extend({}, defaults, options); + + var $input = $(input).attr("autocomplete", "off"); + var $results = $('
      '); + + var timeout = false; // hold timeout ID for suggestion results to appear + var prevLength = 0; // last recorded length of $input.val() + var cache = []; // cache MRU list + var cacheSize = 0; // size of cache in chars (bytes?) + + $results.addClass(options.resultsClass).appendTo('body').hide(); + + resetPosition(); + $(window) + .load(resetPosition) // just in case user is changing size of page while loading + .resize(resetPosition); + + $input.blur(function() { + setTimeout(function() { $results.hide() }, 200); + }); + + // help IE users if possible + if ($results.bgiframe) $results.bgiframe(); + + // I really hate browser detection, but I don't see any other way + if ($.browser.mozilla) + $input.keypress(processKey); // onkeypress repeats arrow keys in Mozilla/Opera + else + $input.keydown(processKey); // onkeydown repeats arrow keys in IE/Safari + + function resetPosition() { + // requires jquery.dimension plugin + var offset = $input.offset(); + $results.css({ + top: (offset.top + input.offsetHeight) + 'px', + left: offset.left + 'px' + }); + } + + function processKey(e) { + // handling up/down/escape requires results to be visible + // handling enter/tab requires that AND a result to be selected + if ((/27$|38$|40$/.test(e.keyCode) && $results.is(':visible')) || + (/^13$|^9$/.test(e.keyCode) && getCurrentResult())) { + + if (e.preventDefault) + e.preventDefault(); + if (e.stopPropagation) + e.stopPropagation(); + + e.cancelBubble = true; + e.returnValue = false; + + switch(e.keyCode) { + case 38: // up + prevResult(); + break; + case 40: // down + nextResult(); + break; + case 9: // tab + case 13: // return + selectCurrentResult(); + break; + case 27: // escape + $results.hide(); + break; + } + } + else if ($input.val().length != prevLength) { + if (timeout) + clearTimeout(timeout); + timeout = setTimeout(suggest, options.delay); + prevLength = $input.val().length; + } + } + + function suggest() { + var q = $.trim($input.val()); + + if (q.length >= options.minchars) { + cached = checkCache(q); + if (cached) { + displayItems(cached['items']); + } + else { + var params = options.queryParam + '=' + q + (options.params.length ? '&' + options.params : ''); + $.ajax({ + type: options.method, + url: options.source, + dataType: options.dataType, + data: params, + success: function(data) { + $results.hide(); + + displayItems(data); + addToCache(q, data); + }, + error: function(xmlhttp, text) { + $results.hide(); + alert(text); + } + }); + } + } + else { + $results.hide(); + } + } + + function checkCache(q) { + for (var i = 0; i < cache.length; i++) + if (cache[i]['q'] == q) { + cache.unshift(cache.splice(i, 1)[0]); + return cache[0]; + } + return false; + } + + function addToCache(q, items) { + var size = 0; + $.each(items, function() { + ++size; + }); + + while (cache.length && (cacheSize + size > options.maxCacheSize)) { + var cached = cache.pop(); + cacheSize -= cached['size']; + } + + cache.push({ + q: q, + size: size, + items: items + }); + cacheSize += size; + } + + function displayItems(items) { + if (!items) + return; + var empty = true; + $results.empty(); + $.each(items, function(value, display) { + var $item = $('
    • ').html(display).data('autocomplete:value', value); + $results.append($item); + empty = false; + }); + + if (empty) { + $results.hide(); + return; + } + + resetPosition(); + $results + .width($input.width()) + .show() + .children('li') + .mouseover(function() { + $results.children('li').removeClass(options.selectClass); + $(this).addClass(options.selectClass); + }) + .click(function(e) { + e.preventDefault(); + e.stopPropagation(); + selectCurrentResult(); + }); + } + + function parseTxt(txt, q) { + var items = []; + var tokens = txt.split(options.delimiter); + + // parse returned data for non-empty items + for (var i = 0; i < tokens.length; i++) { + var token = $.trim(tokens[i]); + if (token) { + token = token.replace( + new RegExp(q, 'ig'), + function(q) { return '' + q + '' } + ); + items[items.length] = token; + } + } + return items; + } + + function getCurrentResult() { + if (!$results.is(':visible')) + return false; + + var $currentResult = $results.children('li.' + options.selectClass); + if (!$currentResult.length) + $currentResult = false; + + return $currentResult; + } + + function selectCurrentResult() { + $currentResult = getCurrentResult(); + + if ($currentResult) { + options.onSelect.call(this, $input, $currentResult); + $results.hide(); + } + } + + function nextResult() { + $currentResult = getCurrentResult(); + + if ($currentResult) + $currentResult + .removeClass(options.selectClass) + .next() + .addClass(options.selectClass); + else + $results.children('li:first-child').addClass(options.selectClass); + } + + function prevResult() { + $currentResult = getCurrentResult(); + + if ($currentResult) + $currentResult + .removeClass(options.selectClass) + .prev() + .addClass(options.selectClass); + else + $results.children('li:last-child').addClass(options.selectClass); + } + } + + $.fn.suggest = function(source, options) { + if (!source) + return; + options.source = source; + this.each(function() { + new $.suggest(this, options); + }); + return this; + }; + })(jQuery); + diff --git a/spec/test_app/public/javascripts/jquery.template.js b/spec/test_app/public/javascripts/jquery.template.js new file mode 100644 index 0000000..5ad757d --- /dev/null +++ b/spec/test_app/public/javascripts/jquery.template.js @@ -0,0 +1,255 @@ +/** + * jQuery Templates + * + * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) + * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. + * + * Written by: Stan Lemon + * + * Based off of the Ext.Template library, available at: + * http://www.extjs.com + * + * This library provides basic templating functionality, allowing for macro-based + * templates within jQuery. + * + * Basic Usage: + * + * var t = $.template('
      Hello ${name}, how are you ${question}? I am ${me:substr(0,10)}
      '); + * + * $(selector).append( t , { + * name: 'Stan', + * question: 'feeling', + * me: 'doing quite well myself, thank you very much!' + * }); + * + * Requires: jQuery 1.2+ + * + * + * @todo Add callbacks to the DOM manipulation methods, so that events can be bound + * to template nodes after creation. + */ +(function($){ + + /** + * Create a New Template + */ + $.template = function(html, options) { + return new $.template.instance(html, options); + }; + + /** + * Template constructor - Creates a new template instance. + * + * @param html The string of HTML to be used for the template. + * @param options An object of configurable options. Currently + * you can toggle compile as a boolean value and set a custom + * template regular expression on the property regx by + * specifying the key of the regx to use from the regx object. + */ + $.template.instance = function(html, options) { + // If a custom regular expression has been set, grab it from the regx object + if ( options && options['regx'] ) options.regx = this.regx[ options.regx ]; + + this.options = $.extend({ + compile: false, + regx: this.regx.standard + }, options || {}); + + this.html = html; + + if (this.options.compile) { + this.compile(); + } + this.isTemplate = true; + }; + + /** + * Regular Expression for Finding Variables + * + * The default pattern looks for variables in JSP style, the form of: ${variable} + * There are also regular expressions available for ext-style variables and + * jTemplate style variables. + * + * You can add your own regular expressions for variable ussage by doing. + * $.extend({ $.template.re , { + * myvartype: /...../g + * } + * + * Then when creating a template do: + * var t = $.template("
      ...
      ", { regx: 'myvartype' }); + */ + $.template.regx = $.template.instance.prototype.regx = { + jsp: /\$\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g, + ext: /\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g, + jtemplates: /\{\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}\}/g + }; + + /** + * Set the standard regular expression to be used. + */ + $.template.regx.standard = $.template.regx.jsp; + + /** + * Variable Helper Methods + * + * This is a collection of methods which can be used within the variable syntax, ie: + * ${variable:substr(0,30)} Which would only print a substring, 30 characters in length + * begining at the first character for the variable named "variable". + * + * A basic substring helper is provided as an example of how you can define helpers. + * To add more helpers simply do: + * $.extend( $.template.helpers , { + * sampleHelper: function() { ... } + * }); + */ + $.template.helpers = $.template.instance.prototype.helpers = { + substr : function(value, start, length){ + return String(value).substr(start, length); + } + }; + + + /** + * Template Instance Methods + */ + $.extend( $.template.instance.prototype, { + + /** + * Apply Values to a Template + * + * This is the macro-work horse of the library, it receives an object + * and the properties of that objects are assigned to the template, where + * the variables in the template represent keys within the object itself. + * + * @param values An object of properties mapped to template variables + */ + apply: function(values) { + if (this.options.compile) { + return this.compiled(values); + } else { + var tpl = this; + var fm = this.helpers; + + var fn = function(m, name, format, args) { + if (format) { + if (format.substr(0, 5) == "this."){ + return tpl.call(format.substr(5), values[name], values); + } else { + if (args) { + // quoted values are required for strings in compiled templates, + // but for non compiled we need to strip them + // quoted reversed for jsmin + var re = /^\s*['"](.*)["']\s*$/; + args = args.split(','); + + for(var i = 0, len = args.length; i < len; i++) { + args[i] = args[i].replace(re, "$1"); + } + args = [values[name]].concat(args); + } else { + args = [values[name]]; + } + + return fm[format].apply(fm, args); + } + } else { + return values[name] !== undefined ? values[name] : ""; + } + }; + + return this.html.replace(this.options.regx, fn); + } + }, + + /** + * Compile a template for speedier usage + */ + compile: function() { + var sep = $.browser.mozilla ? "+" : ","; + var fm = this.helpers; + + var fn = function(m, name, format, args){ + if (format) { + args = args ? ',' + args : ""; + + if (format.substr(0, 5) != "this.") { + format = "fm." + format + '('; + } else { + format = 'this.call("'+ format.substr(5) + '", '; + args = ", values"; + } + } else { + args= ''; format = "(values['" + name + "'] == undefined ? '' : "; + } + return "'"+ sep + format + "values['" + name + "']" + args + ")"+sep+"'"; + }; + + var body; + + if ($.browser.mozilla) { + body = "this.compiled = function(values){ return '" + + this.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.options.regx, fn) + + "';};"; + } else { + body = ["this.compiled = function(values){ return ['"]; + body.push(this.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.options.regx, fn)); + body.push("'].join('');};"); + body = body.join(''); + } + eval(body); + return this; + } + }); + + + /** + * Save a reference in this local scope to the original methods which we're + * going to overload. + **/ + var $_old = { + domManip: $.fn.domManip, + text: $.fn.text, + html: $.fn.html + }; + + /** + * Overwrite the domManip method so that we can use things like append() by passing a + * template object and macro parameters. + */ + $.fn.domManip = function( args, table, reverse, callback ) { + if (args[0].isTemplate) { + // Apply the template and it's arguments... + args[0] = args[0].apply( args[1] ); + // Get rid of the arguements, we don't want to pass them on + delete args[1]; + } + + // Call the original method + var r = $_old.domManip.apply(this, arguments); + + return r; + }; + + /** + * Overwrite the html() method + */ + $.fn.html = function( value , o ) { + if (value && value.isTemplate) var value = value.apply( o ); + + var r = $_old.html.apply(this, [value]); + + return r; + }; + + /** + * Overwrite the text() method + */ + $.fn.text = function( value , o ) { + if (value && value.isTemplate) var value = value.apply( o ); + + var r = $_old.text.apply(this, [value]); + + return r; + }; + +})(jQuery); diff --git a/spec/test_app/public/javascripts/jquery.tokeninput.js b/spec/test_app/public/javascripts/jquery.tokeninput.js new file mode 100644 index 0000000..942c259 --- /dev/null +++ b/spec/test_app/public/javascripts/jquery.tokeninput.js @@ -0,0 +1,618 @@ +/* + * jQuery Plugin: Tokenizing Autocomplete Text Entry + * Version 1.1 + * + * Copyright (c) 2009 James Smith (http://loopj.com) + * Licensed jointly under the GPL and MIT licenses, + * choose which one suits your project best! + * + */ + +(function($) { + +$.fn.tokenInput = function (url, options) { + var settings = $.extend({ + url: url, + hintText: "Type in a search term", + noResultsText: "No results", + searchingText: "Searching...", + searchDelay: 300, + prePopulateFromInput: false, + minChars: 1, + tokenLimit: null, + jsonContainer: null, + method: "GET", + contentType: "json", + queryParam: "q", + onResult: null + }, options); + + settings.classes = $.extend({ + tokenList: "token-input-list", + token: "token-input-token", + tokenDelete: "token-input-delete-token", + selectedToken: "token-input-selected-token", + highlightedToken: "token-input-highlighted-token", + dropdown: "token-input-dropdown", + dropdownItem: "token-input-dropdown-item", + dropdownItem2: "token-input-dropdown-item2", + selectedDropdownItem: "token-input-selected-dropdown-item", + inputToken: "token-input-input-token" + }, options.classes); + + return this.each(function () { + var list = new $.TokenList(this, settings); + }); +}; + +$.TokenList = function (input, settings) { + // + // Variables + // + + // Input box position "enum" + var POSITION = { + BEFORE: 0, + AFTER: 1, + END: 2 + }; + + // Keys "enum" + var KEY = { + BACKSPACE: 8, + TAB: 9, + RETURN: 13, + ESC: 27, + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + COMMA: 188 + }; + + // Save the tokens + var saved_tokens = []; + + // Keep track of the number of tokens in the list + var token_count = 0; + + // Basic cache to save on db hits + var cache = new $.TokenList.Cache(); + + // Keep track of the timeout + var timeout; + + // Create a new text input an attach keyup events + var input_box = $("") + .css({ + outline: "none" + }) + .focus(function () { + if (settings.tokenLimit == null || settings.tokenLimit != token_count) { + show_dropdown_hint(); + } + }) + .blur(function () { + hide_dropdown(); + }) + .keydown(function (event) { + var previous_token; + var next_token; + + switch(event.keyCode) { + case KEY.LEFT: + case KEY.RIGHT: + case KEY.UP: + case KEY.DOWN: + if(!$(this).val()) { + previous_token = input_token.prev(); + next_token = input_token.next(); + + if((previous_token.length && previous_token.get(0) === selected_token) || (next_token.length && next_token.get(0) === selected_token)) { + // Check if there is a previous/next token and it is selected + if(event.keyCode == KEY.LEFT || event.keyCode == KEY.UP) { + deselect_token($(selected_token), POSITION.BEFORE); + } else { + deselect_token($(selected_token), POSITION.AFTER); + } + } else if((event.keyCode == KEY.LEFT || event.keyCode == KEY.UP) && previous_token.length) { + // We are moving left, select the previous token if it exists + select_token($(previous_token.get(0))); + } else if((event.keyCode == KEY.RIGHT || event.keyCode == KEY.DOWN) && next_token.length) { + // We are moving right, select the next token if it exists + select_token($(next_token.get(0))); + } + } else { + var dropdown_item = null; + + if(event.keyCode == KEY.DOWN || event.keyCode == KEY.RIGHT) { + dropdown_item = $(selected_dropdown_item).next(); + } else { + dropdown_item = $(selected_dropdown_item).prev(); + } + + if(dropdown_item.length) { + select_dropdown_item(dropdown_item); + } + return false; + } + break; + + case KEY.BACKSPACE: + previous_token = input_token.prev(); + + if(!$(this).val().length) { + if(selected_token) { + delete_token($(selected_token)); + } else if(previous_token.length) { + select_token($(previous_token.get(0))); + } + + return false; + } else if($(this).val().length == 1) { + hide_dropdown(); + } else { + // set a timeout just long enough to let this function finish. + setTimeout(function(){do_search(false);}, 5); + } + break; + + case KEY.TAB: + case KEY.RETURN: + case KEY.COMMA: + if(selected_dropdown_item) { + add_token($(selected_dropdown_item)); + return false; + } + break; + + case KEY.ESC: + hide_dropdown(); + return true; + + default: + if(is_printable_character(event.keyCode)) { + // set a timeout just long enough to let this function finish. + setTimeout(function(){do_search(false);}, 5); + } + break; + } + }); + + // Keep a reference to the original input box + var hidden_input = $(input) + .hide() + .focus(function () { + input_box.focus(); + }) + .blur(function () { + input_box.blur(); + }); + + + if(settings.prePopulateFromInput){ + settings.prePopulate = []; + if(hidden_input.attr('data-names') != undefined){ + var names = $.parseJSON(hidden_input.attr('data-names')); + } + $.each(hidden_input.val().trim().split(','), function(i, val) { + if(val != '' && names != undefined && names[val] != undefined){ + settings.prePopulate.push({ id : val, name : names[val] }); + } + }); + hidden_input.val(hidden_input.val() + ','); + + } + + + // Keep a reference to the selected token and dropdown item + var selected_token = null; + var selected_dropdown_item = null; + + // The list to store the token items in + var token_list = $("
        ") + .addClass(settings.classes.tokenList) + .insertAfter(hidden_input) + .click(function (event) { + var li = get_element_from_event(event, "li"); + if(li && li.get(0) != input_token.get(0)) { + toggle_select_token(li); + return false; + } else { + input_box.focus(); + + if(selected_token) { + deselect_token($(selected_token), POSITION.END); + } + } + }) + .mouseover(function (event) { + var li = get_element_from_event(event, "li"); + if(li && selected_token !== this) { + li.addClass(settings.classes.highlightedToken); + } + }) + .mouseout(function (event) { + var li = get_element_from_event(event, "li"); + if(li && selected_token !== this) { + li.removeClass(settings.classes.highlightedToken); + } + }) + .mousedown(function (event) { + // Stop user selecting text on tokens + var li = get_element_from_event(event, "li"); + if(li){ + return false; + } + }); + + + // The list to store the dropdown items in + var dropdown = $("
        ") + .addClass(settings.classes.dropdown) + .insertAfter(token_list) + .hide(); + + // The token holding the input box + var input_token = $("
      • ") + .addClass(settings.classes.inputToken) + .appendTo(token_list) + .append(input_box); + + init_list(); + + // + // Functions + // + + + // Pre-populate list if items exist + function init_list () { + li_data = settings.prePopulate; + + if(li_data && li_data.length) { + for(var i in li_data) { + var this_token = $("
      • "+li_data[i].name+"

      • ") + .addClass(settings.classes.token) + .insertBefore(input_token); + + $("x") + .addClass(settings.classes.tokenDelete) + .appendTo(this_token) + .click(function () { + delete_token($(this).parent()); + return false; + }); + + $.data(this_token.get(0), "tokeninput", {"id": li_data[i].id, "name": li_data[i].name}); + + // Clear input box and make sure it keeps focus + input_box + .val("") + .focus(); + + // Don't show the help dropdown, they've got the idea + hide_dropdown(); + + // Save this token id + var id_string = li_data[i].id + "," + + // Leave input value alone if using prePopulateFromInput + if(!settings.prePopulateFromInput){ + hidden_input.val(hidden_input.val() + id_string); + } + } + } + + } + + + function is_printable_character(keycode) { + if((keycode >= 48 && keycode <= 90) || // 0-1a-z + (keycode >= 96 && keycode <= 111) || // numpad 0-9 + - / * . + (keycode >= 186 && keycode <= 192) || // ; = , - . / ^ + (keycode >= 219 && keycode <= 222) // ( \ ) ' + ) { + return true; + } else { + return false; + } + } + + // Get an element of a particular type from an event (click/mouseover etc) + function get_element_from_event (event, element_type) { + var target = $(event.target); + var element = null; + + if(target.is(element_type)) { + element = target; + } else if(target.parent(element_type).length) { + element = target.parent(element_type+":first"); + } + + return element; + } + + // Inner function to a token to the list + function insert_token(id, value) { + var this_token = $("
      • "+ value +"

      • ") + .addClass(settings.classes.token) + .insertBefore(input_token); + + // The 'delete token' button + $("x") + .addClass(settings.classes.tokenDelete) + .appendTo(this_token) + .click(function () { + delete_token($(this).parent()); + return false; + }); + + $.data(this_token.get(0), "tokeninput", {"id": id, "name": value}); + + return this_token; + } + + // Add a token to the token list based on user input + function add_token (item) { + var li_data = $.data(item.get(0), "tokeninput"); + var this_token = insert_token(li_data.id, li_data.name); + + // Clear input box and make sure it keeps focus + input_box + .val("") + .focus(); + + // Don't show the help dropdown, they've got the idea + hide_dropdown(); + + // Save this token id + var id_string = li_data.id + "," + hidden_input.val(hidden_input.val() + id_string); + + token_count++; + + if(settings.tokenLimit != null && settings.tokenLimit >= token_count) { + input_box.hide(); + hide_dropdown(); + } + } + + // Select a token in the token list + function select_token (token) { + token.addClass(settings.classes.selectedToken); + selected_token = token.get(0); + + // Hide input box + input_box.val(""); + + // Hide dropdown if it is visible (eg if we clicked to select token) + hide_dropdown(); + } + + // Deselect a token in the token list + function deselect_token (token, position) { + token.removeClass(settings.classes.selectedToken); + selected_token = null; + + if(position == POSITION.BEFORE) { + input_token.insertBefore(token); + } else if(position == POSITION.AFTER) { + input_token.insertAfter(token); + } else { + input_token.appendTo(token_list); + } + + // Show the input box and give it focus again + input_box.focus(); + } + + // Toggle selection of a token in the token list + function toggle_select_token (token) { + if(selected_token == token.get(0)) { + deselect_token(token, POSITION.END); + } else { + if(selected_token) { + deselect_token($(selected_token), POSITION.END); + } + select_token(token); + } + } + + // Delete a token from the token list + function delete_token (token) { + // Remove the id from the saved list + var token_data = $.data(token.get(0), "tokeninput"); + + // Delete the token + token.remove(); + selected_token = null; + + // Show the input box and give it focus again + input_box.focus(); + + // Delete this token's id from hidden input + var str = hidden_input.val() + var start = str.indexOf(token_data.id+","); + var end = str.indexOf(",", start) + 1; + + if(end >= str.length) { + hidden_input.val(str.slice(0, start)); + } else { + hidden_input.val(str.slice(0, start) + str.slice(end, str.length)); + } + + token_count--; + + if (settings.tokenLimit != null) { + input_box + .show() + .val("") + .focus(); + } + } + + // Hide and clear the results dropdown + function hide_dropdown () { + dropdown.hide().empty(); + selected_dropdown_item = null; + } + + function show_dropdown_searching () { + dropdown + .html("

        "+settings.searchingText+"

        ") + .show(); + } + + function show_dropdown_hint () { + dropdown + .html("

        "+settings.hintText+"

        ") + .show(); + } + + // Highlight the query part of the search term + function highlight_term(value, term) { + return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1"); + } + + // Populate the results dropdown with some results + function populate_dropdown (query, results) { + if(results.length) { + dropdown.empty(); + var dropdown_ul = $("
          ") + .appendTo(dropdown) + .mouseover(function (event) { + select_dropdown_item(get_element_from_event(event, "li")); + }) + .mousedown(function (event) { + add_token(get_element_from_event(event, "li")); + return false; + }) + .hide(); + + for(var i in results) { + if (results.hasOwnProperty(i)) { + var this_li = $("
        • "+highlight_term(results[i].name, query)+"
        • ") + .appendTo(dropdown_ul); + + if(i%2) { + this_li.addClass(settings.classes.dropdownItem); + } else { + this_li.addClass(settings.classes.dropdownItem2); + } + + if(i == 0) { + select_dropdown_item(this_li); + } + + $.data(this_li.get(0), "tokeninput", {"id": results[i].id, "name": results[i].name}); + } + } + + dropdown.show(); + dropdown_ul.slideDown("fast"); + + } else { + dropdown + .html("

          "+settings.noResultsText+"

          ") + .show(); + } + } + + // Highlight an item in the results dropdown + function select_dropdown_item (item) { + if(item) { + if(selected_dropdown_item) { + deselect_dropdown_item($(selected_dropdown_item)); + } + + item.addClass(settings.classes.selectedDropdownItem); + selected_dropdown_item = item.get(0); + } + } + + // Remove highlighting from an item in the results dropdown + function deselect_dropdown_item (item) { + item.removeClass(settings.classes.selectedDropdownItem); + selected_dropdown_item = null; + } + + // Do a search and show the "searching" dropdown if the input is longer + // than settings.minChars + function do_search(immediate) { + var query = input_box.val().toLowerCase(); + + if (query && query.length) { + if(selected_token) { + deselect_token($(selected_token), POSITION.AFTER); + } + if (query.length >= settings.minChars) { + show_dropdown_searching(); + if (immediate) { + run_search(query); + } else { + clearTimeout(timeout); + timeout = setTimeout(function(){run_search(query);}, settings.searchDelay); + } + } else { + hide_dropdown(); + } + } + } + + // Do the actual search + function run_search(query) { + var cached_results = cache.get(query); + if(cached_results) { + populate_dropdown(query, cached_results); + } else { + var queryStringDelimiter = settings.url.indexOf("?") < 0 ? "?" : "&"; + var callback = function(results) { + if($.isFunction(settings.onResult)) { + results = settings.onResult.call(this, results); + } + cache.add(query, settings.jsonContainer ? results[settings.jsonContainer] : results); + populate_dropdown(query, settings.jsonContainer ? results[settings.jsonContainer] : results); + }; + + if(settings.method == "POST") { + $.post(settings.url + queryStringDelimiter + settings.queryParam + "=" + query, {}, callback, settings.contentType); + } else { + $.get(settings.url + queryStringDelimiter + settings.queryParam + "=" + query, {}, callback, settings.contentType); + } + } + } +}; + +// Really basic cache for the results +$.TokenList.Cache = function (options) { + var settings = $.extend({ + max_size: 50 + }, options); + + var data = {}; + var size = 0; + + var flush = function () { + data = {}; + size = 0; + }; + + this.add = function (query, results) { + if(size > settings.max_size) { + flush(); + } + + if(!data[query]) { + size++; + } + + data[query] = results; + }; + + this.get = function (query) { + return data[query]; + }; +}; + +})(jQuery); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/jquery.validate.min.js b/spec/test_app/public/javascripts/jquery.validate.min.js new file mode 100644 index 0000000..a1a5fbb --- /dev/null +++ b/spec/test_app/public/javascripts/jquery.validate.min.js @@ -0,0 +1,16 @@ +/* + * jQuery validation plug-in 1.5.5 + * + * http://bassistance.de/jquery-plugins/jquery-plugin-validation/ + * http://docs.jquery.com/Plugins/Validation + * + * Copyright (c) 2006 - 2008 Jörn Zaefferer + * + * $Id: jquery.validate.js 6403 2009-06-17 14:27:16Z joern.zaefferer $ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ +(function($){$.extend($.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return;}var validator=$.data(this[0],'validator');if(validator){return validator;}validator=new $.validator(options,this[0]);$.data(this[0],'validator',validator);if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){validator.cancelSubmit=true;});if(validator.settings.submitHandler){this.find("input, button").filter(":submit").click(function(){validator.submitButton=this;});}this.submit(function(event){if(validator.settings.debug)event.preventDefault();function handle(){if(validator.settings.submitHandler){if(validator.submitButton){var hidden=$("").attr("name",validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm);}validator.settings.submitHandler.call(validator,validator.currentForm);if(validator.submitButton){hidden.remove();}return false;}return true;}if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();}if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;}return handle();}else{validator.focusInvalid();return false;}});}return validator;},valid:function(){if($(this[0]).is('form')){return this.validate().form();}else{var valid=true;var validator=$(this[0].form).validate();this.each(function(){valid&=validator.element(this);});return valid;}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value);$element.removeAttr(value);});return result;},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,'validator').settings;var staticRules=settings.rules;var existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));staticRules[element.name]=existingRules;if(argument.messages)settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages);break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;}var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];});return filtered;}}var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data);}return data;}});$.extend($.expr[":"],{blank:function(a){return!$.trim(a.value);},filled:function(a){return!!$.trim(a.value);},unchecked:function(a){return!a.checked;}});$.validator=function(options,form){this.settings=$.extend({},$.validator.defaults,options);this.currentForm=form;this.init();};$.validator.format=function(source,params){if(arguments.length==1)return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args);};if(arguments.length>2&¶ms.constructor!=Array){params=$.makeArray(arguments).slice(1);}if(params.constructor!=Array){params=[params];}$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n);});return source;};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass);this.errorsFor(element).hide();}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element);}},onclick:function(element){if(element.name in this.submitted)this.element(element);},highlight:function(element,errorClass,validClass){$(element).addClass(errorClass).removeClass(validClass);},unhighlight:function(element,errorClass,validClass){$(element).removeClass(errorClass).addClass(validClass);}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",dateDE:"Bitte geben Sie ein gültiges Datum ein.",number:"Please enter a valid number.",numberDE:"Bitte geben Sie eine Nummer ein.",digits:"Please enter only digits",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key;});});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value);});function delegate(event){var validator=$.data(this[0].form,"validator");validator.settings["on"+event.type]&&validator.settings["on"+event.type].call(validator,this[0]);}$(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",delegate).delegate("click",":radio, :checkbox",delegate);if(this.settings.invalidHandler)$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler);},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid())$(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);}return this.valid();},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);this.currentElements=$(element);var result=this.check(element);if(result){delete this.invalid[element.name];}else{this.invalid[element.name]=true;}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);}this.showErrors();return result;},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]});}this.successList=$.grep(this.successList,function(element){return!(element.name in errors);});}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if($.fn.resetForm)$(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0;for(var i in obj)count++;return count;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus();}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name==lastActive.name;}).length==1&&lastActive;},elements:function(){var validator=this,rulesCache={};return $([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules()))return false;rulesCache[this.name]=true;return true;});},clean:function(selector){return $(selector)[0];},errors:function(){return $(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.formSubmitted=false;this.currentElements=$([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name)[0];}var rules=$(element).rules();var dependencyMismatch=false;for(method in rules){var rule={method:method,parameters:rules[method]};try{var result=$.validator.methods[method].call(this,element.value.replace(/\r/g,""),element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue;}dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;}if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id ++", check the '"+rule.method+"' method");throw e;}}if(dependencyMismatch)return;if(this.objectLength(rules))this.successList.push(element);return true;},customMetaMessage:function(element,method){if(!$.metadata)return;var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method];},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method]);},findDefined:function(){for(var i=0;iWarning: No message defined for "+element.name+"");},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method);if(typeof message=="function")message=message.call(this,rule.parameters,element);this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper)toToggle=toToggle.add(toToggle.parent(this.settings.wrapper));return toToggle;},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass);this.showLabel(error.element,error.message);}if(this.errorList.length){this.toShow=this.toShow.add(this.containers);}if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}}if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return $(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message);}else{label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();}if(!this.labelContainer.append(label).length)this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element);}if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label);}this.toShow=this.toShow.add(label);},errorsFor:function(element){return this.errors().filter("[for='"+this.idOrName(element)+"']");},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},checkable:function(element){return/radio|checkbox/i.test(element.type);},findByName:function(name){var form=this.currentForm;return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null;});},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case'select':return $("option:selected",element).length;case'input':if(this.checkable(element))return this.findByName(element.name).filter(':checked').length;}return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param,element){return param;},"string":function(param,element){return!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){return!$.validator.methods.required.call(this,$.trim(element.value),element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();}else if(!valid&&this.pendingRequest==0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",previous={old:null,valid:true,message:this.defaultMessage(element,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className);},classRules:function(element){var rules={};var classes=$(element).attr('class');classes&&$.each(classes.split(' '),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this]);}});return rules;},attributeRules:function(element){var rules={};var $element=$(element);for(method in $.validator.methods){var value=$element.attr(method);if(value){rules[method]=value;}}if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;}return rules;},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,'validator').settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata();},staticRules:function(element){var rules={};var validator=$.data(element.form,'validator');if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{};}return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;}if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;}if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules[prop];}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter;});$.each(['minlength','maxlength','min','max'],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(['rangelength','range'],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;}if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}}if(rules.messages){delete rules.messages}return rules;},normalizeRule:function(data){if(typeof data=="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;}return data;},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message||$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element))return"dependency-mismatch";switch(element.nodeName.toLowerCase()){case'select':var options=$("option:selected",element);return options.length>0&&(element.type=="select-multiple"||($.browser.msie&&!(options[0].attributes['value'].specified)?options[0].text:options[0].value).length>0);case'input':if(this.checkable(element))return this.getLength(value,element)>0;default:return $.trim(value).length>0;}},remote:function(value,element,param){if(this.optional(element))return"dependency-mismatch";var previous=this.previousValue(element);if(!this.settings.messages[element.name])this.settings.messages[element.name]={};this.settings.messages[element.name].remote=typeof previous.message=="function"?previous.message(value):previous.message;param=typeof param=="string"&&{url:param}||param;if(previous.old!==value){previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){var valid=response===true;if(valid){var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors();}else{var errors={};errors[element.name]=previous.message=response||validator.defaultMessage(element,"remote");validator.showErrors(errors);}previous.valid=valid;validator.stopRequest(element,valid);}},param));return"pending";}else if(this.pending[element.name]){return"pending";}return previous.valid;},minlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)>=param;},maxlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)<=param;},rangelength:function(value,element,param){var length=this.getLength($.trim(value),element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},min:function(value,element,param){return this.optional(element)||value>=param;},max:function(value,element,param){return this.optional(element)||value<=param;},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value));},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);},dateDE:function(value,element){return this.optional(element)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(value);},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);},numberDE:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},creditcard:function(value,element){if(this.optional(element))return"dependency-mismatch";if(/[^0-9-]+/.test(value))return false;var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9)nDigit-=9;}nCheck+=nDigit;bEven=!bEven;}return(nCheck%10)==0;},accept:function(value,element,param){param=typeof param=="string"?param.replace(/,/g,'|'):"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"));},equalTo:function(value,element,param){return value==$(param).val();}}});$.format=$.validator.format;})(jQuery);;(function($){var ajax=$.ajax;var pendingRequests={};$.ajax=function(settings){settings=$.extend(settings,$.extend({},$.ajaxSettings,settings));var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}return(pendingRequests[port]=ajax.apply(this,arguments));}return ajax.apply(this,arguments);};})(jQuery);;(function($){$.each({focus:'focusin',blur:'focusout'},function(original,fix){$.event.special[fix]={setup:function(){if($.browser.msie)return false;this.addEventListener(original,$.event.special[fix].handler,true);},teardown:function(){if($.browser.msie)return false;this.removeEventListener(original,$.event.special[fix].handler,true);},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments);}};});$.extend($.fn,{delegate:function(type,delegate,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments);}});},triggerEvent:function(type,target){return this.triggerHandler(type,[$.event.fix({type:type,target:target})]);}})})(jQuery); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/jrails.autocomplete.js b/spec/test_app/public/javascripts/jrails.autocomplete.js new file mode 100644 index 0000000..a2cddc2 --- /dev/null +++ b/spec/test_app/public/javascripts/jrails.autocomplete.js @@ -0,0 +1,274 @@ +(function($) { + function stopEvent(e) { + e.preventDefault(); + e.stopPropagation(); + e.stopped = true; + } + + function getFirstDifferencePos(newS, oldS) { + var boundary = Math.min(newS.length, oldS.length); + for (var index = 0; index < boundary; ++index) + if (newS[index] != oldS[index]) return index; + return boundary; + } + + var AutoComplete = function(element, update, url, options) { + var autocomplete = this; + + this.element = element; + this.url = url; + this.update = update; + this.hasFocus = false; + this.changed = false; + this.active = false; + this.index = 0; + this.entryCount = 0; + this.oldElementValue = this.element.value; + this.observer = null; + this.options = $.extend({ + paramName: this.element.name, + type: 'GET', + tokens: [], + frequency: 0.4, + minChars: 1, + onShow: function(element, update) { + if (!update.style.position || update.style.position == 'absolute') { + var position = $(element).position(); + $(update).css({ + position: 'absolute', + left: position.left + 'px', + top: $(element).outerHeight() + position.top + 'px', + width: $(element).outerWidth() + 'px' + }); + } + $(update).fadeIn(); + }, + onHide: function(element, update) { + $(update).fadeOut(); + } + }, options); + + if (typeof(this.options.tokens) == 'string') { + this.options.tokens = new Array(this.options.tokens); + } + if (!$.inArray("\n", this.options.tokens)) { + this.options.tokens.push("\n"); + } + + $(this.update).hide(); + $(this.element).attr('autocomplete', 'off') + .blur(function(e) { autocomplete.onBlur(e); }) + .keypress(function(e) { autocomplete.onKeyPress(e); }); + } + $.extend(AutoComplete.prototype, { + show: function() { + if ($(this.update).not(':visible')) this.options.onShow(this.element, this.update); + }, + hide: function() { + this.stopIndicator(); + if ($(this.update).is(':visible')) this.options.onHide(this.element, this.update); + }, + startIndicator: function() { + if (this.options.indicator) $('#' + this.options.indicator).show(); + }, + stopIndicator: function() { + if (this.options.indicator) $('#' + this.options.indicator).hide(); + }, + onKeyPress: function(e) { + var autocomplete = this; + + if (this.active) { + switch (e.keyCode) { + case 9: // tab + case 13: // return + this.selectEntry(); + stopEvent(e); + case 27: // esc + this.hide(); + this.active = false; + stopEvent(e); + case 37: // left + case 39: // right + return; + case 38: // up + this.markPrevious(); + this.render(); + stopEvent(e); + return; + case 40: // down + this.markNext(); + this.render(); + stopEvent(e); + return; + } + } + else if (e.keyCode == 9 || e.keyCode == 13) return; + + this.changed = this.hasFocus = true; + if (this.observer) clearTimeout(this.observer); + this.observer = setTimeout(function() { autocomplete.onObserverEvent(); }, this.frequency * 1000); + }, + activate: function() { + this.changed = false; + this.hasFocus = true; + this.getUpdatedChoices(); + }, + onHover: function(e) { + if (this.index != e.target.autocompleteIndex) { + this.index = e.target.autocompleteIndex; + this.render(); + } + stopEvent(e); + }, + onClick: function(e) { + this.index = e.target.autocompleteIndex; + this.selectEntry(); + this.hide(); + }, + onBlur: function(e) { + var autocomplete = this; + setTimeout(function() { autocomplete.hide(); }, 250); + this.active = this.hasFocus = false; + }, + render: function() { + if (this.entryCount > 0) { + for (var i = 0; i < this.entryCount; ++i) { + $(this.getEntry(i))[this.index == i ? 'addClass' : 'removeClass']('selected'); + } + if (this.hasFocus) { + this.show(); + this.active = true; + } + } + else { + this.active = false; + this.hide(); + } + }, + markPrevious: function() { + if (this.index > 0) --this.index; + else this.index = this.entryCount - 1; + }, + markNext: function() { + if (this.index < this.entryCount - 1) ++this.index; + else this.index = 0; + }, + getEntry: function(i) { + return $(this.update.firstChild).children('li').get(i); + }, + getCurrentEntry: function() { + return this.getEntry(this.index); + }, + selectEntry: function() { + this.active = false; + this.updateElement(this.getCurrentEntry()); + }, + updateElement: function(element) { + if (this.options.updateElement) { + this.options.updateElement(element); + return; + } + + var value = $.trim(this.options.select ? + $('.' + this.options.select, element).text() : + $(element).text()); + + var bounds = this.getTokenBounds(); + if (bounds[0] != -1) { + var newValue = this.element.value.substr(0, bounds[0]); + var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/); + if (whitespace) newValue += whitespace[0]; + this.element.value = newValue + value + this.element.value.substr(bounds[1]); + } + else { + this.element.value = value; + } + + this.oldElementValue = $(this.element).focus().val(); + + if (this.options.afterUpdateElement) this.options.afterUpdateElement(this.element, element); + }, + updateChoices: function(choices) { + if (!this.changed && this.hasFocus) { + $(this.update).html($.trim(choices)); + var i = 0, autocomplete = this; + this.entryCount = $(this.update.firstChild).children('li').each(function() { + this.autocompleteIndex = i++; + autocomplete.addObservers(this); + }).length; + } + + this.stopIndicator(); + this.index = 0; + + if (this.entryCount == 1 && this.options.autoSelect) { + this.selectEntry(); + this.hide(); + } + else { + this.render(); + } + }, + addObservers: function(element) { + var autocomplete = this; + $(element) + .mouseover(function(e) { autocomplete.onHover(e); }) + .click(function(e) { autocomplete.onClick(e); }); + }, + onObserverEvent: function() { + this.changed = false; + this.tokenBounds = null; + if (this.getToken().length >= this.options.minChars) { + this.getUpdatedChoices(); + } + else { + this.active = false; + this.hide(); + } + this.oldElementValue = this.element.value; + }, + getToken: function() { + var bounds = this.getTokenBounds(); + return $.trim(this.element.value.substring(bounds[0], bounds[1])); + }, + getTokenBounds: function() { + if (null != this.tokenBounds) return this.tokenBounds; + var value = $.trim(this.element.value); + if (!value.length) return [-1, 0]; + var diff = getFirstDifferencePos(value, this.oldElementValue); + var offset = (diff == this.oldElementValue.length ? 1 : 0); + var prevTokenPos = -1, nextTokenPos = value.length; + for (var tp = null, index = 0, l = this.options.tokens.length; index < l; ++index) { + tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1); + if (tp > prevTokenPos) prevTokenPos = tp; + tp = value.indexOf(this.options.tokens[index], diff + offset); + if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp; + } + return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]); + }, + getUpdatedChoices: function() { + this.startIndicator(); + + var autocomplete = this, entry = encodeURIComponent(this.options.paramName) + '=' + encodeURIComponent(this.getToken()); + this.options.data = this.options.callback ? this.options.callback(this.element, entry) : entry; + + if (this.options.defaultParams) this.options.data += '&' + this.options.defaultParams; + var ajaxOptions = $.extend({}, this.options, { + url: this.url, + success: function(data, status) { + autocomplete.updateChoices(data); + } + }); + $.ajax(ajaxOptions); + } + }); + + $.fn.autocomplete = function(options) { + var update = $('#' + options.update).get(0), url = options.url; + options.update = options.url = undefined; + this.filter(':text').each(function() { + new AutoComplete(this, update, url, options); + }); + return this; + } +})(jQuery); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/jrails.js b/spec/test_app/public/javascripts/jrails.js new file mode 100644 index 0000000..39aa4ec --- /dev/null +++ b/spec/test_app/public/javascripts/jrails.js @@ -0,0 +1 @@ +(function($){$.ajaxSettings.accepts._default="text/javascript, text/html, application/xml, text/xml, */*"})(jQuery);(function($){$.fn.reset=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};$.fn.enable=function(){return this.each(function(){this.disabled=false})};$.fn.disable=function(){return this.each(function(){this.disabled=true})}})(jQuery);(function($){$.extend({fieldEvent:function(el,obs){var field=el[0]||el,e="change";if(field.type=="radio"||field.type=="checkbox"){e="click"}else{if(obs&&(field.type=="text"||field.type=="textarea"||field.type=="password")){e="keyup"}}return e}});$.fn.extend({delayedObserver:function(delay,callback){var el=$(this);if(typeof window.delayedObserverStack=="undefined"){window.delayedObserverStack=[]}if(typeof window.delayedObserverCallback=="undefined"){window.delayedObserverCallback=function(stackPos){var observed=window.delayedObserverStack[stackPos];if(observed.timer){clearTimeout(observed.timer)}observed.timer=setTimeout(function(){observed.timer=null;observed.callback(observed.obj,observed.obj.formVal())},observed.delay*1000);observed.oldVal=observed.obj.formVal()}}window.delayedObserverStack.push({obj:el,timer:null,delay:delay,oldVal:el.formVal(),callback:callback});var stackPos=window.delayedObserverStack.length-1;if(el[0].tagName=="FORM"){$(":input",el).each(function(){var field=$(this);field.bind($.fieldEvent(field,delay),function(){var observed=window.delayedObserverStack[stackPos];if(observed.obj.formVal()==observed.oldVal){return}else{window.delayedObserverCallback(stackPos)}})})}else{el.bind($.fieldEvent(el,delay),function(){var observed=window.delayedObserverStack[stackPos];if(observed.obj.formVal()==observed.oldVal){return}else{window.delayedObserverCallback(stackPos)}})}},formVal:function(){var el=this[0];if(el.tagName=="FORM"){return this.serialize()}if(el.type=="checkbox"||el.type=="radio"){return this.filter("input:checked").val()||""}else{return this.val()}}})})(jQuery);(function($){$.fn.extend({visualEffect:function(o,options){if(options){speed=options.duration*1000}else{speed=null}e=o.replace(/\_(.)/g,function(m,l){return l.toUpperCase()});return eval("$(this)."+e+"("+speed+")")},appear:function(speed,callback){return this.fadeIn(speed,callback)},blindDown:function(speed,callback){return this.show("blind",{direction:"vertical"},speed,callback)},blindUp:function(speed,callback){return this.hide("blind",{direction:"vertical"},speed,callback)},blindRight:function(speed,callback){return this.show("blind",{direction:"horizontal"},speed,callback)},blindLeft:function(speed,callback){this.hide("blind",{direction:"horizontal"},speed,callback);return this},dropOut:function(speed,callback){return this.hide("drop",{direction:"down"},speed,callback)},dropIn:function(speed,callback){return this.show("drop",{direction:"up"},speed,callback)},fade:function(speed,callback){return this.fadeOut(speed,callback)},fadeToggle:function(speed,callback){return this.animate({opacity:"toggle"},speed,callback)},fold:function(speed,callback){return this.hide("fold",{},speed,callback)},foldOut:function(speed,callback){return this.show("fold",{},speed,callback)},grow:function(speed,callback){return this.show("scale",{},speed,callback)},highlight:function(speed,callback){return this.show("highlight",{},speed,callback)},puff:function(speed,callback){return this.hide("puff",{},speed,callback)},pulsate:function(speed,callback){return this.show("pulsate",{},speed,callback)},shake:function(speed,callback){return this.show("shake",{},speed,callback)},shrink:function(speed,callback){return this.hide("scale",{},speed,callback)},squish:function(speed,callback){return this.hide("scale",{origin:["top","left"]},speed,callback)},slideUp:function(speed,callback){return this.hide("slide",{direction:"up"},speed,callback)},slideDown:function(speed,callback){return this.show("slide",{direction:"up"},speed,callback)},switchOff:function(speed,callback){return this.hide("clip",{},speed,callback)},switchOn:function(speed,callback){return this.show("clip",{},speed,callback)}})})(jQuery); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/jsTree/jquery.tree.js b/spec/test_app/public/javascripts/jsTree/jquery.tree.js new file mode 100755 index 0000000..0cb25d3 --- /dev/null +++ b/spec/test_app/public/javascripts/jsTree/jquery.tree.js @@ -0,0 +1,2058 @@ +/* + * jsTree 0.9.9a + * http://jstree.com/ + * + * Copyright (c) 2009 Ivan Bozhanov (vakata.com) + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + * Date: 2009-10-06 + * + */ + +(function($) { + // jQuery plugin + $.tree = { + datastores : { }, + plugins : { }, + defaults : { + data : { + async : false, // Are async requests used to load open_branch contents + type : "html", // One of included datastores + opts : { method: "GET", url: false } // Options passed to datastore + }, + selected : false, // FALSE or STRING or ARRAY + opened : [], // ARRAY OF INITIALLY OPENED NODES + languages : [], // ARRAY of string values (which will be used as CSS classes - so they must be valid) + ui : { + dots : true, // BOOL - dots or no dots + animation : 0, // INT - duration of open/close animations in miliseconds + scroll_spd : 4, + theme_path : false, // Path to the theme CSS file - if set to false and theme_name is not false - will lookup jstree-path-here/themes/theme-name-here/style.css + theme_name : "default",// if set to false no theme will be loaded + selected_parent_close : "select_parent", // false, "deselect", "select_parent" + selected_delete : "select_previous" // false, "select_previous" + }, + types : { + "default" : { + clickable : true, // can be function + renameable : true, // can be function + deletable : true, // can be function + creatable : true, // can be function + draggable : true, // can be function + max_children : -1, // -1 - not set, 0 - no children, 1 - one child, etc // can be function + max_depth : -1, // -1 - not set, 0 - no children, 1 - one level of children, etc // can be function + valid_children : "all", // all, none, array of values // can be function + icon : { + image : false, + position : false + } + } + }, + rules : { + multiple : false, // FALSE | CTRL | ON - multiple selection off/ with or without holding Ctrl + multitree : "none", // all, none, array of tree IDs to accept from + type_attr : "rel", // STRING attribute name (where is the type stored as string) + createat : "bottom", // STRING (top or bottom) new nodes get inserted at top or bottom + drag_copy : "ctrl", // FALSE | CTRL | ON - drag to copy off/ with or without holding Ctrl + drag_button : "left", // left, right or both + use_max_children : true, + use_max_depth : true, + + max_children: -1, + max_depth : -1, + valid_children : "all" + }, + lang : { + new_node : "New folder", + loading : "Loading ..." + }, + callback : { + beforechange: function(NODE,TREE_OBJ) { return true }, + beforeopen : function(NODE,TREE_OBJ) { return true }, + beforeclose : function(NODE,TREE_OBJ) { return true }, + beforemove : function(NODE,REF_NODE,TYPE,TREE_OBJ) { return true }, + beforecreate: function(NODE,REF_NODE,TYPE,TREE_OBJ) { return true }, + beforerename: function(NODE,LANG,TREE_OBJ) { return true }, + beforedelete: function(NODE,TREE_OBJ) { return true }, + beforedata : function(NODE,TREE_OBJ) { return { id : $(NODE).attr("id") || 0 } }, // PARAMETERS PASSED TO SERVER + ondata : function(DATA,TREE_OBJ) { return DATA; }, // modify data before parsing it + onparse : function(STR,TREE_OBJ) { return STR; }, // modify string before visualizing it + onhover : function(NODE,TREE_OBJ) { }, // node hovered + onselect : function(NODE,TREE_OBJ) { }, // node selected + ondeselect : function(NODE,TREE_OBJ) { }, // node deselected + onchange : function(NODE,TREE_OBJ) { }, // focus changed + onrename : function(NODE,TREE_OBJ,RB) { }, // node renamed + onmove : function(NODE,REF_NODE,TYPE,TREE_OBJ,RB) { }, // move completed + oncopy : function(NODE,REF_NODE,TYPE,TREE_OBJ,RB) { }, // copy completed + oncreate : function(NODE,REF_NODE,TYPE,TREE_OBJ,RB) { }, // node created + ondelete : function(NODE,TREE_OBJ,RB) { }, // node deleted + onopen : function(NODE,TREE_OBJ) { }, // node opened + onopen_all : function(TREE_OBJ) { }, // all nodes opened + onclose_all : function(TREE_OBJ) { }, // all nodes closed + onclose : function(NODE,TREE_OBJ) { }, // node closed + error : function(TEXT,TREE_OBJ) { }, // error occured + ondblclk : function(NODE,TREE_OBJ) { TREE_OBJ.toggle_branch.call(TREE_OBJ, NODE); TREE_OBJ.select_branch.call(TREE_OBJ, NODE); }, + onrgtclk : function(NODE,TREE_OBJ,EV) { }, // right click - to prevent use: EV.preventDefault(); EV.stopPropagation(); return false + onload : function(TREE_OBJ) { }, + oninit : function(TREE_OBJ) { }, + onfocus : function(TREE_OBJ) { }, + ondestroy : function(TREE_OBJ) { }, + onsearch : function(NODES, TREE_OBJ) { NODES.addClass("search"); }, + ondrop : function(NODE,REF_NODE,TYPE,TREE_OBJ) { }, + check : function(RULE,NODE,VALUE,TREE_OBJ) { return VALUE; }, + check_move : function(NODE,REF_NODE,TYPE,TREE_OBJ) { return true; } + }, + plugins : { } + }, + + create : function () { return new tree_component(); }, + focused : function () { return tree_component.inst[tree_component.focused]; }, + reference : function (obj) { + var o = $(obj); + if(!o.size()) o = $("#" + obj); + if(!o.size()) return null; + o = (o.is(".tree")) ? o.attr("id") : o.parents(".tree:eq(0)").attr("id"); + return tree_component.inst[o] || null; + }, + rollback : function (data) { + for(var i in data) { + if(!data.hasOwnProperty(i)) continue; + var tmp = tree_component.inst[i]; + var lock = !tmp.locked; + + // if not locked - lock the tree + if(lock) tmp.lock(true); + // Cancel ongoing rename + tmp.inp = false; + tmp.container.html(data[i].html).find(".dragged").removeClass("dragged").end().find(".hover").removeClass("hover"); + + if(data[i].selected) { + tmp.selected = $("#" + data[i].selected); + tmp.selected_arr = []; + tmp.container + .find("a.clicked").each( function () { + tmp.selected_arr.push(tmp.get_node(this)); + }); + } + // if this function set the lock - unlock + if(lock) tmp.lock(false); + + delete lock; + delete tmp; + } + }, + drop_mode : function (opts) { + opts = $.extend(opts, { show : false, type : "default", str : "Foreign node" }); + tree_component.drag_drop.foreign = true; + tree_component.drag_drop.isdown = true; + tree_component.drag_drop.moving = true; + tree_component.drag_drop.appended = false; + tree_component.drag_drop.f_type = opts.type; + tree_component.drag_drop.f_data = opts; + + + if(!opts.show) { + tree_component.drag_drop.drag_help = false; + tree_component.drag_drop.drag_node = false; + } + else { + tree_component.drag_drop.drag_help = $(""); + tree_component.drag_drop.drag_node = tree_component.drag_drop.drag_help.find("li:eq(0)"); + } + if($.tree.drag_start !== false) $.tree.drag_start.call(null, false); + }, + drag_start : false, + drag : false, + drag_end : false + }; + $.fn.tree = function (opts) { + return this.each(function() { + var conf = $.extend({},opts); + if(tree_component.inst && tree_component.inst[$(this).attr('id')]) tree_component.inst[$(this).attr('id')].destroy(); + if(conf !== false) new tree_component().init(this, conf); + }); + }; + + // core + function tree_component () { + return { + cntr : ++tree_component.cntr, + settings : $.extend({},$.tree.defaults), + + init : function(elem, conf) { + var _this = this; + this.container = $(elem); + if(this.container.size == 0) return false; + tree_component.inst[this.cntr] = this; + if(!this.container.attr("id")) this.container.attr("id","jstree_" + this.cntr); + tree_component.inst[this.container.attr("id")] = tree_component.inst[this.cntr]; + tree_component.focused = this.cntr; + this.settings = $.extend(true, {}, this.settings, conf); + + // DEAL WITH LANGUAGE VERSIONS + if(this.settings.languages && this.settings.languages.length) { + this.current_lang = this.settings.languages[0]; + var st = false; + var id = "#" + this.container.attr("id"); + for(var ln = 0; ln < this.settings.languages.length; ln++) { + st = tree_component.add_css(id + " ." + this.settings.languages[ln]); + if(st !== false) st.style.display = (this.settings.languages[ln] == this.current_lang) ? "" : "none"; + } + } + else this.current_lang = false; + // THEMES + this.container.addClass("tree"); + if(this.settings.ui.theme_name !== false) { + if(this.settings.ui.theme_path === false) { + $("script").each(function () { + if(this.src.toString().match(/jquery\.tree.*?js$/)) { _this.settings.ui.theme_path = this.src.toString().replace(/jquery\.tree.*?js$/, "") + "themes/" + _this.settings.ui.theme_name + "/style.css"; return false; } + }); + } + if(this.settings.ui.theme_path != "" && $.inArray(this.settings.ui.theme_path, tree_component.themes) == -1) { + tree_component.add_sheet({ url : this.settings.ui.theme_path }); + tree_component.themes.push(this.settings.ui.theme_path); + } + this.container.addClass("tree-" + this.settings.ui.theme_name); + } + // TYPE ICONS + var type_icons = ""; + for(var t in this.settings.types) { + if(!this.settings.types.hasOwnProperty(t)) continue; + if(!this.settings.types[t].icon) continue; + if( this.settings.types[t].icon.image || this.settings.types[t].icon.position) { + if(t == "default") type_icons += "#" + this.container.attr("id") + " li > a ins { "; + else type_icons += "#" + this.container.attr("id") + " li[rel=" + t + "] > a ins { "; + if(this.settings.types[t].icon.image) type_icons += " background-image:url(" + this.settings.types[t].icon.image + "); "; + if(this.settings.types[t].icon.position) type_icons += " background-position:" + this.settings.types[t].icon.position + "; "; + type_icons += "} "; + } + } + if(type_icons != "") tree_component.add_sheet({ str : type_icons }); + + if(this.settings.rules.multiple) this.selected_arr = []; + this.offset = false; + this.hovered = false; + this.locked = false; + + if(tree_component.drag_drop.marker === false) tree_component.drag_drop.marker = $("
          ").attr({ id : "jstree-marker" }).hide().appendTo("body"); + this.callback("oninit", [this]); + this.refresh(); + this.attach_events(); + this.focus(); + }, + refresh : function (obj) { + if(this.locked) return this.error("LOCKED"); + var _this = this; + if(obj && !this.settings.data.async) obj = false; + this.is_partial_refresh = obj ? true : false; + + // SAVE OPENED + this.opened = Array(); + if(this.settings.opened != false) { + $.each(this.settings.opened, function (i, item) { + if(this.replace(/^#/,"").length > 0) { _this.opened.push("#" + this.replace(/^#/,"")); } + }); + this.settings.opened = false; + } + else { + this.container.find("li.open").each(function (i) { if(this.id) { _this.opened.push("#" + this.id); } }); + } + + // SAVE SELECTED + if(this.selected) { + this.settings.selected = Array(); + if(obj) { + $(obj).find("li:has(a.clicked)").each(function () { + if(this.id) _this.settings.selected.push("#" + this.id); + }); + } + else { + if(this.selected_arr) { + $.each(this.selected_arr, function () { + if(this.attr("id")) _this.settings.selected.push("#" + this.attr("id")); + }); + } + else { + if(this.selected.attr("id")) this.settings.selected.push("#" + this.selected.attr("id")); + } + } + } + else if(this.settings.selected !== false) { + var tmp = Array(); + if((typeof this.settings.selected).toLowerCase() == "object") { + $.each(this.settings.selected, function () { + if(this.replace(/^#/,"").length > 0) tmp.push("#" + this.replace(/^#/,"")); + }); + } + else { + if(this.settings.selected.replace(/^#/,"").length > 0) tmp.push("#" + this.settings.selected.replace(/^#/,"")); + } + this.settings.selected = tmp; + } + + if(obj && this.settings.data.async) { + this.opened = Array(); + obj = this.get_node(obj); + obj.find("li.open").each(function (i) { _this.opened.push("#" + this.id); }); + if(obj.hasClass("open")) obj.removeClass("open").addClass("closed"); + if(obj.hasClass("leaf")) obj.removeClass("leaf"); + obj.children("ul:eq(0)").html(""); + return this.open_branch(obj, true, function () { _this.reselect.apply(_this); }); + } + + var _this = this; + var _datastore = new $.tree.datastores[this.settings.data.type](); + if(this.container.children("ul").size() == 0) { + this.container.html(""); + } + _datastore.load(this.callback("beforedata",[false,this]),this,this.settings.data.opts,function(data) { + data = _this.callback("ondata",[data, _this]); + _datastore.parse(data,_this,_this.settings.data.opts,function(str) { + str = _this.callback("onparse", [str, _this]); + _this.container.empty().append($("
            ").html(str)); + _this.container.find("li:last-child").addClass("last").end().find("li:has(ul)").not(".open").addClass("closed"); + _this.container.find("li").not(".open").not(".closed").addClass("leaf"); + _this.reselect(); + }); + }); + }, + reselect : function (is_callback) { + var _this = this; + + if(!is_callback) this.cl_count = 0; + else this.cl_count --; + // REOPEN BRANCHES + if(this.opened && this.opened.length) { + var opn = false; + for(var j = 0; this.opened && j < this.opened.length; j++) { + if(this.settings.data.async) { + var tmp = this.get_node(this.opened[j]); + if(tmp.size() && tmp.hasClass("closed") > 0) { + opn = true; + var tmp = this.opened[j].toString().replace('/','\\/'); + delete this.opened[j]; + this.open_branch(tmp, true, function () { _this.reselect.apply(_this, [true]); } ); + this.cl_count ++; + } + } + else this.open_branch(this.opened[j], true); + } + if(this.settings.data.async && opn) return; + if(this.cl_count > 0) return; + delete this.opened; + } + if(this.cl_count > 0) return; + + // DOTS and RIGHT TO LEFT + this.container.css("direction","ltr").children("ul:eq(0)").addClass("ltr"); + if(this.settings.ui.dots == false) this.container.children("ul:eq(0)").addClass("no_dots"); + + // REPOSITION SCROLL + if(this.scrtop) { + this.container.scrollTop(_this.scrtop); + delete this.scrtop; + } + // RESELECT PREVIOUSLY SELECTED + if(this.settings.selected !== false) { + $.each(this.settings.selected, function (i) { + if(_this.is_partial_refresh) _this.select_branch($(_this.settings.selected[i].toString().replace('/','\\/'), _this.container), (_this.settings.rules.multiple !== false) ); + else _this.select_branch($(_this.settings.selected[i].toString().replace('/','\\/'), _this.container), (_this.settings.rules.multiple !== false && i > 0) ); + }); + this.settings.selected = false; + } + this.callback("onload", [_this]); + }, + + get : function (obj, format, opts) { + if(!format) format = this.settings.data.type; + if(!opts) opts = this.settings.data.opts; + return new $.tree.datastores[format]().get(obj, this, opts); + }, + + attach_events : function () { + var _this = this; + + this.container + .bind("mousedown.jstree", function (event) { + if(tree_component.drag_drop.isdown) { + tree_component.drag_drop.move_type = false; + event.preventDefault(); + event.stopPropagation(); + event.stopImmediatePropagation(); + return false; + } + }) + .bind("mouseup.jstree", function (event) { + setTimeout( function() { _this.focus.apply(_this); }, 5); + }) + .bind("click.jstree", function (event) { + //event.stopPropagation(); + return true; + }); + $("#" + this.container.attr("id") + " li") + .live("click", function(event) { // WHEN CLICK IS ON THE ARROW + if(event.target.tagName != "LI") return true; + _this.off_height(); + if(event.pageY - $(event.target).offset().top > _this.li_height) return true; + _this.toggle_branch.apply(_this, [event.target]); + event.stopPropagation(); + return false; + }); + $("#" + this.container.attr("id") + " li a") + .live("click.jstree", function (event) { // WHEN CLICK IS ON THE TEXT OR ICON + if(event.which && event.which == 3) return true; + if(_this.locked) { + event.preventDefault(); + event.target.blur(); + return _this.error("LOCKED"); + } + _this.select_branch.apply(_this, [event.target, event.ctrlKey || _this.settings.rules.multiple == "on"]); + if(_this.inp) { _this.inp.blur(); } + event.preventDefault(); + event.target.blur(); + return false; + }) + .live("dblclick.jstree", function (event) { // WHEN DOUBLECLICK ON TEXT OR ICON + if(_this.locked) { + event.preventDefault(); + event.stopPropagation(); + event.target.blur(); + return _this.error("LOCKED"); + } + _this.callback("ondblclk", [_this.get_node(event.target).get(0), _this]); + event.preventDefault(); + event.stopPropagation(); + event.target.blur(); + }) + .live("contextmenu.jstree", function (event) { + if(_this.locked) { + event.target.blur(); + return _this.error("LOCKED"); + } + return _this.callback("onrgtclk", [_this.get_node(event.target).get(0), _this, event]); + }) + .live("mouseover.jstree", function (event) { + if(_this.locked) { + event.preventDefault(); + event.stopPropagation(); + return _this.error("LOCKED"); + } + if(_this.hovered !== false && (event.target.tagName == "A" || event.target.tagName == "INS")) { + _this.hovered.children("a").removeClass("hover"); + _this.hovered = false; + } + _this.callback("onhover",[_this.get_node(event.target).get(0), _this]); + }) + .live("mousedown.jstree", function (event) { + if(_this.settings.rules.drag_button == "left" && event.which && event.which != 1) return true; + if(_this.settings.rules.drag_button == "right" && event.which && event.which != 3) return true; + _this.focus.apply(_this); + if(_this.locked) return _this.error("LOCKED"); + // SELECT LIST ITEM NODE + var obj = _this.get_node(event.target); + // IF ITEM IS DRAGGABLE + if(_this.settings.rules.multiple != false && _this.selected_arr.length > 1 && obj.children("a:eq(0)").hasClass("clicked")) { + var counter = 0; + for(var i in _this.selected_arr) { + if(!_this.selected_arr.hasOwnProperty(i)) continue; + if(_this.check("draggable", _this.selected_arr[i])) { + _this.selected_arr[i].addClass("dragged"); + tree_component.drag_drop.origin_tree = _this; + counter ++; + } + } + if(counter > 0) { + if(_this.check("draggable", obj)) tree_component.drag_drop.drag_node = obj; + else tree_component.drag_drop.drag_node = _this.container.find("li.dragged:eq(0)"); + tree_component.drag_drop.isdown = true; + tree_component.drag_drop.drag_help = $("
            ").append("
              "); + var tmp = tree_component.drag_drop.drag_node.clone(); + if(_this.settings.languages.length > 0) tmp.find("a").not("." + _this.current_lang).hide(); + tree_component.drag_drop.drag_help.children("ul:eq(0)").append(tmp); + tree_component.drag_drop.drag_help.find("li:eq(0)").removeClass("last").addClass("last").children("a").html(" Multiple selection").end().children("ul").remove(); + + tree_component.drag_drop.dragged = _this.container.find("li.dragged"); + } + } + else { + if(_this.check("draggable", obj)) { + tree_component.drag_drop.drag_node = obj; + tree_component.drag_drop.drag_help = $("
              ").append("
                "); + var tmp = obj.clone(); + if(_this.settings.languages.length > 0) tmp.find("a").not("." + _this.current_lang).hide(); + tree_component.drag_drop.drag_help.children("ul:eq(0)").append(tmp); + tree_component.drag_drop.drag_help.find("li:eq(0)").removeClass("last").addClass("last"); + tree_component.drag_drop.isdown = true; + tree_component.drag_drop.foreign = false; + tree_component.drag_drop.origin_tree = _this; + obj.addClass("dragged"); + + tree_component.drag_drop.dragged = _this.container.find("li.dragged"); + } + } + tree_component.drag_drop.init_x = event.pageX; + tree_component.drag_drop.init_y = event.pageY; + obj.blur(); + event.preventDefault(); + event.stopPropagation(); + return false; + }); + }, + focus : function () { + if(this.locked) return false; + if(tree_component.focused != this.cntr) { + tree_component.focused = this.cntr; + this.callback("onfocus",[this]); + } + }, + + off_height : function () { + if(this.offset === false) { + this.container.css({ position : "relative" }); + this.offset = this.container.offset(); + var tmp = 0; + tmp = parseInt($.curCSS(this.container.get(0), "paddingTop", true),10); + if(tmp) this.offset.top += tmp; + tmp = parseInt($.curCSS(this.container.get(0), "borderTopWidth", true),10); + if(tmp) this.offset.top += tmp; + this.container.css({ position : "" }); + } + if(!this.li_height) { + var tmp = this.container.find("ul li.closed, ul li.leaf").eq(0); + this.li_height = tmp.height(); + if(tmp.children("ul:eq(0)").size()) this.li_height -= tmp.children("ul:eq(0)").height(); + if(!this.li_height) this.li_height = 18; + } + }, + scroll_check : function (x,y) { + var _this = this; + var cnt = _this.container; + var off = _this.container.offset(); + + var st = cnt.scrollTop(); + var sl = cnt.scrollLeft(); + // DETECT HORIZONTAL SCROLL + var h_cor = (cnt.get(0).scrollWidth > cnt.width()) ? 40 : 20; + + if(y - off.top < 20) cnt.scrollTop(Math.max( (st - _this.settings.ui.scroll_spd) ,0)); // NEAR TOP + if(cnt.height() - (y - off.top) < h_cor) cnt.scrollTop(st + _this.settings.ui.scroll_spd); // NEAR BOTTOM + if(x - off.left < 20) cnt.scrollLeft(Math.max( (sl - _this.settings.ui.scroll_spd),0)); // NEAR LEFT + if(cnt.width() - (x - off.left) < 40) cnt.scrollLeft(sl + _this.settings.ui.scroll_spd); // NEAR RIGHT + + if(cnt.scrollLeft() != sl || cnt.scrollTop() != st) { + tree_component.drag_drop.move_type = false; + tree_component.drag_drop.ref_node = false; + tree_component.drag_drop.marker.hide(); + } + tree_component.drag_drop.scroll_time = setTimeout( function() { _this.scroll_check(x,y); }, 50); + }, + scroll_into_view : function (obj) { + obj = obj ? this.get_node(obj) : this.selected; + if(!obj) return false; + var off_t = obj.offset().top; + var beg_t = this.container.offset().top; + var end_t = beg_t + this.container.height(); + var h_cor = (this.container.get(0).scrollWidth > this.container.width()) ? 40 : 20; + if(off_t + 5 < beg_t) this.container.scrollTop(this.container.scrollTop() - (beg_t - off_t + 5) ); + if(off_t + h_cor > end_t) this.container.scrollTop(this.container.scrollTop() + (off_t + h_cor - end_t) ); + }, + + get_node : function (obj) { + return $(obj).closest("li"); + }, + get_type : function (obj) { + obj = !obj ? this.selected : this.get_node(obj); + if(!obj) return; + var tmp = obj.attr(this.settings.rules.type_attr); + return tmp || "default"; + }, + set_type : function (str, obj) { + obj = !obj ? this.selected : this.get_node(obj); + if(!obj || !str) return; + obj.attr(this.settings.rules.type_attr, str); + }, + get_text : function (obj, lang) { + obj = this.get_node(obj); + if(!obj || obj.size() == 0) return ""; + if(this.settings.languages && this.settings.languages.length) { + lang = lang ? lang : this.current_lang; + obj = obj.children("a." + lang); + } + else obj = obj.children("a:visible"); + var val = ""; + obj.contents().each(function () { + if(this.nodeType == 3) { val = this.data; return false; } + }); + return val; + }, + + check : function (rule, obj) { + if(this.locked) return false; + var v = false; + // if root node + if(obj === -1) { if(typeof this.settings.rules[rule] != "undefined") v = this.settings.rules[rule]; } + else { + obj = !obj ? this.selected : this.get_node(obj); + if(!obj) return; + var t = this.get_type(obj); + if(typeof this.settings.types[t] != "undefined" && typeof this.settings.types[t][rule] != "undefined") v = this.settings.types[t][rule]; + else if(typeof this.settings.types["default"] != "undefined" && typeof this.settings.types["default"][rule] != "undefined") v = this.settings.types["default"][rule]; + } + if(typeof v == "function") v = v.call(null, obj, this); + v = this.callback("check", [rule, obj, v, this]); + return v; + }, + check_move : function (nod, ref_node, how) { + if(this.locked) return false; + if($(ref_node).closest("li.dragged").size()) return false; + + var tree1 = nod.parents(".tree:eq(0)").get(0); + var tree2 = ref_node.parents(".tree:eq(0)").get(0); + // if different trees + if(tree1 && tree1 != tree2) { + var m = $.tree.reference(tree2.id).settings.rules.multitree; + if(m == "none" || ($.isArray(m) && $.inArray(tree1.id, m) == -1)) return false; + } + + var p = (how != "inside") ? this.parent(ref_node) : this.get_node(ref_node); + nod = this.get_node(nod); + if(p == false) return false; + var r = { + max_depth : this.settings.rules.use_max_depth ? this.check("max_depth", p) : -1, + max_children : this.settings.rules.use_max_children ? this.check("max_children", p) : -1, + valid_children : this.check("valid_children", p) + }; + var nod_type = (typeof nod == "string") ? nod : this.get_type(nod); + if(typeof r.valid_children != "undefined" && (r.valid_children == "none" || (typeof r.valid_children == "object" && $.inArray(nod_type, $.makeArray(r.valid_children)) == -1))) return false; + + if(this.settings.rules.use_max_children) { + if(typeof r.max_children != "undefined" && r.max_children != -1) { + if(r.max_children == 0) return false; + var c_count = 1; + if(tree_component.drag_drop.moving == true && tree_component.drag_drop.foreign == false) { + c_count = tree_component.drag_drop.dragged.size(); + c_count = c_count - p.find('> ul > li.dragged').size(); + } + if(r.max_children < p.find('> ul > li').size() + c_count) return false; + } + } + + if(this.settings.rules.use_max_depth) { + if(typeof r.max_depth != "undefined" && r.max_depth === 0) return this.error("MOVE: MAX-DEPTH REACHED"); + // check for max_depth up the chain + var mx = (r.max_depth > 0) ? r.max_depth : false; + var i = 0; + var t = p; + while(t !== -1) { + t = this.parent(t); + i ++; + var m = this.check("max_depth",t); + if(m >= 0) { + mx = (mx === false) ? (m - i) : Math.min(mx, m - i); + } + if(mx !== false && mx <= 0) return this.error("MOVE: MAX-DEPTH REACHED"); + } + if(mx !== false && mx <= 0) return this.error("MOVE: MAX-DEPTH REACHED"); + if(mx !== false) { + var incr = 1; + if(typeof nod != "string") { + var t = nod; + // possible async problem - when nodes are not all loaded down the chain + while(t.size() > 0) { + if(mx - incr < 0) return this.error("MOVE: MAX-DEPTH REACHED"); + t = t.children("ul").children("li"); + incr ++; + } + } + } + } + if(this.callback("check_move", [nod, ref_node, how, this]) == false) return false; + return true; + }, + + hover_branch : function (obj) { + if(this.locked) return this.error("LOCKED"); + var _this = this; + var obj = _this.get_node(obj); + if(!obj.size()) return this.error("HOVER: NOT A VALID NODE"); + if(!_this.check("clickable", obj)) return this.error("SELECT: NODE NOT SELECTABLE"); + if(this.hovered) this.hovered.children("A").removeClass("hover"); + this.hovered = obj; + this.hovered.children("a").addClass("hover"); + this.scroll_into_view(this.hovered); + }, + select_branch : function (obj, multiple) { + if(this.locked) return this.error("LOCKED"); + if(!obj && this.hovered !== false) obj = this.hovered; + var _this = this; + obj = _this.get_node(obj); + if(!obj.size()) return this.error("SELECT: NOT A VALID NODE"); + obj.children("a").removeClass("hover"); + // CHECK AGAINST RULES FOR SELECTABLE NODES + if(!_this.check("clickable", obj)) return this.error("SELECT: NODE NOT SELECTABLE"); + if(_this.callback("beforechange",[obj.get(0),_this]) === false) return this.error("SELECT: STOPPED BY USER"); + // IF multiple AND obj IS ALREADY SELECTED - DESELECT IT + if(this.settings.rules.multiple != false && multiple && obj.children("a.clicked").size() > 0) { + return this.deselect_branch(obj); + } + if(this.settings.rules.multiple != false && multiple) { + this.selected_arr.push(obj); + } + if(this.settings.rules.multiple != false && !multiple) { + for(var i in this.selected_arr) { + if(!this.selected_arr.hasOwnProperty(i)) continue; + this.selected_arr[i].children("A").removeClass("clicked"); + this.callback("ondeselect", [this.selected_arr[i].get(0), _this]); + } + this.selected_arr = []; + this.selected_arr.push(obj); + if(this.selected && this.selected.children("A").hasClass("clicked")) { + this.selected.children("A").removeClass("clicked"); + this.callback("ondeselect", [this.selected.get(0), _this]); + } + } + if(!this.settings.rules.multiple) { + if(this.selected) { + this.selected.children("A").removeClass("clicked"); + this.callback("ondeselect", [this.selected.get(0), _this]); + } + } + // SAVE NEWLY SELECTED + this.selected = obj; + if(this.hovered !== false) { + this.hovered.children("A").removeClass("hover"); + this.hovered = obj; + } + + // FOCUS NEW NODE AND OPEN ALL PARENT NODES IF CLOSED + this.selected.children("a").addClass("clicked").end().parents("li.closed").each( function () { _this.open_branch(this, true); }); + + // SCROLL SELECTED NODE INTO VIEW + this.scroll_into_view(this.selected); + + this.callback("onselect", [this.selected.get(0), _this]); + this.callback("onchange", [this.selected.get(0), _this]); + }, + deselect_branch : function (obj) { + if(this.locked) return this.error("LOCKED"); + var _this = this; + var obj = this.get_node(obj); + if(obj.children("a.clicked").size() == 0) return this.error("DESELECT: NODE NOT SELECTED"); + + obj.children("a").removeClass("clicked"); + this.callback("ondeselect", [obj.get(0), _this]); + if(this.settings.rules.multiple != false && this.selected_arr.length > 1) { + this.selected_arr = []; + this.container.find("a.clicked").filter(":first-child").parent().each(function () { + _this.selected_arr.push($(this)); + }); + if(obj.get(0) == this.selected.get(0)) { + this.selected = this.selected_arr[0]; + } + } + else { + if(this.settings.rules.multiple != false) this.selected_arr = []; + this.selected = false; + } + this.callback("onchange", [obj.get(0), _this]); + }, + toggle_branch : function (obj) { + if(this.locked) return this.error("LOCKED"); + var obj = this.get_node(obj); + if(obj.hasClass("closed")) return this.open_branch(obj); + if(obj.hasClass("open")) return this.close_branch(obj); + }, + open_branch : function (obj, disable_animation, callback) { + var _this = this; + + if(this.locked) return this.error("LOCKED"); + var obj = this.get_node(obj); + if(!obj.size()) return this.error("OPEN: NO SUCH NODE"); + if(obj.hasClass("leaf")) return this.error("OPEN: OPENING LEAF NODE"); + if(this.settings.data.async && obj.find("li").size() == 0) { + + if(this.callback("beforeopen",[obj.get(0),this]) === false) return this.error("OPEN: STOPPED BY USER"); + + obj.children("ul:eq(0)").remove().end().append(""); + obj.removeClass("closed").addClass("open"); + + var _datastore = new $.tree.datastores[this.settings.data.type](); + _datastore.load(this.callback("beforedata",[obj,this]),this,this.settings.data.opts,function(data){ + data = _this.callback("ondata", [data, _this]); + if(!data || data.length == 0) { + obj.removeClass("closed").removeClass("open").addClass("leaf").children("ul").remove(); + if(callback) callback.call(); + return; + } + _datastore.parse(data,_this,_this.settings.data.opts,function(str){ + str = _this.callback("onparse", [str, _this]); + // if(obj.children('ul:eq(0)').children('li').size() > 1) obj.children("ul").find('.loaading').parent().replaceWith(str); else + obj.children("ul:eq(0)").replaceWith($("
                  ").html(str)); + obj.find("li:last-child").addClass("last").end().find("li:has(ul)").not(".open").addClass("closed"); + obj.find("li").not(".open").not(".closed").addClass("leaf"); + _this.open_branch.apply(_this, [obj]); + if(callback) callback.call(); + }); + }); + return true; + } + else { + if(!this.settings.data.async) { + if(this.callback("beforeopen",[obj.get(0),this]) === false) return this.error("OPEN: STOPPED BY USER"); + } + if(parseInt(this.settings.ui.animation) > 0 && !disable_animation ) { + obj.children("ul:eq(0)").css("display","none"); + obj.removeClass("closed").addClass("open"); + obj.children("ul:eq(0)").slideDown(parseInt(this.settings.ui.animation), function() { + $(this).css("display",""); + if(callback) callback.call(); + }); + } else { + obj.removeClass("closed").addClass("open"); + if(callback) callback.call(); + } + this.callback("onopen", [obj.get(0), this]); + return true; + } + }, + close_branch : function (obj, disable_animation) { + if(this.locked) return this.error("LOCKED"); + var _this = this; + var obj = this.get_node(obj); + if(!obj.size()) return this.error("CLOSE: NO SUCH NODE"); + if(_this.callback("beforeclose",[obj.get(0),_this]) === false) return this.error("CLOSE: STOPPED BY USER"); + if(parseInt(this.settings.ui.animation) > 0 && !disable_animation && obj.children("ul:eq(0)").size() == 1) { + obj.children("ul:eq(0)").slideUp(parseInt(this.settings.ui.animation), function() { + if(obj.hasClass("open")) obj.removeClass("open").addClass("closed"); + $(this).css("display",""); + }); + } + else { + if(obj.hasClass("open")) obj.removeClass("open").addClass("closed"); + } + if(this.selected && this.settings.ui.selected_parent_close !== false && obj.children("ul:eq(0)").find("a.clicked").size() > 0) { + obj.find("li:has(a.clicked)").each(function() { + _this.deselect_branch(this); + }); + if(this.settings.ui.selected_parent_close == "select_parent" && obj.children("a.clicked").size() == 0) this.select_branch(obj, (this.settings.rules.multiple != false && this.selected_arr.length > 0) ); + } + this.callback("onclose", [obj.get(0), this]); + }, + open_all : function (obj, callback) { + if(this.locked) return this.error("LOCKED"); + var _this = this; + obj = obj ? this.get_node(obj) : this.container; + + var s = obj.find("li.closed").size(); + if(!callback) this.cl_count = 0; + else this.cl_count --; + if(s > 0) { + this.cl_count += s; + // maybe add .andSelf() + obj.find("li.closed").each( function () { var __this = this; _this.open_branch.apply(_this, [this, true, function() { _this.open_all.apply(_this, [__this, true]); } ]); }); + } + else if(this.cl_count == 0) this.callback("onopen_all",[this]); + }, + close_all : function (obj) { + if(this.locked) return this.error("LOCKED"); + var _this = this; + obj = obj ? this.get_node(obj) : this.container; + // maybe add .andSelf() + obj.find("li.open").each( function () { _this.close_branch(this, true); }); + this.callback("onclose_all",[this]); + }, + + set_lang : function (i) { + if(!$.isArray(this.settings.languages) || this.settings.languages.length == 0) return false; + if(this.locked) return this.error("LOCKED"); + if(!$.inArray(i,this.settings.languages) && typeof this.settings.languages[i] != "undefined") i = this.settings.languages[i]; + if(typeof i == "undefined") return false; + if(i == this.current_lang) return true; + var st = false; + var id = "#" + this.container.attr("id"); + st = tree_component.get_css(id + " ." + this.current_lang); + if(st !== false) st.style.display = "none"; + st = tree_component.get_css(id + " ." + i); + if(st !== false) st.style.display = ""; + this.current_lang = i; + return true; + }, + get_lang : function () { + if(!$.isArray(this.settings.languages) || this.settings.languages.length == 0) return false; + return this.current_lang; + }, + + create : function (obj, ref_node, position) { + if(this.locked) return this.error("LOCKED"); + + var root = false; + if(ref_node == -1) { root = true; ref_node = this.container; } + else ref_node = ref_node ? this.get_node(ref_node) : this.selected; + + if(!root && (!ref_node || !ref_node.size())) return this.error("CREATE: NO NODE SELECTED"); + + var pos = position; + + var tmp = ref_node; // for type calculation + if(position == "before") { + position = ref_node.parent().children().index(ref_node); + ref_node = ref_node.parents("li:eq(0)"); + } + if(position == "after") { + position = ref_node.parent().children().index(ref_node) + 1; + ref_node = ref_node.parents("li:eq(0)"); + } + if(!root && ref_node.size() == 0) { root = true; ref_node = this.container; } + + if(!root) { + if(!this.check("creatable", ref_node)) return this.error("CREATE: CANNOT CREATE IN NODE"); + if(ref_node.hasClass("closed")) { + if(this.settings.data.async && ref_node.children("ul").size() == 0) { + var _this = this; + return this.open_branch(ref_node, true, function () { _this.create.apply(_this, [obj, ref_node, position]); } ); + } + else this.open_branch(ref_node, true); + } + } + + // creating new object to pass to parseJSON + var torename = false; + if(!obj) obj = {}; + else obj = $.extend(true, {}, obj); + if(!obj.attributes) obj.attributes = {}; + if(!obj.attributes[this.settings.rules.type_attr]) obj.attributes[this.settings.rules.type_attr] = this.get_type(tmp) || "default"; + if(this.settings.languages.length) { + if(!obj.data) { obj.data = {}; torename = true; } + for(var i = 0; i < this.settings.languages.length; i++) { + if(!obj.data[this.settings.languages[i]]) obj.data[this.settings.languages[i]] = ((typeof this.settings.lang.new_node).toLowerCase() != "string" && this.settings.lang.new_node[i]) ? this.settings.lang.new_node[i] : this.settings.lang.new_node; + } + } + else { + if(!obj.data) { obj.data = this.settings.lang.new_node; torename = true; } + } + + obj = this.callback("ondata",[obj, this]); + var obj_s = $.tree.datastores.json().parse(obj,this); + obj_s = this.callback("onparse", [obj_s, this]); + var $li = $(obj_s); + + if($li.children("ul").size()) { + if(!$li.is(".open")) $li.addClass("closed"); + } + else $li.addClass("leaf"); + $li.find("li:last-child").addClass("last").end().find("li:has(ul)").not(".open").addClass("closed"); + $li.find("li").not(".open").not(".closed").addClass("leaf"); + + var r = { + max_depth : this.settings.rules.use_max_depth ? this.check("max_depth", (root ? -1 : ref_node) ) : -1, + max_children : this.settings.rules.use_max_children ? this.check("max_children", (root ? -1 : ref_node) ) : -1, + valid_children : this.check("valid_children", (root ? -1 : ref_node) ) + }; + var nod_type = this.get_type($li); + if(typeof r.valid_children != "undefined" && (r.valid_children == "none" || ($.isArray(r.valid_children) && $.inArray(nod_type, r.valid_children) == -1))) return this.error("CREATE: NODE NOT A VALID CHILD"); + + if(this.settings.rules.use_max_children) { + if(typeof r.max_children != "undefined" && r.max_children != -1 && r.max_children >= this.children(ref_node).size()) return this.error("CREATE: MAX_CHILDREN REACHED"); + } + + if(this.settings.rules.use_max_depth) { + if(typeof r.max_depth != "undefined" && r.max_depth === 0) return this.error("CREATE: MAX-DEPTH REACHED"); + // check for max_depth up the chain + var mx = (r.max_depth > 0) ? r.max_depth : false; + var i = 0; + var t = ref_node; + + while(t !== -1 && !root) { + t = this.parent(t); + i ++; + var m = this.check("max_depth",t); + if(m >= 0) { + mx = (mx === false) ? (m - i) : Math.min(mx, m - i); + } + if(mx !== false && mx <= 0) return this.error("CREATE: MAX-DEPTH REACHED"); + } + if(mx !== false && mx <= 0) return this.error("CREATE: MAX-DEPTH REACHED"); + if(mx !== false) { + var incr = 1; + var t = $li; + while(t.size() > 0) { + if(mx - incr < 0) return this.error("CREATE: MAX-DEPTH REACHED"); + t = t.children("ul").children("li"); + incr ++; + } + } + } + + if((typeof position).toLowerCase() == "undefined" || position == "inside") + position = (this.settings.rules.createat == "top") ? 0 : ref_node.children("ul:eq(0)").children("li").size(); + if(ref_node.children("ul").size() == 0 || (root == true && ref_node.children("ul").children("li").size() == 0) ) { + if(!root) var a = this.moved($li,ref_node.children("a:eq(0)"),"inside", true); + else var a = this.moved($li,this.container.children("ul:eq(0)"),"inside", true); + } + else if(pos == "before" && ref_node.children("ul:eq(0)").children("li:nth-child(" + (position + 1) + ")").size()) + var a = this.moved($li,ref_node.children("ul:eq(0)").children("li:nth-child(" + (position + 1) + ")").children("a:eq(0)"),"before", true); + else if(pos == "after" && ref_node.children("ul:eq(0)").children("li:nth-child(" + (position) + ")").size()) + var a = this.moved($li,ref_node.children("ul:eq(0)").children("li:nth-child(" + (position) + ")").children("a:eq(0)"),"after", true); + else if(ref_node.children("ul:eq(0)").children("li:nth-child(" + (position + 1) + ")").size()) + var a = this.moved($li,ref_node.children("ul:eq(0)").children("li:nth-child(" + (position + 1) + ")").children("a:eq(0)"),"before", true); + else + var a = this.moved($li,ref_node.children("ul:eq(0)").children("li:last").children("a:eq(0)"),"after",true); + + if(a === false) return this.error("CREATE: ABORTED"); + + if(torename) { + this.select_branch($li.children("a:eq(0)")); + this.rename(); + } + return $li; + }, + rename : function (obj, new_name) { + if(this.locked) return this.error("LOCKED"); + obj = obj ? this.get_node(obj) : this.selected; + var _this = this; + if(!obj || !obj.size()) return this.error("RENAME: NO NODE SELECTED"); + if(!this.check("renameable", obj)) return this.error("RENAME: NODE NOT RENAMABLE"); + if(!this.callback("beforerename",[obj.get(0), _this.current_lang, _this])) return this.error("RENAME: STOPPED BY USER"); + + obj.parents("li.closed").each(function () { _this.open_branch(this) }); + if(this.current_lang) obj = obj.find("a." + this.current_lang); + else obj = obj.find("a:first"); + + // Rollback + var rb = {}; + rb[this.container.attr("id")] = this.get_rollback(); + + var icn = obj.children("ins").clone(); + if((typeof new_name).toLowerCase() == "string") { + obj.text(new_name).prepend(icn); + _this.callback("onrename", [_this.get_node(obj).get(0), _this, rb]); + } + else { + var last_value = ""; + obj.contents().each(function () { + if(this.nodeType == 3) { last_value = this.data; return false; } + }); + _this.inp = $(""); + _this.inp + .val(last_value.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<")) + .bind("mousedown", function (event) { event.stopPropagation(); }) + .bind("mouseup", function (event) { event.stopPropagation(); }) + .bind("click", function (event) { event.stopPropagation(); }) + .bind("keyup", function (event) { + var key = event.keyCode || event.which; + if(key == 27) { this.value = last_value; this.blur(); return } + if(key == 13) { this.blur(); return; } + }); + _this.inp.blur(function(event) { + if(this.value == "") this.value = last_value; + obj.text(this.value).prepend(icn); + obj.get(0).style.display = ""; + obj.prevAll("span").remove(); + _this.inp = false; + _this.callback("onrename", [_this.get_node(obj).get(0), _this, rb]); + }); + + var spn = $("").addClass(obj.attr("class")).append(icn).append(_this.inp); + obj.get(0).style.display = "none"; + obj.parent().prepend(spn); + _this.inp.get(0).focus(); + _this.inp.get(0).select(); + } + }, + remove : function(obj) { + if(this.locked) return this.error("LOCKED"); + var _this = this; + + // Rollback + var rb = {}; + rb[this.container.attr("id")] = this.get_rollback(); + + if(obj && (!this.selected || this.get_node(obj).get(0) != this.selected.get(0) )) { + obj = this.get_node(obj); + if(obj.size()) { + if(!this.check("deletable", obj)) return this.error("DELETE: NODE NOT DELETABLE"); + if(!this.callback("beforedelete",[obj.get(0), _this])) return this.error("DELETE: STOPPED BY USER"); + $parent = obj.parent(); + if(obj.find("a.clicked").size()) { + var reset_selected = false; + _this.selected_arr = []; + this.container.find("a.clicked").filter(":first-child").parent().each(function () { + if(!reset_selected && this == _this.selected.get(0)) reset_selected = true; + if($(this).parents().index(obj) != -1) return true; + _this.selected_arr.push($(this)); + }); + if(reset_selected) this.selected = this.selected_arr[0] || false; + } + obj = obj.remove(); + $parent.children("li:last").addClass("last"); + if($parent.children("li").size() == 0) { + $li = $parent.parents("li:eq(0)"); + $li.removeClass("open").removeClass("closed").addClass("leaf").children("ul").remove(); + } + this.callback("ondelete", [obj.get(0), this, rb]); + } + } + else if(this.selected) { + if(!this.check("deletable", this.selected)) return this.error("DELETE: NODE NOT DELETABLE"); + if(!this.callback("beforedelete",[this.selected.get(0), _this])) return this.error("DELETE: STOPPED BY USER"); + $parent = this.selected.parent(); + var obj = this.selected; + if(this.settings.rules.multiple == false || this.selected_arr.length == 1) { + var stop = true; + var tmp = this.settings.ui.selected_delete == "select_previous" ? this.prev(this.selected) : false; + } + obj = obj.remove(); + $parent.children("li:last").addClass("last"); + if($parent.children("li").size() == 0) { + $li = $parent.parents("li:eq(0)"); + $li.removeClass("open").removeClass("closed").addClass("leaf").children("ul").remove(); + } + if(!stop && this.settings.rules.multiple != false) { + var _this = this; + this.selected_arr = []; + this.container.find("a.clicked").filter(":first-child").parent().each(function () { + _this.selected_arr.push($(this)); + }); + if(this.selected_arr.length > 0) { + this.selected = this.selected_arr[0]; + this.remove(); + } + } + if(stop && tmp) this.select_branch(tmp); + this.callback("ondelete", [obj.get(0), this, rb]); + } + else return this.error("DELETE: NO NODE SELECTED"); + }, + + next : function (obj, strict) { + obj = this.get_node(obj); + if(!obj.size()) return false; + if(strict) return (obj.nextAll("li").size() > 0) ? obj.nextAll("li:eq(0)") : false; + + if(obj.hasClass("open")) return obj.find("li:eq(0)"); + else if(obj.nextAll("li").size() > 0) return obj.nextAll("li:eq(0)"); + else return obj.parents("li").next("li").eq(0); + }, + prev : function(obj, strict) { + obj = this.get_node(obj); + if(!obj.size()) return false; + if(strict) return (obj.prevAll("li").size() > 0) ? obj.prevAll("li:eq(0)") : false; + + if(obj.prev("li").size()) { + var obj = obj.prev("li").eq(0); + while(obj.hasClass("open")) obj = obj.children("ul:eq(0)").children("li:last"); + return obj; + } + else return obj.parents("li:eq(0)").size() ? obj.parents("li:eq(0)") : false; + }, + parent : function(obj) { + obj = this.get_node(obj); + if(!obj.size()) return false; + return obj.parents("li:eq(0)").size() ? obj.parents("li:eq(0)") : -1; + }, + children : function(obj) { + if(obj === -1) return this.container.children("ul:eq(0)").children("li"); + + obj = this.get_node(obj); + if(!obj.size()) return false; + return obj.children("ul:eq(0)").children("li"); + }, + + toggle_dots : function () { + if(this.settings.ui.dots) { + this.settings.ui.dots = false; + this.container.children("ul:eq(0)").addClass("no_dots"); + } + else { + this.settings.ui.dots = true; + this.container.children("ul:eq(0)").removeClass("no_dots"); + } + }, + + callback : function (cb, args) { + var p = false; + var r = null; + for(var i in this.settings.plugins) { + if(typeof $.tree.plugins[i] != "object") continue; + p = $.tree.plugins[i]; + if(p.callbacks && typeof p.callbacks[cb] == "function") r = p.callbacks[cb].apply(this, args); + if(typeof r !== "undefined" && r !== null) { + if(cb == "ondata" || cb == "onparse") args[0] = r; // keep the chain if data or parse + else return r; + } + } + p = this.settings.callback[cb]; + if(typeof p == "function") return p.apply(null, args); + }, + get_rollback : function () { + var rb = {}; + rb.html = this.container.html(); + rb.selected = this.selected ? this.selected.attr("id") : false; + return rb; + }, + moved : function (what, where, how, is_new, is_copy, rb) { + var what = $(what); + var $parent = $(what).parents("ul:eq(0)"); + var $where = $(where); + if($where.is("ins")) $where = $where.parent(); + + // Rollback + if(!rb) { + var rb = {}; + rb[this.container.attr("id")] = this.get_rollback(); + if(!is_new) { + var tmp = what.size() > 1 ? what.eq(0).parents(".tree:eq(0)") : what.parents(".tree:eq(0)"); + if(tmp.get(0) != this.container.get(0)) { + tmp = tree_component.inst[tmp.attr("id")]; + rb[tmp.container.attr("id")] = tmp.get_rollback(); + } + delete tmp; + } + } + + if(how == "inside" && this.settings.data.async) { + var _this = this; + if(this.get_node($where).hasClass("closed")) { + return this.open_branch(this.get_node($where), true, function () { _this.moved.apply(_this, [what, where, how, is_new, is_copy, rb]); }); + } + if(this.get_node($where).find("> ul > li > a.loading").size() == 1) { + setTimeout(function () { _this.moved.apply(_this, [what, where, how, is_new, is_copy]); }, 200); + return; + } + } + + + // IF MULTIPLE + if(what.size() > 1) { + var _this = this; + var tmp = this.moved(what.eq(0), where, how, false, is_copy, rb); + what.each(function (i) { + if(i == 0) return; + if(tmp) { // if tmp is false - the previous move was a no-go + tmp = _this.moved(this, tmp.children("a:eq(0)"), "after", false, is_copy, rb); + } + }); + return what; + } + + if(is_copy) { + _what = what.clone(); + _what.each(function (i) { + this.id = this.id + "_copy"; + $(this).find("li").each(function () { + this.id = this.id + "_copy"; + }); + $(this).removeClass("dragged").find("a.clicked").removeClass("clicked").end().find("li.dragged").removeClass("dragged"); + }); + } + else _what = what; + if(is_new) { + if(!this.callback("beforecreate", [this.get_node(what).get(0), this.get_node(where).get(0),how,this])) return false; + } + else { + if(!this.callback("beforemove", [this.get_node(what).get(0), this.get_node(where).get(0),how,this])) return false; + } + + if(!is_new) { + var tmp = what.parents(".tree:eq(0)"); + // if different trees + if(tmp.get(0) != this.container.get(0)) { + tmp = tree_component.inst[tmp.attr("id")]; + + // if there are languages - otherwise - no cleanup needed + if(tmp.settings.languages.length) { + var res = []; + // if new tree has no languages - use current visible + if(this.settings.languages.length == 0) res.push("." + tmp.current_lang); + else { + for(var i in this.settings.languages) { + if(!this.settings.languages.hasOwnProperty(i)) continue; + for(var j in tmp.settings.languages) { + if(!tmp.settings.languages.hasOwnProperty(j)) continue; + if(this.settings.languages[i] == tmp.settings.languages[j]) res.push("." + this.settings.languages[i]); + } + } + } + if(res.length == 0) return this.error("MOVE: NO COMMON LANGUAGES"); + _what.find("a").not(res.join(",")).remove(); + } + _what.find("a.clicked").removeClass("clicked"); + } + } + what = _what; + + // ADD NODE TO NEW PLACE + switch(how) { + case "before": + $where.parents("ul:eq(0)").children("li.last").removeClass("last"); + $where.parent().before(what.removeClass("last")); + $where.parents("ul:eq(0)").children("li:last").addClass("last"); + break; + case "after": + $where.parents("ul:eq(0)").children("li.last").removeClass("last"); + $where.parent().after(what.removeClass("last")); + $where.parents("ul:eq(0)").children("li:last").addClass("last"); + break; + case "inside": + if($where.parent().children("ul:first").size()) { + if(this.settings.rules.createat == "top") { + $where.parent().children("ul:first").prepend(what.removeClass("last")).children("li:last").addClass("last"); + + // restored this section + var tmp_node = $where.parent().children("ul:first").children("li:first"); + if(tmp_node.size()) { + how = "before"; + where = tmp_node; + } + } + else { + // restored this section + var tmp_node = $where.parent().children("ul:first").children(".last"); + if(tmp_node.size()) { + how = "after"; + where = tmp_node; + } + + $where.parent().children("ul:first").children(".last").removeClass("last").end().append(what.removeClass("last")).children("li:last").addClass("last"); + } + } + else { + what.addClass("last"); + $where.parent().removeClass("leaf").append("
                    "); + if(!$where.parent().hasClass("open")) $where.parent().addClass("closed"); + $where.parent().children("ul:first").prepend(what); + } + if($where.parent().hasClass("closed")) { this.open_branch($where); } + break; + default: + break; + } + // CLEANUP OLD PARENT + if($parent.find("li").size() == 0) { + var $li = $parent.parent(); + $li.removeClass("open").removeClass("closed").addClass("leaf"); + if(!$li.is(".tree")) $li.children("ul").remove(); + $li.parents("ul:eq(0)").children("li.last").removeClass("last").end().children("li:last").addClass("last"); + } + else { + $parent.children("li.last").removeClass("last"); + $parent.children("li:last").addClass("last"); + } + + // NO LONGER CORRECT WITH position PARAM - if(is_new && how != "inside") where = this.get_node(where).parents("li:eq(0)"); + if(is_copy) this.callback("oncopy", [this.get_node(what).get(0), this.get_node(where).get(0), how, this, rb]); + else if(is_new) this.callback("oncreate", [this.get_node(what).get(0), ($where.is("ul") ? -1 : this.get_node(where).get(0) ), how, this, rb]); + else this.callback("onmove", [this.get_node(what).get(0), this.get_node(where).get(0), how, this, rb]); + return what; + }, + error : function (code) { + this.callback("error",[code,this]); + return false; + }, + lock : function (state) { + this.locked = state; + if(this.locked) this.container.children("ul:eq(0)").addClass("locked"); + else this.container.children("ul:eq(0)").removeClass("locked"); + }, + cut : function (obj) { + if(this.locked) return this.error("LOCKED"); + obj = obj ? this.get_node(obj) : this.container.find("a.clicked").filter(":first-child").parent(); + if(!obj || !obj.size()) return this.error("CUT: NO NODE SELECTED"); + tree_component.cut_copy.copy_nodes = false; + tree_component.cut_copy.cut_nodes = obj; + }, + copy : function (obj) { + if(this.locked) return this.error("LOCKED"); + obj = obj ? this.get_node(obj) : this.container.find("a.clicked").filter(":first-child").parent(); + if(!obj || !obj.size()) return this.error("COPY: NO NODE SELECTED"); + tree_component.cut_copy.copy_nodes = obj; + tree_component.cut_copy.cut_nodes = false; + }, + paste : function (obj, position) { + if(this.locked) return this.error("LOCKED"); + + var root = false; + if(obj == -1) { root = true; obj = this.container; } + else obj = obj ? this.get_node(obj) : this.selected; + + if(!root && (!obj || !obj.size())) return this.error("PASTE: NO NODE SELECTED"); + if(!tree_component.cut_copy.copy_nodes && !tree_component.cut_copy.cut_nodes) return this.error("PASTE: NOTHING TO DO"); + + var _this = this; + + var pos = position; + + if(position == "before") { + position = obj.parent().children().index(obj); + obj = obj.parents("li:eq(0)"); + } + else if(position == "after") { + position = obj.parent().children().index(obj) + 1; + obj = obj.parents("li:eq(0)"); + } + else if((typeof position).toLowerCase() == "undefined" || position == "inside") { + position = (this.settings.rules.createat == "top") ? 0 : obj.children("ul:eq(0)").children("li").size(); + } + if(!root && obj.size() == 0) { root = true; obj = this.container; } + + if(tree_component.cut_copy.copy_nodes && tree_component.cut_copy.copy_nodes.size()) { + var ok = true; + if(!root && !this.check_move(tree_component.cut_copy.copy_nodes, obj.children("a:eq(0)"), "inside")) return false; + + if(obj.children("ul").size() == 0 || (root == true && obj.children("ul").children("li").size() == 0) ) { + if(!root) var a = this.moved(tree_component.cut_copy.copy_nodes,obj.children("a:eq(0)"),"inside", false, true); + else var a = this.moved(tree_component.cut_copy.copy_nodes,this.container.children("ul:eq(0)"),"inside", false, true); + } + else if(pos == "before" && obj.children("ul:eq(0)").children("li:nth-child(" + (position + 1) + ")").size()) + var a = this.moved(tree_component.cut_copy.copy_nodes,obj.children("ul:eq(0)").children("li:nth-child(" + (position + 1) + ")").children("a:eq(0)"),"before", false, true); + else if(pos == "after" && obj.children("ul:eq(0)").children("li:nth-child(" + (position) + ")").size()) + var a = this.moved(tree_component.cut_copy.copy_nodes,obj.children("ul:eq(0)").children("li:nth-child(" + (position) + ")").children("a:eq(0)"),"after", false, true); + else if(obj.children("ul:eq(0)").children("li:nth-child(" + (position + 1) + ")").size()) + var a = this.moved(tree_component.cut_copy.copy_nodes,obj.children("ul:eq(0)").children("li:nth-child(" + (position + 1) + ")").children("a:eq(0)"),"before", false, true); + else + var a = this.moved(tree_component.cut_copy.copy_nodes,obj.children("ul:eq(0)").children("li:last").children("a:eq(0)"),"after", false, true); + tree_component.cut_copy.copy_nodes = false; + } + if(tree_component.cut_copy.cut_nodes && tree_component.cut_copy.cut_nodes.size()) { + var ok = true; + obj.parents().andSelf().each(function () { + if(tree_component.cut_copy.cut_nodes.index(this) != -1) { + ok = false; + return false; + } + }); + if(!ok) return this.error("Invalid paste"); + if(!root && !this.check_move(tree_component.cut_copy.cut_nodes, obj.children("a:eq(0)"), "inside")) return false; + + if(obj.children("ul").size() == 0 || (root == true && obj.children("ul").children("li").size() == 0) ) { + if(!root) var a = this.moved(tree_component.cut_copy.cut_nodes,obj.children("a:eq(0)"),"inside"); + else var a = this.moved(tree_component.cut_copy.cut_nodes,this.container.children("ul:eq(0)"),"inside"); + } + else if(pos == "before" && obj.children("ul:eq(0)").children("li:nth-child(" + (position + 1) + ")").size()) + var a = this.moved(tree_component.cut_copy.cut_nodes,obj.children("ul:eq(0)").children("li:nth-child(" + (position + 1) + ")").children("a:eq(0)"),"before"); + else if(pos == "after" && obj.children("ul:eq(0)").children("li:nth-child(" + (position) + ")").size()) + var a = this.moved(tree_component.cut_copy.cut_nodes,obj.children("ul:eq(0)").children("li:nth-child(" + (position) + ")").children("a:eq(0)"),"after"); + else if(obj.children("ul:eq(0)").children("li:nth-child(" + (position + 1) + ")").size()) + var a = this.moved(tree_component.cut_copy.cut_nodes,obj.children("ul:eq(0)").children("li:nth-child(" + (position + 1) + ")").children("a:eq(0)"),"before"); + else + var a = this.moved(tree_component.cut_copy.cut_nodes,obj.children("ul:eq(0)").children("li:last").children("a:eq(0)"),"after"); + tree_component.cut_copy.cut_nodes = false; + } + }, + search : function(str, func) { + var _this = this; + if(!str || (this.srch && str != this.srch) ) { + this.srch = ""; + this.srch_opn = false; + this.container.find("a.search").removeClass("search"); + } + this.srch = str; + if(!str) return; + + if(!func) func = "contains"; + if(this.settings.data.async) { + if(!this.srch_opn) { + var dd = $.extend( { "search" : str } , this.callback("beforedata", [false, this] ) ); + $.ajax({ + type : this.settings.data.opts.method, + url : this.settings.data.opts.url, + data : dd, + dataType : "text", + success : function (data) { + _this.srch_opn = $.unique(data.split(",")); + _this.search.apply(_this,[str, func]); + } + }); + } + else if(this.srch_opn.length) { + if(this.srch_opn && this.srch_opn.length) { + var opn = false; + for(var j = 0; j < this.srch_opn.length; j++) { + if(this.get_node("#" + this.srch_opn[j]).size() > 0) { + opn = true; + var tmp = "#" + this.srch_opn[j]; + delete this.srch_opn[j]; + this.open_branch(tmp, true, function () { _this.search.apply(_this,[str, func]); } ); + } + } + if(!opn) { + this.srch_opn = []; + _this.search.apply(_this,[str, func]); + } + } + } + else { + this.srch_opn = false; + var selector = "a"; + // IF LANGUAGE VERSIONS + if(this.settings.languages.length) selector += "." + this.current_lang; + this.callback("onsearch", [this.container.find(selector + ":" + func + "('" + str + "')"), this]); + } + } + else { + var selector = "a"; + // IF LANGUAGE VERSIONS + if(this.settings.languages.length) selector += "." + this.current_lang; + var nn = this.container.find(selector + ":" + func + "('" + str + "')"); + nn.parents("li.closed").each( function () { _this.open_branch(this, true); }); + this.callback("onsearch", [nn, this]); + } + }, + add_sheet : tree_component.add_sheet, + + destroy : function() { + this.callback("ondestroy", [this]); + + this.container.unbind(".jstree"); + $("#" + this.container.attr("id")).die("click.jstree").die("dblclick.jstree").die("mouseover.jstree").die("mouseout.jstree").die("mousedown.jstree"); + this.container.removeClass("tree ui-widget ui-widget-content tree-default tree-" + this.settings.ui.theme_name).children("ul").removeClass("no_dots ltr locked").find("li").removeClass("leaf").removeClass("open").removeClass("closed").removeClass("last").children("a").removeClass("clicked hover search"); + + if(this.cntr == tree_component.focused) { + for(var i in tree_component.inst) { + if(i != this.cntr && i != this.container.attr("id")) { + tree_component.inst[i].focus(); + break; + } + } + } + + tree_component.inst[this.cntr] = false; + tree_component.inst[this.container.attr("id")] = false; + delete tree_component.inst[this.cntr]; + delete tree_component.inst[this.container.attr("id")]; + tree_component.cntr --; + } + } + }; + + // instance manager + tree_component.cntr = 0; + tree_component.inst = {}; + + // themes + tree_component.themes = []; + + // drag'n'drop stuff + tree_component.drag_drop = { + isdown : false, // Is there a drag + drag_node : false, // The actual node + drag_help : false, // The helper + dragged : false, + + init_x : false, + init_y : false, + moving : false, + + origin_tree : false, + marker : false, + + move_type : false, // before, after or inside + ref_node : false, // reference node + appended : false, // is helper appended + + foreign : false, // Is the dragged node a foreign one + droppable : [], // Array of classes that can be dropped onto the tree + + open_time : false, // Timeout for opening nodes + scroll_time : false // Timeout for scrolling + }; + tree_component.mouseup = function(event) { + var tmp = tree_component.drag_drop; + if(tmp.open_time) clearTimeout(tmp.open_time); + if(tmp.scroll_time) clearTimeout(tmp.scroll_time); + + if(tmp.moving && $.tree.drag_end !== false) $.tree.drag_end.call(null, event, tmp); + + if(tmp.foreign === false && tmp.drag_node && tmp.drag_node.size()) { + tmp.drag_help.remove(); + if(tmp.move_type) { + var tree1 = tree_component.inst[tmp.ref_node.parents(".tree:eq(0)").attr("id")]; + if(tree1) tree1.moved(tmp.dragged, tmp.ref_node, tmp.move_type, false, (tmp.origin_tree.settings.rules.drag_copy == "on" || (tmp.origin_tree.settings.rules.drag_copy == "ctrl" && event.ctrlKey) ) ); + } + tmp.move_type = false; + tmp.ref_node = false; + } + if(tmp.foreign !== false) { + if(tmp.drag_help) tmp.drag_help.remove(); + if(tmp.move_type) { + var tree1 = tree_component.inst[tmp.ref_node.parents(".tree:eq(0)").attr("id")]; + if(tree1) tree1.callback("ondrop",[tmp.f_data, tree1.get_node(tmp.ref_node).get(0), tmp.move_type, tree1]); + } + tmp.foreign = false; + tmp.move_type = false; + tmp.ref_node = false; + } + // RESET EVERYTHING + if(tree_component.drag_drop.marker) tree_component.drag_drop.marker.hide(); + if(tmp.dragged && tmp.dragged.size()) tmp.dragged.removeClass("dragged"); + tmp.dragged = false; + tmp.drag_help = false; + tmp.drag_node = false; + tmp.f_type = false; + tmp.f_data = false; + tmp.init_x = false; + tmp.init_y = false; + tmp.moving = false; + tmp.appended = false; + tmp.origin_tree = false; + if(tmp.isdown) { + tmp.isdown = false; + event.preventDefault(); + event.stopPropagation(); + return false; + } + }; + tree_component.mousemove = function(event) { + var tmp = tree_component.drag_drop; + var is_start = false; + + if(tmp.isdown) { + if(!tmp.moving && Math.abs(tmp.init_x - event.pageX) < 5 && Math.abs(tmp.init_y - event.pageY) < 5) { + event.preventDefault(); + event.stopPropagation(); + return false; + } + else { + if(!tmp.moving) { + tree_component.drag_drop.moving = true; + is_start = true; + } + } + + if(tmp.open_time) clearTimeout(tmp.open_time); + + if(tmp.drag_help !== false) { + if(!tmp.appended) { + if(tmp.foreign !== false) tmp.origin_tree = $.tree.focused(); + $("body").append(tmp.drag_help); + tmp.w = tmp.drag_help.width(); + tmp.appended = true; + } + tmp.drag_help.css({ "left" : (event.pageX + 5 ), "top" : (event.pageY + 15) }); + } + + if(is_start && $.tree.drag_start !== false) $.tree.drag_start.call(null, event, tmp); + if($.tree.drag !== false) $.tree.drag.call(null, event, tmp); + + if(event.target.tagName == "DIV" && event.target.id == "jstree-marker") return false; + + var et = $(event.target); + if(et.is("ins")) et = et.parent(); + var cnt = et.is(".tree") ? et : et.parents(".tree:eq(0)"); + + // if not moving over a tree + if(cnt.size() == 0 || !tree_component.inst[cnt.attr("id")]) { + if(tmp.scroll_time) clearTimeout(tmp.scroll_time); + if(tmp.drag_help !== false) tmp.drag_help.find("li:eq(0) ins").addClass("forbidden"); + tmp.move_type = false; + tmp.ref_node = false; + tree_component.drag_drop.marker.hide(); + return false; + } + + var tree2 = tree_component.inst[cnt.attr("id")]; + tree2.off_height(); + + if(tmp.scroll_time) clearTimeout(tmp.scroll_time); + tmp.scroll_time = setTimeout( function() { tree2.scroll_check(event.pageX,event.pageY); }, 50); + + var mov = false; + var st = cnt.scrollTop(); + + if(event.target.tagName == "A" || event.target.tagName == "INS") { + // just in case if hover is over the draggable + if(et.is("#jstree-dragged")) return false; + if(tree2.get_node(event.target).hasClass("closed")) { + tmp.open_time = setTimeout( function () { tree2.open_branch(et); }, 500); + } + + var et_off = et.offset(); + var goTo = { + x : (et_off.left - 1), + y : (event.pageY - et_off.top) + }; + + var arr = []; + if(goTo.y < tree2.li_height/3 + 1 ) arr = ["before","inside","after"]; + else if(goTo.y > tree2.li_height*2/3 - 1 ) arr = ["after","inside","before"]; + else { + if(goTo.y < tree2.li_height/2) arr = ["inside","before","after"]; + else arr = ["inside","after","before"]; + } + var ok = false; + var nn = (tmp.foreign == false) ? tmp.origin_tree.container.find("li.dragged") : tmp.f_type; + $.each(arr, function(i, val) { + if(tree2.check_move(nn, et, val)) { + mov = val; + ok = true; + return false; + } + }); + if(ok) { + switch(mov) { + case "before": + goTo.y = et_off.top - 2; + tree_component.drag_drop.marker.attr("class","marker"); + break; + case "after": + goTo.y = et_off.top - 2 + tree2.li_height; + tree_component.drag_drop.marker.attr("class","marker"); + break; + case "inside": + goTo.x -= 2; + goTo.y = et_off.top - 2 + tree2.li_height/2; + tree_component.drag_drop.marker.attr("class","marker_plus"); + break; + } + tmp.move_type = mov; + tmp.ref_node = $(event.target); + if(tmp.drag_help !== false) tmp.drag_help.find(".forbidden").removeClass("forbidden"); + tree_component.drag_drop.marker.css({ "left" : goTo.x , "top" : goTo.y }).show(); + } + } + + if( (et.is(".tree") || et.is("ul") ) && et.find("li:eq(0)").size() == 0) { + var et_off = et.offset(); + tmp.move_type = "inside"; + tmp.ref_node = cnt.children("ul:eq(0)"); + if(tmp.drag_help !== false) tmp.drag_help.find(".forbidden").removeClass("forbidden"); + tree_component.drag_drop.marker.attr("class","marker_plus"); + tree_component.drag_drop.marker.css({ "left" : (et_off.left + 10) , "top" : et_off.top + 15 }).show(); + } + else if( (event.target.tagName != "A" && event.target.tagName != "INS") || !ok) { + if(tmp.drag_help !== false) tmp.drag_help.find("li:eq(0) ins").addClass("forbidden"); + tmp.move_type = false; + tmp.ref_node = false; + tree_component.drag_drop.marker.hide(); + } + event.preventDefault(); + event.stopPropagation(); + return false; + } + return true; + }; + $(function () { + $(document).bind("mousemove.jstree", tree_component.mousemove); + $(document).bind("mouseup.jstree", tree_component.mouseup); + }); + + // cut, copy, paste stuff + tree_component.cut_copy = { + copy_nodes : false, + cut_nodes : false + }; + + // css stuff + tree_component.css = false; + tree_component.get_css = function(rule_name, delete_flag) { + rule_name = rule_name.toLowerCase(); + var css_rules = tree_component.css.cssRules || tree_component.css.rules; + var j = 0; + do { + if(css_rules.length && j > css_rules.length + 5) return false; + if(css_rules[j].selectorText && css_rules[j].selectorText.toLowerCase() == rule_name) { + if(delete_flag == true) { + if(tree_component.css.removeRule) document.styleSheets[i].removeRule(j); + if(tree_component.css.deleteRule) document.styleSheets[i].deleteRule(j); + return true; + } + else return css_rules[j]; + } + } + while (css_rules[++j]); + return false; + }; + tree_component.add_css = function(rule_name) { + if(tree_component.get_css(rule_name)) return false; + (tree_component.css.insertRule) ? tree_component.css.insertRule(rule_name + ' { }', 0) : tree_component.css.addRule(rule_name, null, 0); + return tree_component.get_css(rule_name); + }; + tree_component.remove_css = function(rule_name) { + return tree_component.get_css(rule_name, true); + }; + tree_component.add_sheet = function(opts) { + if(opts.str) { + var tmp = document.createElement("style"); + tmp.type = "text/css"; + if(tmp.styleSheet) tmp.styleSheet.cssText = opts.str; + else tmp.appendChild(document.createTextNode(opts.str)); + document.getElementsByTagName("head")[0].appendChild(tmp); + return tmp.sheet; + } + if(opts.url) { + if(document.createStyleSheet) { + try { document.createStyleSheet(opts.url); } catch (e) { }; + } + else { + var newSS = document.createElement('link'); + newSS.rel = 'stylesheet'; + newSS.type = 'text/css'; + newSS.media = "all"; + newSS.href = opts.url; + // var styles = "@import url(' " + url + " ');"; + // newSS.href ='data:text/css,'+escape(styles); + document.getElementsByTagName("head")[0].appendChild(newSS); + return newSS.styleSheet; + } + } + }; + $(function () { + var u = navigator.userAgent.toLowerCase(); + var v = (u.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1]; + var css = '/* TREE LAYOUT */ .tree ul { margin:0 0 0 5px; padding:0 0 0 0; list-style-type:none; } .tree li { display:block; min-height:18px; line-height:18px; padding:0 0 0 15px; margin:0 0 0 0; /* Background fix */ clear:both; } .tree li ul { display:none; } .tree li a, .tree li span { display:inline-block;line-height:16px;height:16px;color:black;white-space:nowrap;text-decoration:none;padding:1px 4px 1px 4px;margin:0; } .tree li a:focus { outline: none; } .tree li a input, .tree li span input { margin:0;padding:0 0;display:inline-block;height:12px !important;border:1px solid white;background:white;font-size:10px;font-family:Verdana; } .tree li a input:not([class="xxx"]), .tree li span input:not([class="xxx"]) { padding:1px 0; } /* FOR DOTS */ .tree .ltr li.last { float:left; } .tree > ul li.last { overflow:visible; } /* OPEN OR CLOSE */ .tree li.open ul { display:block; } .tree li.closed ul { display:none !important; } /* FOR DRAGGING */ #jstree-dragged { position:absolute; top:-10px; left:-10px; margin:0; padding:0; } #jstree-dragged ul ul ul { display:none; } #jstree-marker { padding:0; margin:0; line-height:5px; font-size:1px; overflow:hidden; height:5px; position:absolute; left:-45px; top:-30px; z-index:1000; background-color:transparent; background-repeat:no-repeat; display:none; } #jstree-marker.marker { width:45px; background-position:-32px top; } #jstree-marker.marker_plus { width:5px; background-position:right top; } /* BACKGROUND DOTS */ .tree li li { overflow:hidden; } .tree > .ltr > li { display:table; } /* ICONS */ .tree ul ins { display:inline-block; text-decoration:none; width:16px; height:16px; } .tree .ltr ins { margin:0 4px 0 0px; } '; + if(/msie/.test(u) && !/opera/.test(u)) { + if(parseInt(v) == 6) css += '.tree li { height:18px; zoom:1; } .tree li li { overflow:visible; } .tree .ltr li.last { margin-top: expression( (this.previousSibling && /open/.test(this.previousSibling.className) ) ? "-2px" : "0"); } .marker { width:45px; background-position:-32px top; } .marker_plus { width:5px; background-position:right top; }'; + if(parseInt(v) == 7) css += '.tree li li { overflow:visible; } .tree .ltr li.last { margin-top: expression( (this.previousSibling && /open/.test(this.previousSibling.className) ) ? "-2px" : "0"); }'; + } + if(/opera/.test(u)) css += '.tree > ul > li.last:after { content:"."; display: block; height:1px; clear:both; visibility:hidden; }'; + if(/mozilla/.test(u) && !/(compatible|webkit)/.test(u) && v.indexOf("1.8") == 0) css += '.tree .ltr li a { display:inline; float:left; } .tree li ul { clear:both; }'; + tree_component.css = tree_component.add_sheet({ str : css }); + }); +})(jQuery); + +// Datastores +// HTML and JSON are included here by default +(function ($) { + $.extend($.tree.datastores, { + "html" : function () { + return { + get : function(obj, tree, opts) { + return obj && $(obj).size() ? $('
                    ').append(tree.get_node(obj).clone()).html() : tree.container.children("ul:eq(0)").html(); + }, + parse : function(data, tree, opts, callback) { + if(callback) callback.call(null, data); + return data; + }, + load : function(data, tree, opts, callback) { + if(opts.url) { + $.ajax({ + 'type' : opts.method, + 'url' : opts.url, + 'data' : data, + 'dataType' : "html", + 'success' : function (d, textStatus) { + callback.call(null, d); + }, + 'error' : function (xhttp, textStatus, errorThrown) { + callback.call(null, false); + tree.error(errorThrown + " " + textStatus); + } + }); + } + else { + callback.call(null, opts.static || tree.container.children("ul:eq(0)").html()); + } + } + }; + }, + "json" : function () { + return { + get : function(obj, tree, opts) { + var _this = this; + if(!obj || $(obj).size() == 0) obj = tree.container.children("ul").children("li"); + else obj = $(obj); + + if(!opts) opts = {}; + if(!opts.outer_attrib) opts.outer_attrib = [ "id", "rel", "class" ]; + if(!opts.inner_attrib) opts.inner_attrib = [ ]; + + if(obj.size() > 1) { + var arr = []; + obj.each(function () { + arr.push(_this.get(this, tree, opts)); + }); + return arr; + } + if(obj.size() == 0) return []; + + var json = { attributes : {}, data : {} }; + if(obj.hasClass("open")) json.data.state = "open"; + if(obj.hasClass("closed")) json.data.state = "closed"; + + for(var i in opts.outer_attrib) { + if(!opts.outer_attrib.hasOwnProperty(i)) continue; + var val = (opts.outer_attrib[i] == "class") ? obj.attr(opts.outer_attrib[i]).replace(/(^| )last( |$)/ig," ").replace(/(^| )(leaf|closed|open)( |$)/ig," ") : obj.attr(opts.outer_attrib[i]); + if(typeof val != "undefined" && val.toString().replace(" ","").length > 0) json.attributes[opts.outer_attrib[i]] = val; + delete val; + } + + if(tree.settings.languages.length) { + for(var i in tree.settings.languages) { + if(!tree.settings.languages.hasOwnProperty(i)) continue; + var a = obj.children("a." + tree.settings.languages[i]); + if(opts.force || opts.inner_attrib.length || a.children("ins").get(0).style.backgroundImage.toString().length || a.children("ins").get(0).className.length) { + json.data[tree.settings.languages[i]] = {}; + json.data[tree.settings.languages[i]].title = tree.get_text(obj,tree.settings.languages[i]); + if(a.children("ins").get(0).style.className.length) { + json.data[tree.settings.languages[i]].icon = a.children("ins").get(0).style.className; + } + if(a.children("ins").get(0).style.backgroundImage.length) { + json.data[tree.settings.languages[i]].icon = a.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")",""); + } + if(opts.inner_attrib.length) { + json.data[tree.settings.languages[i]].attributes = {}; + for(var j in opts.inner_attrib) { + if(!opts.inner_attrib.hasOwnProperty(j)) continue; + var val = a.attr(opts.inner_attrib[j]); + if(typeof val != "undefined" && val.toString().replace(" ","").length > 0) json.data[tree.settings.languages[i]].attributes[opts.inner_attrib[j]] = val; + delete val; + } + } + } + else { + json.data[tree.settings.languages[i]] = tree.get_text(obj,tree.settings.languages[i]); + } + } + } + else { + var a = obj.children("a"); + json.data.title = tree.get_text(obj); + + if(a.children("ins").size() && a.children("ins").get(0).className.length) { + json.data.icon = a.children("ins").get(0).className; + } + if(a.children("ins").size() && a.children("ins").get(0).style.backgroundImage.length) { + json.data.icon = a.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")",""); + } + + if(opts.inner_attrib.length) { + json.data.attributes = {}; + for(var j in opts.inner_attrib) { + if(!opts.inner_attrib.hasOwnProperty(j)) continue; + var val = a.attr(opts.inner_attrib[j]); + if(typeof val != "undefined" && val.toString().replace(" ","").length > 0) json.data.attributes[opts.inner_attrib[j]] = val; + delete val; + } + } + } + + if(obj.children("ul").size() > 0) { + json.children = []; + obj.children("ul").children("li").each(function () { + json.children.push(_this.get(this, tree, opts)); + }); + } + return json; + }, + parse : function(data, tree, opts, callback) { + if(Object.prototype.toString.apply(data) === "[object Array]") { + var str = ''; + for(var i = 0; i < data.length; i ++) { + if(typeof data[i] == "function") continue; + str += this.parse(data[i], tree, opts); + } + if(callback) callback.call(null, str); + return str; + } + + if(!data || !data.data) { + if(callback) callback.call(null, false); + return ""; + } + + var str = ''; + str += "
                  •  "; + } + else str += " "; + str += ( (typeof data.data[tree.settings.languages[i]].title).toLowerCase() != "undefined" ? data.data[tree.settings.languages[i]].title : data.data[tree.settings.languages[i]] ) + ""; + } + } + else { + var attr = {}; + attr["href"] = ""; + attr["style"] = ""; + attr["class"] = ""; + if((typeof data.data.attributes).toLowerCase() != "undefined") { + for(var i in data.data.attributes) { + if(!data.data.attributes.hasOwnProperty(i)) continue; + if(i == "style" || i == "class") attr[i] += " " + data.data.attributes[i]; + else attr[i] = data.data.attributes[i]; + } + } + str += " "; + } + else str += " "; + str += ( (typeof data.data.title).toLowerCase() != "undefined" ? data.data.title : data.data ) + ""; + } + if(data.children && data.children.length) { + str += '
                      '; + for(var i = 0; i < data.children.length; i++) { + str += this.parse(data.children[i], tree, opts); + } + str += '
                    '; + } + str += "
                  • "; + if(callback) callback.call(null, str); + return str; + }, + load : function(data, tree, opts, callback) { + if(opts.static) { + callback.call(null, opts.static); + } + else { + $.ajax({ + 'type' : opts.method, + 'url' : opts.url, + 'data' : data, + 'dataType' : "json", + 'success' : function (d, textStatus) { + callback.call(null, d); + }, + 'error' : function (xhttp, textStatus, errorThrown) { + callback.call(null, false); + tree.error(errorThrown + " " + textStatus); + } + }); + } + } + } + } + }); +})(jQuery); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/jsTree/plugins/jquery.tree.contextmenu.js b/spec/test_app/public/javascripts/jsTree/plugins/jquery.tree.contextmenu.js new file mode 100755 index 0000000..6401cb3 --- /dev/null +++ b/spec/test_app/public/javascripts/jsTree/plugins/jquery.tree.contextmenu.js @@ -0,0 +1,129 @@ +(function ($) { + $.extend($.tree.plugins, { + "contextmenu" : { + object : $("
                      "), + data : { + t : false, + a : false, + r : false + }, + + defaults : { + class_name : "hover", + items : { + create : { + label : "Create", + icon : "create", + visible : function (NODE, TREE_OBJ) { if(NODE.length != 1) return 0; return TREE_OBJ.check("creatable", NODE); }, + action : function (NODE, TREE_OBJ) { TREE_OBJ.create(false, TREE_OBJ.get_node(NODE[0])); }, + separator_after : true + }, + rename : { + label : "Rename", + icon : "rename", + visible : function (NODE, TREE_OBJ) { if(NODE.length != 1) return false; return TREE_OBJ.check("renameable", NODE); }, + action : function (NODE, TREE_OBJ) { TREE_OBJ.rename(NODE); } + }, + remove : { + label : "Delete", + icon : "remove", + visible : function (NODE, TREE_OBJ) { var ok = true; $.each(NODE, function () { if(TREE_OBJ.check("deletable", this) == false) ok = false; return false; }); return ok; }, + action : function (NODE, TREE_OBJ) { $.each(NODE, function () { TREE_OBJ.remove(this); }); } + } + } + }, + show : function(obj, t) { + var opts = $.extend(true, {}, $.tree.plugins.contextmenu.defaults, t.settings.plugins.contextmenu); + obj = $(obj); + $.tree.plugins.contextmenu.object.empty(); + var str = ""; + var cnt = 0; + for(var i in opts.items) { + if(!opts.items.hasOwnProperty(i)) continue; + if(opts.items[i] === false) continue; + var r = 1; + if(typeof opts.items[i].visible == "function") r = opts.items[i].visible.call(null, $.tree.plugins.contextmenu.data.a, t); + if(r == -1) continue; + else cnt ++; + if(opts.items[i].separator_before === true) str += "
                    •  
                    • "; + str += '
                    • '; + if(opts.items[i].icon) str += " "; + else str += " "; + str += "" + opts.items[i].label + '
                    • '; + if(opts.items[i].separator_after === true) str += "
                    •  
                    • "; + } + var tmp = obj.children("a:visible").offset(); + $.tree.plugins.contextmenu.object.attr("class","tree-context tree-" + t.settings.ui.theme_name.toString() + "-context").html(str); + var h = $.tree.plugins.contextmenu.object.height(); + var w = $.tree.plugins.contextmenu.object.width(); + var x = tmp.left; + var y = tmp.top + parseInt(obj.children("a:visible").height()) + 2; + var max_y = $(window).height() + $(window).scrollTop(); + var max_x = $(window).width() + $(window).scrollLeft(); + if(y + h > max_y) y = Math.max( (max_y - h - 2), 0); + if(x + w > max_x) x = Math.max( (max_x - w - 2), 0); + $.tree.plugins.contextmenu.object.css({ "left" : (x), "top" : (y) }).fadeIn("fast"); + }, + hide : function () { + if(!$.tree.plugins.contextmenu.data.t) return; + var opts = $.extend(true, {}, $.tree.plugins.contextmenu.defaults, $.tree.plugins.contextmenu.data.t.settings.plugins.contextmenu); + if($.tree.plugins.contextmenu.data.r && $.tree.plugins.contextmenu.data.a) { + $.tree.plugins.contextmenu.data.a.children("a, span").removeClass(opts.class_name); + } + $.tree.plugins.contextmenu.data = { a : false, r : false, t : false }; + $.tree.plugins.contextmenu.object.fadeOut("fast"); + }, + exec : function (cmd) { + if($.tree.plugins.contextmenu.data.t == false) return; + var opts = $.extend(true, {}, $.tree.plugins.contextmenu.defaults, $.tree.plugins.contextmenu.data.t.settings.plugins.contextmenu); + try { opts.items[cmd].action.apply(null, [$.tree.plugins.contextmenu.data.a, $.tree.plugins.contextmenu.data.t]); } catch(e) { }; + }, + + callbacks : { + oninit : function () { + if(!$.tree.plugins.contextmenu.css) { + var css = '#jstree-contextmenu { display:none; position:absolute; z-index:2000; list-style-type:none; margin:0; padding:0; left:-2000px; top:-2000px; } .tree-context { margin:20px; padding:0; width:180px; border:1px solid #979797; padding:2px; background:#f5f5f5; list-style-type:none; }.tree-context li { height:22px; margin:0 0 0 27px; padding:0; background:#ffffff; border-left:1px solid #e0e0e0; }.tree-context li a { position:relative; display:block; height:22px; line-height:22px; margin:0 0 0 -28px; text-decoration:none; color:black; padding:0; }.tree-context li a ins { text-decoration:none; float:left; width:16px; height:16px; margin:0 0 0 0; background-color:#f0f0f0; border:1px solid #f0f0f0; border-width:3px 5px 3px 6px; line-height:16px; }.tree-context li a span { display:block; background:#f0f0f0; margin:0 0 0 29px; padding-left:5px; }.tree-context li.separator { background:#f0f0f0; height:2px; line-height:2px; font-size:1px; border:0; margin:0; padding:0; }.tree-context li.separator span { display:block; margin:0px 0 0px 27px; height:1px; border-top:1px solid #e0e0e0; border-left:1px solid #e0e0e0; line-height:1px; font-size:1px; background:white; }.tree-context li a:hover { border:1px solid #d8f0fa; height:20px; line-height:20px; }.tree-context li a:hover span { background:#e7f4f9; margin-left:28px; }.tree-context li a:hover ins { background-color:#e7f4f9; border-color:#e7f4f9; border-width:2px 5px 2px 5px; }.tree-context li a.disabled { color:gray; }.tree-context li a.disabled ins { }.tree-context li a.disabled:hover { border:0; height:22px; line-height:22px; }.tree-context li a.disabled:hover span { background:#f0f0f0; margin-left:29px; }.tree-context li a.disabled:hover ins { border-color:#f0f0f0; background-color:#f0f0f0; border-width:3px 5px 3px 6px; }'; + $.tree.plugins.contextmenu.css = this.add_sheet({ str : css }); + } + }, + onrgtclk : function (n, t, e) { + var opts = $.extend(true, {}, $.tree.plugins.contextmenu.defaults, t.settings.plugins.contextmenu); + n = $(n); + if(n.size() == 0) return; + $.tree.plugins.contextmenu.data.t = t; + if(!n.children("a:eq(0)").hasClass("clicked")) { + $.tree.plugins.contextmenu.data.a = n; + $.tree.plugins.contextmenu.data.r = true; + n.children("a").addClass(opts.class_name); + e.target.blur(); + } + else { + $.tree.plugins.contextmenu.data.r = false; + $.tree.plugins.contextmenu.data.a = (t.selected_arr && t.selected_arr.length > 1) ? t.selected_arr : t.selected; + } + $.tree.plugins.contextmenu.show(n, t); + e.preventDefault(); + e.stopPropagation(); + // return false; // commented out because you might want to do something in your own callback + }, + onchange : function () { $.tree.plugins.contextmenu.hide(); }, + beforedata : function () { $.tree.plugins.contextmenu.hide(); }, + ondestroy : function () { $.tree.plugins.contextmenu.hide(); } + } + } + }); + $(function () { + $.tree.plugins.contextmenu.object.hide().appendTo("body"); + $("#jstree-contextmenu a") + .live("click", function (event) { + if(!$(this).hasClass("disabled")) { + $.tree.plugins.contextmenu.exec.apply(null, [$(this).attr("rel")]); + $.tree.plugins.contextmenu.hide(); + } + event.stopPropagation(); + event.preventDefault(); + return false; + }) + $(document).bind("mousedown", function(event) { if($(event.target).parents("#jstree-contextmenu").size() == 0) $.tree.plugins.contextmenu.hide(); }); + }); +})(jQuery); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/jsTree/themes/apple/bg.jpg b/spec/test_app/public/javascripts/jsTree/themes/apple/bg.jpg new file mode 100755 index 0000000..3aad05d Binary files /dev/null and b/spec/test_app/public/javascripts/jsTree/themes/apple/bg.jpg differ diff --git a/spec/test_app/public/javascripts/jsTree/themes/apple/dot_for_ie.gif b/spec/test_app/public/javascripts/jsTree/themes/apple/dot_for_ie.gif new file mode 100755 index 0000000..c0cc5fd Binary files /dev/null and b/spec/test_app/public/javascripts/jsTree/themes/apple/dot_for_ie.gif differ diff --git a/spec/test_app/public/javascripts/jsTree/themes/apple/icons.png b/spec/test_app/public/javascripts/jsTree/themes/apple/icons.png new file mode 100755 index 0000000..7923057 Binary files /dev/null and b/spec/test_app/public/javascripts/jsTree/themes/apple/icons.png differ diff --git a/spec/test_app/public/javascripts/jsTree/themes/apple/style.css b/spec/test_app/public/javascripts/jsTree/themes/apple/style.css new file mode 100755 index 0000000..800c679 --- /dev/null +++ b/spec/test_app/public/javascripts/jsTree/themes/apple/style.css @@ -0,0 +1,34 @@ +/* BACKGROUND */ +.tree-apple .ltr, .tree-apple .rtl { background:url("bg.jpg") left top repeat; min-width:100%; _width:100%; margin-left:0; margin-right:0; display:table; } +.tree-apple .ltr > li.leaf, .tree-apple .rtl > li.leaf { background-image:none; } + +/* LOCKED */ +.tree-apple .locked li a { color:gray; } +/* DOTS */ +.tree-apple ul { background-position:6px 1px; background-repeat:repeat-y; background-image:url(data:image/gif;base64,R0lGODlhAgACAIAAAB4dGf///yH5BAEAAAEALAAAAAACAAIAAAICRF4AOw==); _background-image:url("dot_for_ie.gif"); *background-image:url("dot_for_ie.gif"); } +.tree-apple li { background-position:-64px -16px; background-repeat:no-repeat; background-image:url("icons.png"); } +/* NO DOTS */ +.tree-apple .no_dots, .tree-apple .no_dots ul { background:transparent; } +.tree-apple .no_dots li.leaf { background-image:none; background-color:transparent; } +/* OPEN or CLOSED */ +.tree-apple li.open { background:url("icons.png") -32px -48px no-repeat; } +.tree-apple li.closed, #jstree-dragged.tree-apple li li.open { background:url("icons.png") -48px -32px no-repeat; } +#jstree-marker { background-image:url("icons.png"); } +/* DEFAULT, HOVER, CLICKED, LOADING STATES */ +.tree-apple li a, .tree-apple li span { border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; } +.tree-apple li a:hover, .tree-apple li a.hover, .tree-apple li span { background: #e7f4f9; border:1px solid #d8f0fa; padding:0px 3px 0px 3px; } +.tree-apple li a.clicked, .tree-apple li a.clicked:hover, .tree-apple li span.clicked { background: #beebff; border:1px solid #99defd; padding:0px 3px 0px 3px; } +/* ICONS */ +.tree-apple ins { background-image:url("icons.png"); background-position:0 0; background-repeat:no-repeat; } +.tree-apple ul li a.loading ins { background-image:url("throbber.gif") !important; background-position:0 0 !important; } /* UL is added to make selector stronger */ +.tree-apple li a ins.forbidden { background-position:-16px -16px; } +.tree-apple .locked li a ins { background-position:0 -48px; } +.tree-apple li span ins { background-position:-16px 0; } +#jstree-dragged.tree-apple ins { background:url("icons.png") -16px -32px no-repeat; } +#jstree-dragged.tree-apple ins.forbidden { background:url("icons.png") -16px -16px no-repeat; } + +/* CONTEXT MENU */ +.tree-apple-context a ins { background-image:url("icons.png"); background-repeat:no-repeat; background-position:-64px -64px; } +.tree-apple-context a ins.create { background-position:0 -16px; } +.tree-apple-context a ins.rename { background-position:-16px 0px; } +.tree-apple-context a ins.remove { background-position:0 -32px; } \ No newline at end of file diff --git a/spec/test_app/public/javascripts/jsTree/themes/apple/throbber.gif b/spec/test_app/public/javascripts/jsTree/themes/apple/throbber.gif new file mode 100755 index 0000000..95ff649 Binary files /dev/null and b/spec/test_app/public/javascripts/jsTree/themes/apple/throbber.gif differ diff --git a/spec/test_app/public/javascripts/lang/af.js b/spec/test_app/public/javascripts/lang/af.js new file mode 100644 index 0000000..1e2e21e --- /dev/null +++ b/spec/test_app/public/javascripts/lang/af.js @@ -0,0 +1,40 @@ +var fdLocale = { + months:[ + "Januarie", + "Februarie", + "Maart", + "April", + "Mei", + "Junie", + "Julie", + "Augustus", + "September", + "Oktober", + "November", + "Desember" + ], + fullDay:[ + "Maandag", + "Dinsdag", + "Woensdag", + "Donderdag", + "Vrydag", + "Saterdag", + "Sondag" + ], + /* Only stipulate the dayAbbr should the first letter of the fullDay not suffice + + dayAbbr:[], + */ + + /* Only stipulate the firstDayOfWeek should the first day not be Monday + + firstDayOfWeek:0, + */ + titles:[ + "Vorige maand", + "Volgende maand", + "Vorige jaar", + "Volgende jaar" + ] +}; diff --git a/spec/test_app/public/javascripts/lang/ar.js b/spec/test_app/public/javascripts/lang/ar.js new file mode 100644 index 0000000..602091a --- /dev/null +++ b/spec/test_app/public/javascripts/lang/ar.js @@ -0,0 +1,50 @@ +var fdLocale = { + months:[ + "يناير", + "فبراير", + "مارس", + "أبريل", + "مايو", + "يونيو", + "يوليو", + "أغسطس", + "سبتمبر", + "أكتوبر", + "نوٿمبر", + "ديسمبر" + ], + fullDay:[ + "الاثنين", + "الثلاثاء", + "الأربعاء", + "الخميس", + "الجمعة", + "السبت", + "الأحد" + ], + + /* Only stipulate the dayAbbr should the first letter of the fullDay not suffice */ + + + dayAbbr:[ + "الاثنين", + "الثلاثاء", + "الأربعاء", + "الخميس", + "الجمعة", + "السبت", + "الأحد" + ], + + /* Only stipulate the firstDayOfWeek should the first day not be Monday + + firstDayOfWeek:0, + */ + + titles:[ + "الشهر السابق", + "الشهر المقبل", + "السنة السابقة", + "السنة المقبلة" + ] +}; diff --git a/spec/test_app/public/javascripts/lang/de.js b/spec/test_app/public/javascripts/lang/de.js new file mode 100644 index 0000000..f13de39 --- /dev/null +++ b/spec/test_app/public/javascripts/lang/de.js @@ -0,0 +1,40 @@ +var fdLocale = { + months:[ + "Januar", + "Februar", + "M\u00e4rz", + "April", + "Mai", + "Juni", + "Juli", + "August", + "September", + "Oktober", + "November", + "Dezember" + ], + fullDay:[ + "Montag", + "Dienstag", + "Mittwoch", + "Donnerstag", + "Freitag", + "Samstag", + "Sonntag" + ], + /* Only stipulate the dayAbbr should the first letter of the fullDay not suffice + + dayAbbr:[], + */ + + /* Only stipulate the firstDayOfWeek should the first day not be Monday + + firstDayOfWeek:0, + */ + titles:[ + "Voriger Monat", + "N\u00e4chst. Monat", + "Voriges Jahr", + "N\u00e4chst. Jahr" + ] +}; diff --git a/spec/test_app/public/javascripts/lang/du.js b/spec/test_app/public/javascripts/lang/du.js new file mode 100644 index 0000000..5d77b6b --- /dev/null +++ b/spec/test_app/public/javascripts/lang/du.js @@ -0,0 +1,40 @@ +var fdLocale = { + months:[ + "Januari", + "Februari", + "Maart", + "April", + "Mei", + "Juni", + "Juli", + "Augustus", + "September", + "Oktober", + "November", + "December" + ], + fullDay:[ + "Maandag", + "Dinsdag", + "Woensdag", + "Donderdag", + "Vrijdag", + "Zaterdag", + "Zondag" + ], + /* Only stipulate the dayAbbr should the first letter of the fullDay not suffice + + dayAbbr:[], + */ + + /* Only stipulate the firstDayOfWeek should the first day not be Monday + + firstDayOfWeek:0, + */ + titles:[ + "Vorige Maand", + "Volgende Maand", + "Vorig jaar", + "Volgend jaar" + ] +}; diff --git a/spec/test_app/public/javascripts/lang/en.js b/spec/test_app/public/javascripts/lang/en.js new file mode 100644 index 0000000..fe5eec4 --- /dev/null +++ b/spec/test_app/public/javascripts/lang/en.js @@ -0,0 +1,42 @@ +var fdLocale = { + months:[ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + ], + fullDay:[ + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Sunday" + ], + /* Only stipulate the dayAbbr should the first letter of the fullDay not suffice + + dayAbbr:[], + */ + + /* Only stipulate the firstDayOfWeek should the first day not be Monday + + firstDayOfWeek:0, + */ + titles:[ + "Previous month", + "Next month", + "Previous year", + "Next year", + "Today", + "Show Calendar" + ] +}; diff --git a/spec/test_app/public/javascripts/lang/es.js b/spec/test_app/public/javascripts/lang/es.js new file mode 100644 index 0000000..4aecdcd --- /dev/null +++ b/spec/test_app/public/javascripts/lang/es.js @@ -0,0 +1,41 @@ +var fdLocale = { + months:[ + "Enero", + "Febrero", + "Marzo", + "Abril", + "Mayo", + "Junio", + "Julio", + "Agosto", + "Septiembre", + "Octubre", + "Noviembre", + "Diciembre" + ], + fullDay:[ + "Lunes", + "Martes", + "Mi\u00e9rcoles", + "Jueves", + "Viernes", + "S\u00e1bado", + "Domingo" + ], + /* Only stipulate the dayAbbr should the first letter of the fullDay not suffice + + dayAbbr:[], + */ + + /* Only stipulate the firstDayOfWeek should the first day not be Monday + + firstDayOfWeek:0, + */ + titles:[ + "Mes Anterior", + "Mes Siguiente", + "A\u00f1o anterior", + "A\u00f1o Siguiente", + "Hoy" + ] +}; diff --git a/spec/test_app/public/javascripts/lang/fi.js b/spec/test_app/public/javascripts/lang/fi.js new file mode 100644 index 0000000..1e204f3 --- /dev/null +++ b/spec/test_app/public/javascripts/lang/fi.js @@ -0,0 +1,40 @@ +var fdLocale = { + months:[ + "Tammikuu", + "Helmikuu", + "Maaliskuu", + "Huhtikuu", + "Toukokuu", + "Kes\u00e4kuu", + "Hein\u00e4kuu", + "Elokuu", + "Syyskuu", + "Lokakuu", + "Marraskuu", + "Joulukuu" + ], + fullDay:[ + "Maanantai", + "Tiistai", + "Keskiviikko", + "Torstai", + "Perjantai", + "Lauantai", + "Sunnuntai" + ], + /* Only stipulate the dayAbbr should the first letter of the fullDay not suffice + + dayAbbr:[], + */ + + /* Only stipulate the firstDayOfWeek should the first day not be Monday + + firstDayOfWeek:0, + */ + titles:[ + "Edellinen kuukausi", + "Seuraava kuukausi", + "Edellinen vuosi", + "Seuraava vuosi" + ] +}; diff --git a/spec/test_app/public/javascripts/lang/fr.js b/spec/test_app/public/javascripts/lang/fr.js new file mode 100644 index 0000000..fb524a3 --- /dev/null +++ b/spec/test_app/public/javascripts/lang/fr.js @@ -0,0 +1,44 @@ +var fdLocale = { + months:[ + "Janvier", + "F\u00E9vrier", + "Mars", + "Avril", + "Mai", + "Juin", + "Juillet", + "Ao\u00FBt", + "Septembre", + "Octobre", + "Novembre", + "D\u00E9cembre" + ], + fullDay:[ + "Lundi", + "Mardi", + "Mercredi", + "Jeudi", + "Vendredi", + "Samedi", + "Dimanche" + ], + + /* Only stipulate the dayAbbr should the first letter of the fullDay not suffice + + dayAbbr:[], + */ + + /* Only stipulate the firstDayOfWeek should the first day not be Monday + + firstDayOfWeek:0, + */ + + titles:[ + "Mois pr\u00E9cedent", + "Mois suivant", + "Ann\u00E9e pr\u00E9cedente", + "Ann\u00E9e suivante", + "Aujourd\u2019hui", + "Voir Calendrier" + ] +}; diff --git a/spec/test_app/public/javascripts/lang/gr.js b/spec/test_app/public/javascripts/lang/gr.js new file mode 100644 index 0000000..8f52c10 --- /dev/null +++ b/spec/test_app/public/javascripts/lang/gr.js @@ -0,0 +1,40 @@ +var fdLocale = { + months:[ + "Ιανουάριος", + "Φεβρουάριος", + "Μάρτιος", + "Απρίλιος", + "Μάιος", + "Ιούνιος", + "Ιούλιος", + "Αύγουστος", + "Σεπτέμβριος", + "Οκτώβριος", + "Νοέμβριος", + "Δεκέμβριος" + ], + fullDay:[ + "Δευτέρα", + "Τρίτη", + "Τετάρτη", + "Πέμπτη", + "Παρασκευή", + "Σάββατο", + "Κυριακή" + ], + /* Only stipulate the dayAbbr should the first letter of the fullDay not suffice + + dayAbbr:[], + */ + + /* Only stipulate the firstDayOfWeek should the first day not be Monday + + firstDayOfWeek:0, + */ + titles:[ + "Προηγούμενος μήνας", + "Επόμενος μήνας", + "Προηγούμενη χρόνιά", + "Επόμενη χρονιά" + ] +}; \ No newline at end of file diff --git a/spec/test_app/public/javascripts/lang/he.js b/spec/test_app/public/javascripts/lang/he.js new file mode 100644 index 0000000..8b1167a --- /dev/null +++ b/spec/test_app/public/javascripts/lang/he.js @@ -0,0 +1,49 @@ +var fdLocale = { + months:[ + "ינואר", + "פברואר", + "מרץ", + "אפריל", + "מאי", + "יוני", + "יולי", + "אוגוסט", + "ספטמבר", + "אוקטובר", + "נובמבר", + "דצמבר" + ], + fullDay:[ + "שני", + "שלישי", + "רביעי", + "חמישי", + "שישי", + "שבת", + "ראשון" + ], + /* Only stipulate the dayAbbr should the first letter of the fullDay not suffice + */ + dayAbbr:[ + 'ב', + 'ג', + 'ד', + 'ה', + 'ו', + 'ש', + 'א' + ], + + + /* Only stipulate the firstDayOfWeek should the first day not be Monday + */ + firstDayOfWeek:6, + + titles:[ + "חודש קודם", + "חודש הבא", + "שנה קודמת", + "שנה הבאה", + "היום" + ] +}; diff --git a/spec/test_app/public/javascripts/lang/it.js b/spec/test_app/public/javascripts/lang/it.js new file mode 100644 index 0000000..828f21f --- /dev/null +++ b/spec/test_app/public/javascripts/lang/it.js @@ -0,0 +1,13 @@ +// italian translation by raf + +var fdLocale = { + months:[ "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre" ], + fullDay:[ "Luned\u00ec", "Marted\u00ec", "Mercoled\u00ec", "Gioved\u00ec", "Venerd\u00ec", "Sabato", "Domenica" ], + /* + Only stipulate the dayAbbr should the first letter of the fullDay not suffice + dayAbbr:[], + Only stipulate the firstDayOfWeek should the first day not be Monday + firstDayOfWeek:0, + */ + titles:[ "Mese Precedente", "Mese Successivo", "Anno Precedente", "Anno Successivo", "Oggi" ] +}; diff --git a/spec/test_app/public/javascripts/lang/nl.js b/spec/test_app/public/javascripts/lang/nl.js new file mode 100644 index 0000000..5d77b6b --- /dev/null +++ b/spec/test_app/public/javascripts/lang/nl.js @@ -0,0 +1,40 @@ +var fdLocale = { + months:[ + "Januari", + "Februari", + "Maart", + "April", + "Mei", + "Juni", + "Juli", + "Augustus", + "September", + "Oktober", + "November", + "December" + ], + fullDay:[ + "Maandag", + "Dinsdag", + "Woensdag", + "Donderdag", + "Vrijdag", + "Zaterdag", + "Zondag" + ], + /* Only stipulate the dayAbbr should the first letter of the fullDay not suffice + + dayAbbr:[], + */ + + /* Only stipulate the firstDayOfWeek should the first day not be Monday + + firstDayOfWeek:0, + */ + titles:[ + "Vorige Maand", + "Volgende Maand", + "Vorig jaar", + "Volgend jaar" + ] +}; diff --git a/spec/test_app/public/javascripts/lang/no.js b/spec/test_app/public/javascripts/lang/no.js new file mode 100644 index 0000000..1a1186a --- /dev/null +++ b/spec/test_app/public/javascripts/lang/no.js @@ -0,0 +1,40 @@ +var fdLocale = { + months:[ + "Januar", + "Februar", + "Mars", + "April", + "Mai", + "Juni", + "Juli", + "August", + "September", + "Oktober", + "November", + "Desember" + ], + fullDay:[ + "Mandag", + "Tirsdag", + "Onsdag", + "Torsdag", + "Fredag", + "L\u00f8rdag", + "S\u00f8ndag" + ], + /* Only stipulate the dayAbbr should the first letter of the fullDay not suffice + + dayAbbr:[], + */ + + /* Only stipulate the firstDayOfWeek should the first day not be Monday + + firstDayOfWeek:0, + */ + titles:[ + "Forrige m\u00e5ned", + "Neste m\u00e5ned", + "Forrige \u00e5r", + "Neste \u00e5r" + ] +}; diff --git a/spec/test_app/public/javascripts/lang/pt.js b/spec/test_app/public/javascripts/lang/pt.js new file mode 100644 index 0000000..ccd7733 --- /dev/null +++ b/spec/test_app/public/javascripts/lang/pt.js @@ -0,0 +1,50 @@ +var fdLocale = { + months:[ + "Janeiro", + "Fevereiro", + "Mar\u00E7o", + "Abril", + "Maio", + "Junho", + "Julho", + "Agosto", + "Setembro", + "Outubro", + "Novembro", + "Dezembro" + ], + fullDay:[ + "Segunda", + "Ter\u00E7a", + "Quarta", + "Quinta", + "Sexta", + "S\u00E1bado", + "Domingo" + ], + /* Only stipulate the dayAbbr should the first letter of the fullDay not suffice + + dayAbbr:[], + */ + dayAbbr:["Seg", + "Ter", + "Qua", + "Qui", + "Sex", + "Sab", + "Dom"], + + /* Only stipulate the firstDayOfWeek should the first day not be Monday + + firstDayOfWeek:0, + */ + firstDayOfWeek:6, + titles:[ + "M\u00EAs anterior", + "Pr\u00F3ximo m\u00EAs", + "Ano anterior", + "Pr\u00F3ximo ano", + "Hoje", + "Exibir calend\u00E1rio" + ] +}; diff --git a/spec/test_app/public/javascripts/lang/ro.js b/spec/test_app/public/javascripts/lang/ro.js new file mode 100644 index 0000000..6d80161 --- /dev/null +++ b/spec/test_app/public/javascripts/lang/ro.js @@ -0,0 +1,40 @@ +var fdLocale = { + months:[ + "Ianuarie", + "Februarie", + "Martie", + "Aprilie", + "Mai", + "Iunie", + "Iulie", + "August", + "Septembrie", + "Octombrie", + "Noiembrie", + "Decembrie" + ], + fullDay:[ + "Luni", + "Mar\u0163i", + "Miercuri", + "Joi", + "Vineri", + "S\u00e2mb\u00e3t\u00e3", + "Duminic\u00e3" + ], + /* Only stipulate the dayAbbr should the first letter of the fullDay not suffice + + dayAbbr:[], + */ + + /* Only stipulate the firstDayOfWeek should the first day not be Monday + + firstDayOfWeek:0, + */ + titles:[ + "Luna anterioar\u00e3", + "Luna urm\u00e3toare", + "Anul anterior", + "Anul urm\u00e3tor" + ] +}; diff --git a/spec/test_app/public/javascripts/lang/ru.js b/spec/test_app/public/javascripts/lang/ru.js new file mode 100644 index 0000000..d45f224 --- /dev/null +++ b/spec/test_app/public/javascripts/lang/ru.js @@ -0,0 +1,40 @@ +var fdLocale = { + months:[ + "Январь", + "Февраль", + "Март", + "Апрель", + "Май", + "Июнь", + "Июль", + "Август", + "Сентябрь", + "Октябрь", + "Ноябрь", + "Декабрь" + ], + fullDay:[ + "Понедельник", + "Вторник", + "Среда", + "Четверг", + "Пятница", + "Суббота", + "Воскресенье" + ], + /* Only stipulate the dayAbbr should the first letter of the fullDay not suffice + + dayAbbr:[], + */ + + /* Only stipulate the firstDayOfWeek should the first day not be Monday + + firstDayOfWeek:0, + */ + titles:[ + "Предыдущий месяц", + "Следующий месяц", + "Предыдущий год", + "Следующий год" + ] +}; diff --git a/spec/test_app/public/javascripts/lang/sp.js b/spec/test_app/public/javascripts/lang/sp.js new file mode 100644 index 0000000..ecfd7dc --- /dev/null +++ b/spec/test_app/public/javascripts/lang/sp.js @@ -0,0 +1,40 @@ +var fdLocale = { + months:[ + "Enero", + "Febrero", + "Marzo", + "Abril", + "Mayo", + "Junio", + "Julio", + "Agosto", + "Septiembre", + "Octubre", + "Noviembre", + "Diciembre" + ], + fullDay:[ + "Lunes", + "Martes", + "Mi\u00e9rcoles", + "Jueves", + "Viernes", + "S\u00e1bado", + "Domingo" + ], + /* Only stipulate the dayAbbr should the first letter of the fullDay not suffice + + dayAbbr:[], + */ + + /* Only stipulate the firstDayOfWeek should the first day not be Monday + + firstDayOfWeek:0, + */ + titles:[ + "Mes Anterior", + "Mes Siguiente", + "A\u00f1o Anterior", + "A\u00f1o Siguiente" + ] +}; diff --git a/spec/test_app/public/javascripts/lang/sv.js b/spec/test_app/public/javascripts/lang/sv.js new file mode 100644 index 0000000..3c5c2a1 --- /dev/null +++ b/spec/test_app/public/javascripts/lang/sv.js @@ -0,0 +1,41 @@ +// Swedish +var fdLocale = { + months:[ + "Januari", + "Februari", + "Mars", + "April", + "Maj", + "Juni", + "Juli", + "Augusti", + "September", + "Oktober", + "November", + "December" + ], + fullDay:[ + "M\u00e5ndag", + "Tisdag", + "Onsdag", + "Torsdag", + "Fredag", + "L\u00f6rdag", + "S\u00f6ndag" + ], + /* Only stipulate the dayAbbr should the first letter of the fullDay not suffice + + dayAbbr:[], + */ + + /* Only stipulate the firstDayOfWeek should the first day not be Monday + + firstDayOfWeek:0, + */ + titles:[ + "F\u00f6reg\u00e5ende m\u00e5nad", + "N\u00e4sta m\u00e5nad", + "F\u00f6reg\u00e5ende \u00e5r", + "N\u00e4sta \u00e5r" + ] +}; diff --git a/spec/test_app/public/javascripts/lang/ua.js b/spec/test_app/public/javascripts/lang/ua.js new file mode 100644 index 0000000..9aa2fb6 --- /dev/null +++ b/spec/test_app/public/javascripts/lang/ua.js @@ -0,0 +1,40 @@ +var fdLocale = { + months:[ + "Січень", + "Лютий", + "Березень", + "Квітень", + "Травень", + "Червень", + "Липень", + "Серпень", + "Вересень", + "Жовтень", + "Листопад", + "Грудень" + ], + fullDay:[ + "Понеділок", + "Вівторок", + "Середа", + "Четвер", + "П'ятниця", + "Субота", + "Неділя" + ], + /* Only stipulate the dayAbbr should the first letter of the fullDay not suffice + + dayAbbr:[], + */ + + /* Only stipulate the firstDayOfWeek should the first day not be Monday + + firstDayOfWeek:0, + */ + titles:[ + "Попередній місяць", + "Наступний місяць", + "Попередній рік", + "Наступний рік" + ] +}; \ No newline at end of file diff --git a/spec/test_app/public/javascripts/localization/messages_cn.js b/spec/test_app/public/javascripts/localization/messages_cn.js new file mode 100644 index 0000000..f24f5a4 --- /dev/null +++ b/spec/test_app/public/javascripts/localization/messages_cn.js @@ -0,0 +1,24 @@ +/* + * Translated default messages for the jQuery validation plugin. + * Language: CN + * Author: Fayland Lam + */ +jQuery.extend(jQuery.validator.messages, { + required: "必选字段", + remote: "请修正该字段", + email: "请输入正确格式的电子邮件", + url: "请输入合法的网址", + date: "请输入合法的日期", + dateISO: "请输入合法的日期 (ISO).", + number: "请输入合法的数字", + digits: "只能输入整数", + creditcard: "请输入合法的信用卡号", + equalTo: "请再次输入相同的值", + accept: "请输入拥有合法后缀名的字符串", + maxlength: jQuery.validator.format("请输入一个长度最多是 {0} 的字符串"), + minlength: jQuery.validator.format("请输入一个长度最少是 {0} 的字符串"), + rangelength: jQuery.validator.format("请输入一个长度介于 {0} 和 {1} 之间的字符串"), + range: jQuery.validator.format("请输入一个介于 {0} 和 {1} 之间的值"), + max: jQuery.validator.format("请输入一个最大为 {0} 的值"), + min: jQuery.validator.format("请输入一个最小为 {0} 的值") +}); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/localization/messages_cs.js b/spec/test_app/public/javascripts/localization/messages_cs.js new file mode 100644 index 0000000..f5391da --- /dev/null +++ b/spec/test_app/public/javascripts/localization/messages_cs.js @@ -0,0 +1,23 @@ +/* + * Translated default messages for the jQuery validation plugin. + * Language: CS + */ +jQuery.extend(jQuery.validator.messages, { + required: "Tento údaj je povinný.", + remote: "Prosím, opravte tento údaj.", + email: "Prosím, zadejte platný e-mail.", + url: "Prosím, zadejte platné URL.", + date: "Prosím, zadejte platné datum.", + dateISO: "Prosím, zadejte platné datum (ISO).", + number: "Prosím, zadejte číslo.", + digits: "Prosím, zadávejte pouze číslice.", + creditcard: "Prosím, zadejte číslo kreditní karty.", + equalTo: "Prosím, zadejte znovu stejnou hodnotu.", + accept: "Prosím, zadejte soubor se správnou příponou.", + maxlength: jQuery.validator.format("Prosím, zadejte nejvíce {0} znaků."), + minlength: jQuery.validator.format("Prosím, zadejte nejméně {0} znaků."), + rangelength: jQuery.validator.format("Prosím, zadejte od {0} do {1} znaků."), + range: jQuery.validator.format("Prosím, zadejte hodnotu od {0} do {1}."), + max: jQuery.validator.format("Prosím, zadejte hodnotu menší nebo rovnu {0}."), + min: jQuery.validator.format("Prosím, zadejte hodnotu větší nebo rovnu {0}.") +}); diff --git a/spec/test_app/public/javascripts/localization/messages_da.js b/spec/test_app/public/javascripts/localization/messages_da.js new file mode 100644 index 0000000..3736d96 --- /dev/null +++ b/spec/test_app/public/javascripts/localization/messages_da.js @@ -0,0 +1,21 @@ +/* + * Translated default messages for the jQuery validation plugin. + * Language: DA + * Skipped date/dateISO/number. + */ +jQuery.extend(jQuery.validator.messages, { + required: "Dette felt er påkrævet.", + maxlength: jQuery.validator.format("Indtast højst {0} tegn."), + minlength: jQuery.validator.format("Indtast mindst {0} tegn."), + rangelength: jQuery.validator.format("Indtast mindst {0} og højst {1} tegn."), + email: "Indtast en gyldig email-adresse.", + url: "Indtast en gyldig URL.", + dateDE: "Indtast en gyldig dato.", + numberDE: "Indtast et tal.", + digits: "Indtast kun cifre.", + equalTo: "Indtast den samme værdi igen.", + range: jQuery.validator.format("Angiv en værdi mellem {0} og {1}."), + max: jQuery.validator.format("Angiv en værdi der højst er {0}."), + min: jQuery.validator.format("Angiv en værdi der mindst er {0}."), + creditcard: "Indtast et gyldigt kreditkortnummer." +}); diff --git a/spec/test_app/public/javascripts/localization/messages_de.js b/spec/test_app/public/javascripts/localization/messages_de.js new file mode 100644 index 0000000..5c1a5b3 --- /dev/null +++ b/spec/test_app/public/javascripts/localization/messages_de.js @@ -0,0 +1,21 @@ +/* + * Translated default messages for the jQuery validation plugin. + * Language: DE + * Skipped date/dateISO/number. + */ +jQuery.extend(jQuery.validator.messages, { + required: "Dieses Feld ist ein Pflichtfeld.", + maxlength: jQuery.validator.format("Geben Sie bitte maximal {0} Zeichen ein."), + minlength: jQuery.validator.format("Geben Sie bitte mindestens {0} Zeichen ein."), + rangelength: jQuery.validator.format("Geben Sie bitte mindestens {0} und maximal {1} Zeichen ein."), + email: "Geben Sie bitte eine gültige E-Mail Adresse ein.", + url: "Geben Sie bitte eine gültige URL ein.", + dateDE: "Bitte geben Sie ein gültiges Datum ein.", + numberDE: "Geben Sie bitte eine Nummer ein.", + digits: "Geben Sie bitte nur Ziffern ein.", + equalTo: "Bitte denselben Wert wiederholen.", + range: jQuery.validator.format("Geben Sie bitten einen Wert zwischen {0} und {1}."), + max: jQuery.validator.format("Geben Sie bitte einen Wert kleiner oder gleich {0} ein."), + min: jQuery.validator.format("Geben Sie bitte einen Wert größer oder gleich {0} ein."), + creditcard: "Geben Sie bitte ein gültige Kreditkarten-Nummer ein." +}); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/localization/messages_es.js b/spec/test_app/public/javascripts/localization/messages_es.js new file mode 100644 index 0000000..28262c0 --- /dev/null +++ b/spec/test_app/public/javascripts/localization/messages_es.js @@ -0,0 +1,24 @@ +/* + * Translated default messages for the jQuery validation plugin. + * Language: ES + * Author: David Esperalta - http://www.dec.gesbit.com/ + */ +jQuery.extend(jQuery.validator.messages, { + required: "Este campo es obligatorio.", + remote: "Por favor, rellena esta campo.", + email: "Por favor, escribe una dirección de correo válida", + url: "Por favor, escribe una URL válida.", + date: "Por favor, escribe una fecha válida.", + dateISO: "Por favor, escribe una fecha (ISO) válida.", + number: "Por favor, escribe un número entero válido.", + digits: "Por favor, escribe sólo dígitos.", + creditcard: "Por favor, escribe un número de tarjeta válido.", + equalTo: "Por favor, escribe el mismo valor de nuevo.", + accept: "Por favor, escribe una valor con una extensión aceptada.", + maxlength: jQuery.validator.format("Por favor, no escribas más de {0} caracteres."), + minlength: jQuery.validator.format("Por favor, no escribas menos de {0} caracteres."), + rangelength: jQuery.validator.format("Por favor, escribe un valor entre {0} y {1} caracteres."), + range: jQuery.validator.format("Por favor, escribe un valor entre {0} y {1}."), + max: jQuery.validator.format("Por favor, escribe un valor igual o menor que {0}."), + min: jQuery.validator.format("Por favor, escribe un valor igual o mayor que {0}.") +}); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/localization/messages_fr.js b/spec/test_app/public/javascripts/localization/messages_fr.js new file mode 100644 index 0000000..9825dbe --- /dev/null +++ b/spec/test_app/public/javascripts/localization/messages_fr.js @@ -0,0 +1,23 @@ +/* + * Translated default messages for the jQuery validation plugin. + * Language: FR + */ +jQuery.extend(jQuery.validator.messages, { + required: "Ce champ est requis.", + remote: "Veuillez remplir ce champ pour continuer.", + email: "Veuillez entrer une adresse email valide.", + url: "Veuillez entrer une URL valide.", + date: "Veuillez entrer une date valide.", + dateISO: "Veuillez entrer une date valide (ISO).", + number: "Veuillez entrer un nombre valide.", + digits: "Veuillez entrer (seulement) une valeur numérique.", + creditcard: "Veuillez entrer un numéro de carte de crédit valide.", + equalTo: "Veuillez entrer une nouvelle fois la même valeur.", + accept: "Veuillez entrer une valeur avec une extension valide.", + maxlength: jQuery.validator.format("Veuillez ne pas entrer plus de {0} caractères."), + minlength: jQuery.validator.format("Veuillez entrer au moins {0} caractères."), + rangelength: jQuery.validator.format("Veuillez entrer entre {0} et {1} caractères."), + range: jQuery.validator.format("Veuillez entrer une valeur entre {0} et {1}."), + max: jQuery.validator.format("Veuillez entrer une valeur inférieure ou égale à {0}."), + min: jQuery.validator.format("Veuillez entrer une valeur supérieure ou égale à {0}.") +}); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/localization/messages_hu.js b/spec/test_app/public/javascripts/localization/messages_hu.js new file mode 100644 index 0000000..ba42340 --- /dev/null +++ b/spec/test_app/public/javascripts/localization/messages_hu.js @@ -0,0 +1,21 @@ +/* + * Translated default messages for the jQuery validation plugin. + * Language: HU + * Skipped dateISO/DE, numberDE + */ +jQuery.extend(jQuery.validator.messages, { + required: "Kötelező megadni.", + maxlength: jQuery.validator.format("Legfeljebb {0} karakter hosszú legyen."), + minlength: jQuery.validator.format("Legalább {0} karakter hosszú legyen."), + rangelength: jQuery.validator.format("Legalább {0} és legfeljebb {1} karakter hosszú legyen."), + email: "Érvényes e-mail címnek kell lennie.", + url: "Érvényes URL-nek kell lennie.", + date: "Dátumnak kell lennie.", + number: "Számnak kell lennie.", + digits: "Csak számjegyek lehetnek.", + equalTo: "Meg kell egyeznie a két értéknek.", + range: jQuery.validator.format("{0} és {1} közé kell esnie."), + max: jQuery.validator.format("Nem lehet nagyobb, mint {0}."), + min: jQuery.validator.format("Nem lehet kisebb, mint {0}."), + creditcard: "Érvényes hitelkártyaszámnak kell lennie." +}); diff --git a/spec/test_app/public/javascripts/localization/messages_it.js b/spec/test_app/public/javascripts/localization/messages_it.js new file mode 100644 index 0000000..a4669d4 --- /dev/null +++ b/spec/test_app/public/javascripts/localization/messages_it.js @@ -0,0 +1,26 @@ +/* + * Traduzione dei messaggi di default per il pugin jQuery validation. + * Language: IT + * Traduzione a cura di Davide Falchetto + * E-mail: d.falchetto@d4solutions.it + * Web: www.d4solutions.it + */ +jQuery.extend(jQuery.validator.messages, { + required: "Campo obbligatorio.", + remote: "Controlla questo campo.", + email: "Inserisci un indirizzo email valido.", + url: "Inserisci un indirizzo web valido.", + date: "Inserisci una data valida.", + dateISO: "Inserisci una data valida (ISO).", + number: "Inserisci un numero valido.", + digits: "Inserisci solo numeri.", + creditcard: "Inserisci un numero di carta di credito valido.", + equalTo: "Il valore non corrisponde.", + accept: "Inserisci un valore con un'estensione valida.", + maxlength: jQuery.validator.format("Non inserire più di {0} caratteri."), + minlength: jQuery.validator.format("Inserisci almeno {0} caratteri."), + rangelength: jQuery.validator.format("Inserisci un valore compreso tra {0} e {1} caratteri."), + range: jQuery.validator.format("Inserisci un valore compreso tra {0} e {1}."), + max: jQuery.validator.format("Inserisci un valore minore o uguale a {0}."), + min: jQuery.validator.format("Inserisci un valore maggiore o uguale a {0}.") +}); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/localization/messages_kk.js b/spec/test_app/public/javascripts/localization/messages_kk.js new file mode 100644 index 0000000..2e93fc3 --- /dev/null +++ b/spec/test_app/public/javascripts/localization/messages_kk.js @@ -0,0 +1,23 @@ +/* + * Translated default messages for the jQuery validation plugin. + * Language: KK + */ +jQuery.extend(jQuery.validator.messages, { + required: "Бұл өрісті міндетті түрде толтырыңыз.", + remote: "Дұрыс мағына енгізуіңізді сұраймыз.", + email: "Нақты электронды поштаңызды енгізуіңізді сұраймыз.", + url: "Нақты URL-ды енгізуіңізді сұраймыз.", + date: "Нақты URL-ды енгізуіңізді сұраймыз.", + dateISO: "Нақты ISO форматымен сәйкес датасын енгізуіңізді сұраймыз.", + number: "Күнді енгізуіңізді сұраймыз.", + digits: "Тек қана сандарды енгізуіңізді сұраймыз.", + creditcard: "Несие картасының нөмірін дұрыс енгізуіңізді сұраймыз.", + equalTo: "Осы мәнді қайта енгізуіңізді сұраймыз.", + accept: "Файлдың кеңейтуін дұрыс таңдаңыз.", + maxlength: jQuery.format("Ұзындығы {0} символдан көр болмасын."), + minlength: jQuery.format("Ұзындығы {0} символдан аз болмасын."), + rangelength: jQuery.format("Ұзындығы {0}-{1} дейін мән енгізуіңізді сұраймыз."), + range: jQuery.format("Пожалуйста, введите число от {0} до {1}. - {0} - {1} санын енгізуіңізді сұраймыз."), + max: jQuery.format("{0} аз немесе тең санын енгізуіңіді сұраймыз."), + min: jQuery.format("{0} көп немесе тең санын енгізуіңізді сұраймыз.") +}); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/localization/messages_nl.js b/spec/test_app/public/javascripts/localization/messages_nl.js new file mode 100644 index 0000000..d967637 --- /dev/null +++ b/spec/test_app/public/javascripts/localization/messages_nl.js @@ -0,0 +1,23 @@ +/* + * Translated default messages for the jQuery validation plugin. + * Language: NL + */ +jQuery.extend(jQuery.validator.messages, { + required: "Dit is een verplicht veld.", + remote: "Controleer dit veld.", + email: "Vul hier een geldig email adres in.", + url: "Vul hier een geldige URL in.", + date: "Vul hier een geldige datum in.", + dateISO: "Vul hier een geldige datum in (ISO).", + number: "Vul hier een geldig nummer in.", + digits: "Vul hier alleen nummers in.", + creditcard: "Vul hier een geldig credit card nummer in.", + equalTo: "Vul hier dezelfde waarde in.", + accept: "Vul hier een waarde in met een geldige extensie.", + maxlength: jQuery.validator.format("Vul hier maximaal {0} tekens in."), + minlength: jQuery.validator.format("Vul hier minimaal {0} tekens in."), + rangelength: jQuery.validator.format("Vul hier een waarde in van minimaal {0} en maximaal {1} tekens."), + range: jQuery.validator.format("Vul hier een waarde in van minimaal {0} en maximaal {1}."), + max: jQuery.validator.format("Vul hier een waarde in kleiner dan of gelijk aan {0}."), + min: jQuery.validator.format("Vul hier een waarde in groter dan of gelijk aan {0}.") +}); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/localization/messages_no.js b/spec/test_app/public/javascripts/localization/messages_no.js new file mode 100644 index 0000000..44bfde3 --- /dev/null +++ b/spec/test_app/public/javascripts/localization/messages_no.js @@ -0,0 +1,23 @@ +/* + * Translated default messages for the jQuery validation plugin. + * Language: NO (Norwegian) + */ +jQuery.extend(jQuery.validator.messages, { + required: "Dette feltet er obligatorisk.", + maxlength: jQuery.validator.format("Maksimalt {0} tegn."), + minlength: jQuery.validator.format("Minimum {0} tegn."), + rangelength: jQuery.validator.format("Angi minimum {0} og maksimum {1} tegn."), + email: "Oppgi en gyldig epostadresse.", + url: "Angi en gyldig URL.", + date: "Angi en gyldig dato.", + dateISO: "Angi en gyldig dato (&ARING;&ARING;&ARING;&ARING;-MM-DD).", + dateSE: "Angi en gyldig dato.", + number: "Angi et gyldig nummer.", + numberSE: "Angi et gyldig nummer.", + digits: "Skriv kun tall.", + equalTo: "Skriv samme verdi igjen.", + range: jQuery.validator.format("Angi en verdi mellom {0} og {1}."), + max: jQuery.validator.format("Angi en verdi som er større eller lik {0}."), + min: jQuery.validator.format("Angi en verdi som er mindre eller lik {0}."), + creditcard: "Angi et gyldig kredittkortnummer." +}); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/localization/messages_pl.js b/spec/test_app/public/javascripts/localization/messages_pl.js new file mode 100644 index 0000000..b8a1bfd --- /dev/null +++ b/spec/test_app/public/javascripts/localization/messages_pl.js @@ -0,0 +1,23 @@ +/* + * Translated default messages for the jQuery validation plugin. + * Language: PL + */ +jQuery.extend(jQuery.validator.messages, { + required: "To pole jest wymagane.", + remote: "Proszę o wypełnienie tego pola.", + email: "Proszę o podanie prawidłowego adresu email.", + url: "Proszę o podanie prawidłowego URL.", + date: "Proszę o podanie prawidłowej daty.", + dateISO: "Proszę o podanie prawidłowej daty (ISO).", + number: "Proszę o podanie prawidłowej liczby.", + digits: "Proszę o podanie samych cyfr.", + creditcard: "Proszę o podanie prawidłowej karty kredytowej.", + equalTo: "Proszę o podanie tej samej wartości ponownie.", + accept: "Proszę o podanie wartości z prawidłowym rozszerzeniem.", + maxlength: jQuery.validator.format("Proszę o podanie nie więcej niż {0} znaków."), + minlength: jQuery.validator.format("Proszę o podanie przynajmniej {0} znaków."), + rangelength: jQuery.validator.format("Proszę o podanie wartości o długości od {0} do {1} znaków."), + range: jQuery.validator.format("Proszę o podanie wartości z przedziału od {0} do {1}."), + max: jQuery.validator.format("Proszę o podanie wartości mniejszej bądź równej {0}."), + min: jQuery.validator.format("Proszę o podanie wartości większej bądź równej {0}.") +}); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/localization/messages_ptbr.js b/spec/test_app/public/javascripts/localization/messages_ptbr.js new file mode 100644 index 0000000..1575dcf --- /dev/null +++ b/spec/test_app/public/javascripts/localization/messages_ptbr.js @@ -0,0 +1,30 @@ +/** + * Translated default messages for the jQuery validation plugin. + * Language: PT_BR + * Translator: Francisco Ernesto Teixeira + */ +jQuery.extend(jQuery.validator.messages, { + required: "Este campo é requerido.", + remote: "Por favor, corrija este campo.", + email: "Por favor, forneça um endereço eletrônico válido.", + url: "Por favor, forneça uma URL válida.", + date: "Por favor, forneça uma data válida.", + dateISO: "Por favor, forneça uma data válida (ISO).", + dateDE: "Bitte geben Sie ein gültiges Datum ein.", + number: "Por favor, forneça um número válida.", + numberDE: "Bitte geben Sie eine Nummer ein.", + digits: "Por favor, forneça somente dígitos.", + creditcard: "Por favor, forneça um cartão de crédito válido.", + equalTo: "Por favor, forneça o mesmo valor novamente.", + accept: "Por favor, forneça um valor com uma extensão válida.", + maxlength: jQuery.validator.format("Por favor, forneça não mais que {0} caracteres."), + minlength: jQuery.validator.format("Por favor, forneça ao menos {0} caracteres."), + rangelength: jQuery.validator.format("Por favor, forneça um valor entre {0} e {1} caracteres de comprimento."), + range: jQuery.validator.format("Por favor, forneça um valor entre {0} e {1}."), + max: jQuery.validator.format("Por favor, forneça um valor menor ou igual a {0}."), + min: jQuery.validator.format("Por favor, forneça um valor maior ou igual a {0}.") +}); + +jQuery.validator.addMethod("datePTBR", function(value) { + return this.optional(element) || /^\d\d?\/\d\d?\/\d\d\d?\d?$/.test(value); +}, "Por favor, forneça uma data válida."); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/localization/messages_ro.js b/spec/test_app/public/javascripts/localization/messages_ro.js new file mode 100644 index 0000000..d45adba --- /dev/null +++ b/spec/test_app/public/javascripts/localization/messages_ro.js @@ -0,0 +1,24 @@ +/* + * Translated default messages for the jQuery validation plugin. + * Language: RO + * Author: Elzo Valugi - http://www.valugi.ro + */ +jQuery.extend(jQuery.validator.messages, { + required: "Acest câmp este obligatoriu.", + remote: "Te rugăm să completezi acest câmp.", + email: "Te rugăm să introduci o adresă de email validă", + url: "Te rugăm sa introduci o adresă URL validă.", + date: "Te rugăm să introduci o dată corectă.", + dateISO: "Te rugăm să introduci o dată (ISO) corectă.", + number: "Te rugăm să introduci un număr întreg valid.", + digits: "Te rugăm să introduci doar cifre.", + creditcard: "Te rugăm să introduci un numar de carte de credit valid.", + equalTo: "Te rugăm să reintroduci valoarea.", + accept: "Te rugăm să introduci o valoare cu o extensie validă.", + maxlength: jQuery.validator.format("Te rugăm să nu introduci mai mult de {0} caractere."), + minlength: jQuery.validator.format("Te rugăm să introduci cel puțin {0} caractere."), + rangelength: jQuery.validator.format("Te rugăm să introduci o valoare între {0} și {1} caractere."), + range: jQuery.validator.format("Te rugăm să introduci o valoare între {0} și {1}."), + max: jQuery.validator.format("Te rugăm să introduci o valoare egal sau mai mică decât {0}."), + min: jQuery.validator.format("Te rugăm să introduci o valoare egal sau mai mare decât {0}.") +}); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/localization/messages_ru.js b/spec/test_app/public/javascripts/localization/messages_ru.js new file mode 100644 index 0000000..6685cdc --- /dev/null +++ b/spec/test_app/public/javascripts/localization/messages_ru.js @@ -0,0 +1,23 @@ +/* + * Translated default messages for the jQuery validation plugin. + * Language: RU + */ +jQuery.extend(jQuery.validator.messages, { + required: "Это поле необходимо заполнить.", + remote: "Пожалуйста, введите правильное значение.", + email: "Пожалуйста, введите корретный адрес электронной почты.", + url: "Пожалуйста, введите корректный URL.", + date: "Пожалуйста, введите корректную дату.", + dateISO: "Пожалуйста, введите корректную дату в формате ISO.", + number: "Пожалуйста, введите число.", + digits: "Пожалуйста, вводите только цифры.", + creditcard: "Пожалуйста, введите правильный номер кредитной карты.", + equalTo: "Пожалуйста, введите такое же значение ещё раз.", + accept: "Пожалуйста, выберите файл с правильным расширением.", + maxlength: jQuery.validator.format("Пожалуйста, введите не больше {0} символов."), + minlength: jQuery.validator.format("Пожалуйста, введите не меньше {0} символов."), + rangelength: jQuery.validator.format("Пожалуйста, введите значение длиной от {0} до {1} символов."), + range: jQuery.validator.format("Пожалуйста, введите число от {0} до {1}."), + max: jQuery.validator.format("Пожалуйста, введите число, меньшее или равное {0}."), + min: jQuery.validator.format("Пожалуйста, введите число, большее или равное {0}.") +}); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/localization/messages_se.js b/spec/test_app/public/javascripts/localization/messages_se.js new file mode 100644 index 0000000..94ee02d --- /dev/null +++ b/spec/test_app/public/javascripts/localization/messages_se.js @@ -0,0 +1,23 @@ +/* + * Translated default messages for the jQuery validation plugin. + * Language: SE + */ +jQuery.extend(jQuery.validator.messages, { + required: "Detta fält är obligatoriskt.", + maxlength: jQuery.validator.format("Du får ange högst {0} tecken."), + minlength: jQuery.validator.format("Du måste ange minst {0} tecken."), + rangelength: jQuery.validator.format("Ange minst {0} och max {1} tecken."), + email: "Ange en korrekt e-postadress.", + url: "Ange en korrekt URL.", + date: "Ange ett korrekt datum.", + dateISO: "Ange ett korrekt datum (&ARING;&ARING;&ARING;&ARING;-MM-DD).", + dateSE: "Ange ett korrekt datum.", + number: "Ange ett korrekt nummer.", + numberSE: "Ange ett korrekt nummer.", + digits: "Ange endast siffror.", + equalTo: "Ange samma värde igen.", + range: jQuery.validator.format("Ange ett värde mellan {0} och {1}."), + max: jQuery.validator.format("Ange ett värde som är större eller lika med {0}."), + min: jQuery.validator.format("Ange ett värde som är mindre eller lika med {0}."), + creditcard: "Ange ett korrekt kreditkortsnummer." +}); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/localization/messages_sk.js b/spec/test_app/public/javascripts/localization/messages_sk.js new file mode 100644 index 0000000..151e513 --- /dev/null +++ b/spec/test_app/public/javascripts/localization/messages_sk.js @@ -0,0 +1,21 @@ +/* + * Translated default messages for the jQuery validation plugin. + * Language: SK + * Skipped dateISO/DE, numberDE + */ +jQuery.extend(jQuery.validator.messages, { + required: "Povinné zadať.", + maxlength: jQuery.validator.format("Maximálne {0} znakov."), + minlength: jQuery.validator.format("Minimálne {0} znakov."), + rangelength: jQuery.validator.format("Minimálne {0} a Maximálne {0} znakov."), + email: "E-mailová adresa musí byť platná.", + url: "URL musí byť platný.", + date: "Musí byť dátum.", + number: "Musí byť číslo.", + digits: "Môže obsahovať iba číslice.", + equalTo: "Dva hodnoty sa musia rovnať.", + range: jQuery.validator.format("Musí byť medzi {0} a {1}."), + max: jQuery.validator.format("Nemôže byť viac ako{0}."), + min: jQuery.validator.format("Nemôže byť menej ako{0}."), + creditcard: "Číslo platobnej karty musí byť platné." +}); diff --git a/spec/test_app/public/javascripts/localization/messages_tr.js b/spec/test_app/public/javascripts/localization/messages_tr.js new file mode 100644 index 0000000..aca5cdf --- /dev/null +++ b/spec/test_app/public/javascripts/localization/messages_tr.js @@ -0,0 +1,24 @@ +/* + * Translated default messages for the jQuery validation plugin. + * Language: TR + * Author: kara + */ +jQuery.extend(jQuery.validator.messages, { + required: "Bu alanın doldurulması zorunludur.", + remote: "Lütfen bu alanı düzeltin.", + email: "Lütfen geçerli bir e-posta adresi giriniz.", + url: "Lütfen geçerli bir web adresi (URL) giriniz.", + date: "Lütfen geçerli bir tarih giriniz.", + dateISO: "Lütfen geçerli bir tarih giriniz(ISO formatında)", + number: "Lütfen geçerli bir sayı giriniz.", + digits: "Lütfen sadece sayısal karakterler giriniz.", + creditcard: "Lütfen geçerli bir kredi kartı giriniz.", + equalTo: "Lütfen aynı değeri tekrar giriniz.", + accept: "Lütfen geçerli uzantıya sahip bir değer giriniz.", + maxlength: jQuery.validator.format("Lütfen en fazla {0} karakter uzunluğunda bir değer giriniz."), + minlength: jQuery.validator.format("Lütfen en az {0} karakter uzunluğunda bir değer giriniz."), + rangelength: jQuery.validator.format("Lütfen en az {0} ve en fazla {1} uzunluğunda bir değer giriniz."), + range: jQuery.validator.format("Lütfen {0} ile {1} arasında bir değer giriniz."), + max: jQuery.validator.format("Lütfen {0} değerine eşit ya da daha küçük bir değer giriniz."), + min: jQuery.validator.format("Lütfen {0} değerine eşit ya da daha büyük bir değer giriniz.") +}); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/localization/messages_tw.js b/spec/test_app/public/javascripts/localization/messages_tw.js new file mode 100644 index 0000000..027de64 --- /dev/null +++ b/spec/test_app/public/javascripts/localization/messages_tw.js @@ -0,0 +1,24 @@ +/* + * Translated default messages for the jQuery validation plugin. + * Language: TW (Taiwan - Traditional Chinese) + * Author: Mr.BB + */ +jQuery.extend(jQuery.validator.messages, { + required: "必填", + remote: "請修正此欄位", + email: "請輸入正確的電子信箱", + url: "請輸入合法的URL", + date: "請輸入合法的日期", + dateISO: "請輸入合法的日期 (ISO).", + number: "請輸入數字", + digits: "請輸入整數", + creditcard: "請輸入合法的信用卡號碼", + equalTo: "請重複輸入一次", + accept: "請輸入有效的後缀字串", + maxlength: jQuery.validator.format("請輸入長度不大於{0} 的字串"), + minlength: jQuery.validator.format("請輸入長度不小於 {0} 的字串"), + rangelength: jQuery.validator.format("請輸入長度介於 {0} 和 {1} 之間的字串"), + range: jQuery.validator.format("請輸入介於 {0} 和 {1} 之間的數值"), + max: jQuery.validator.format("請輸入不大於 {0} 的數值"), + min: jQuery.validator.format("請輸入不小於 {0} 的數值") +}); \ No newline at end of file diff --git a/spec/test_app/public/javascripts/localization/messages_ua.js b/spec/test_app/public/javascripts/localization/messages_ua.js new file mode 100644 index 0000000..fa084a1 --- /dev/null +++ b/spec/test_app/public/javascripts/localization/messages_ua.js @@ -0,0 +1,24 @@ +/* + * Translated default messages for the jQuery validation plugin. + * Language: UA (Ukrainian) + * Author: maserg + */ +jQuery.extend(jQuery.validator.messages, { + required: "Це поле необхідно заповнити.", + remote: "Будь ласка, введіть правильне значення.", + email: "Будь ласка, введіть коректну адресу електронної пошти.", + url: "Будь ласка, введіть коректний URL.", + date: "Будь ласка, введіть коректну дату.", + dateISO: "Будь ласка, введіть коректну дату у форматі ISO.", + number: "Будь ласка, введіть число.", + digits: "Вводите потрібно лише цифри.", + creditcard: "Будь ласка, введіть правильний номер кредитної карти.", + equalTo: "Будь ласка, введіть таке ж значення ще раз.", + accept: "Будь ласка, виберіть файл з правильним розширенням.", + maxlength: jQuery.validator.format("Будь ласка, введіть не більше {0} символів."), + minlength: jQuery.validator.format("Будь ласка, введіть не менше {0} символів."), + rangelength: jQuery.validator.format("Будь ласка, введіть значення довжиною від {0} до {1} символів."), + range: jQuery.validator.format("Будь ласка, введіть число від {0} до {1}."), + max: jQuery.validator.format("Будь ласка, введіть число, менше або рівно {0}."), + min: jQuery.validator.format("Будь ласка, введіть число, більше або рівно {0}.") +}); diff --git a/spec/test_app/public/javascripts/nested-attribute.js b/spec/test_app/public/javascripts/nested-attribute.js new file mode 100644 index 0000000..36ceca0 --- /dev/null +++ b/spec/test_app/public/javascripts/nested-attribute.js @@ -0,0 +1,26 @@ +//On page load +// TODO - remove nonconflict stuff once prototype is gone for good +var $j = jQuery.noConflict(); + +replace_ids = function(s){ + var new_id = new Date().getTime(); + return s.replace(/NEW_RECORD/g, new_id); +} + +$j(function() { + $j('a[id*=nested]').click(function() { + var template = $j(this).attr('href').replace(/.*#/, ''); + html = replace_ids(eval(template)); + $j('#ul-' + $j(this).attr('id')).append(html); + update_remove_links(); + }); + update_remove_links(); +}) + +var update_remove_links = function() { + $j('.remove').click(function() { + $j(this).prevAll(':first').val(1); + $j(this).parent().hide(); + return false; + }); +}; diff --git a/spec/test_app/public/javascripts/open_id.js b/spec/test_app/public/javascripts/open_id.js new file mode 100644 index 0000000..0fd5641 --- /dev/null +++ b/spec/test_app/public/javascripts/open_id.js @@ -0,0 +1,15 @@ +$('#enable_login_via_openid a').click(function(){ + $('#enable_login_via_openid').hide(); + $('#enable_login_via_login_password').show(); + $('div#openid-credentials').show(); + $('div#openid-credentials input').removeAttr("disabled"); + $('div#password-credentials').hide(); +}) + +$('#enable_login_via_login_password a').click(function(){ + $('#enable_login_via_openid').show(); + $('#enable_login_via_login_password').hide(); + $('div#openid-credentials').hide(); + $('div#openid-credentials input').attr("disabled", true); + $('div#password-credentials').show(); +}) diff --git a/spec/test_app/public/javascripts/product.js b/spec/test_app/public/javascripts/product.js new file mode 100644 index 0000000..e09a4ac --- /dev/null +++ b/spec/test_app/public/javascripts/product.js @@ -0,0 +1,49 @@ +var add_image_handlers = function() { + $("#main-image").data('selectedThumb', $('#main-image img').attr('src')); + $('ul.thumbnails li').eq(0).addClass('selected'); + $('ul.thumbnails li a').click(function() { + $("#main-image").data('selectedThumb', $(this).attr('href')); + $('ul.thumbnails li').removeClass('selected'); + $(this).parent('li').addClass('selected'); + return false; + }).hover( + function() { + $('#main-image img').attr('src', $(this).attr('href').replace('mini', 'product')); + }, + function() { + $('#main-image img').attr('src', $("#main-image").data('selectedThumb')); + } + ); +}; + +jQuery(document).ready(function() { + add_image_handlers(); +}); + +jQuery(document).ready(function() { + jQuery('#product-variants input[type=radio]').click(function (event) { + var vid = this.value; + var text = $(this).siblings(".variant-description").html(); + + jQuery("#variant-thumbnails").empty(); + jQuery("#variant-images span").html(text); + + if (images[vid].length > 0) { + $.each(images[vid], function(i, link) { + jQuery("#variant-thumbnails").append('
                    • ' + link + '
                    • '); + }); + + jQuery("#variant-images").show(); + } else { + jQuery("#variant-images").hide(); + } + + add_image_handlers(); + + var link = jQuery("#variant-thumbnails a")[0]; + + jQuery("#main-image img").attr({src: jQuery(link).attr('href')}); + jQuery('ul.thumbnails li').removeClass('selected'); + jQuery(link).parent('li').addClass('selected'); + }); +}); diff --git a/spec/test_app/public/javascripts/rails.js b/spec/test_app/public/javascripts/rails.js new file mode 100644 index 0000000..89f219a --- /dev/null +++ b/spec/test_app/public/javascripts/rails.js @@ -0,0 +1,127 @@ +jQuery(function ($) { + var csrf_token = $('meta[name=csrf-token]').attr('content'), + csrf_param = $('meta[name=csrf-param]').attr('content'); + + $.fn.extend({ + /** + * Triggers a custom event on an element and returns the event result + * this is used to get around not being able to ensure callbacks are placed + * at the end of the chain. + * + * TODO: deprecate with jQuery 1.4.2 release, in favor of subscribing to our + * own events and placing ourselves at the end of the chain. + */ + triggerAndReturn: function (name, data) { + var event = new $.Event(name); + this.trigger(event, data); + + return event.result !== false; + }, + + /** + * Handles execution of remote calls firing overridable events along the way + */ + callRemote: function () { + var el = this, + method = el.attr('method') || el.attr('data-method') || 'GET', + url = el.attr('action') || el.attr('href'), + dataType = el.attr('data-type') || 'script'; + + if (url === undefined) { + throw "No URL specified for remote call (action or href must be present)."; + } else { + if (el.triggerAndReturn('ajax:before')) { + var data = el.is('form') ? el.serializeArray() : []; + $.ajax({ + url: url, + data: data, + dataType: dataType, + type: method.toUpperCase(), + beforeSend: function (xhr) { + el.trigger('ajax:loading', xhr); + }, + success: function (data, status, xhr) { + el.trigger('ajax:success', [data, status, xhr]); + }, + complete: function (xhr) { + el.trigger('ajax:complete', xhr); + }, + error: function (xhr, status, error) { + el.trigger('ajax:failure', [xhr, status, error]); + } + }); + } + + el.trigger('ajax:after'); + } + } + }); + + /** + * confirmation handler + */ + $('a[data-confirm],input[data-confirm]').live('click', function () { + var el = $(this); + if (el.triggerAndReturn('confirm')) { + if (!confirm(el.attr('data-confirm'))) { + return false; + } + } + }); + + + /** + * remote handlers + */ + $('form[data-remote]').live('submit', function (e) { + $(this).callRemote(); + e.preventDefault(); + }); + + $('a[data-remote],input[data-remote]').live('click', function (e) { + $(this).callRemote(); + e.preventDefault(); + }); + + $('a[data-method]:not([data-remote])').live('click', function (e){ + var link = $(this), + href = link.attr('href'), + method = link.attr('data-method'), + form = $('
                      '), + metadata_input = ''; + + if (csrf_param != null && csrf_token != null) { + metadata_input += ''; + } + + form.hide() + .append(metadata_input) + .appendTo('body'); + + e.preventDefault(); + form.submit(); + }); + + /** + * disable-with handlers + */ + var disable_with_input_selector = 'input[data-disable-with]'; + var disable_with_form_selector = 'form[data-remote]:has(' + disable_with_input_selector + ')'; + + $(disable_with_form_selector).live('ajax:before', function () { + $(this).find(disable_with_input_selector).each(function () { + var input = $(this); + input.data('enable-with', input.val()) + .attr('value', input.attr('data-disable-with')) + .attr('disabled', 'disabled'); + }); + }); + + $(disable_with_form_selector).live('ajax:complete', function () { + $(this).find(disable_with_input_selector).each(function () { + var input = $(this); + input.removeAttr('disabled') + .val(input.data('enable-with')); + }); + }); +}); diff --git a/spec/test_app/public/javascripts/taxonomy.js b/spec/test_app/public/javascripts/taxonomy.js new file mode 100644 index 0000000..bb9c1b4 --- /dev/null +++ b/spec/test_app/public/javascripts/taxonomy.js @@ -0,0 +1,196 @@ +var base_url = "/admin/taxonomies/" + taxonomy_id + "/taxons/"; +var child_url = "/admin/taxonomies/" + taxonomy_id + "/get_children.json" +var creating = false; +var delete_confirmed = false; +var last_rollback = null; + +var handle_ajax_error = function(XMLHttpRequest, textStatus, errorThrown){ + jQuery.tree.rollback(last_rollback); + + jQuery("#ajax_error").show().html("" + server_error + "
                      " + taxonomy_tree_error); +}; + +var handle_move = function(li, target, droppped, tree, rb) { + last_rollback = rb; + var position = jQuery(li).prevAll().length; + + var parent = -1; + + if(droppped=='inside'){ + parent = target; + }else if(droppped=='after'){ + parent = jQuery(target).parents()[1]; + }else if(droppped=='before'){ + parent = jQuery(target).parents()[1]; + } + + jQuery.ajax({ + type: "POST", + url: base_url + li.id + ".json", + data: ({_method: "put", "taxon[parent_id]": parent.id, "taxon[position]": position, authenticity_token: AUTH_TOKEN}), + error: handle_ajax_error + }); + + return true +}; + +var handle_dblclick = function(li, tree) { + tree.rename(); +}; + +var handle_create = function(parent, sib, created, tree, rb){ + last_rollback = rb; + creating=true; +}; + +var handle_created = function(id,result) { + jQuery.tree.reference('taxonomy_tree').selected.attr('id', id); +} + +var handle_rename = function(li, tree, rb) { + var name = jQuery(li).children(":first").text(); + name = jQuery.trim(name); + + if (creating){ + //actually creating new + var position = jQuery(li).prevAll().length; + var parent = jQuery(li).parents()[1]; + + jQuery.ajax({ + type: "POST", + url: base_url, + data: ({"taxon[name]": name, "taxon[parent_id]": parent.id, "taxon[position]": position, authenticity_token: AUTH_TOKEN}), + error: handle_ajax_error, + success: handle_created + }); + + creating = false; + }else{ + //just renaming + last_rollback = rb; + + jQuery.ajax({ + type: "POST", + url: base_url + li.id + ".json", + data: ({_method: "put", "taxon[name]": name, authenticity_token: AUTH_TOKEN}), + error: handle_ajax_error + }); + } +}; + +var handle_before_delete = function(li){ + if (!delete_confirmed){ + jConfirm('Are you sure you want to delete this taxon?', 'Confirm Taxon Deletion', function(r) { + if(r){ + delete_confirmed = true; + jQuery.tree.reference('taxonomy_tree').remove(li); + } + }); + } + + return delete_confirmed; +}; + +var handle_delete = function(li, tree, rb){ + last_rollback = rb; + + jQuery.ajax({ + type: "POST", + url: base_url + li.id, + data: ({_method: "delete", authenticity_token: AUTH_TOKEN}), + error: handle_ajax_error + }); + + delete_confirmed = false; +}; + +jQuery(document).ready(function(){ + conf = { + data : { + type : "json", + async : true, + opts : { + method : "GET", + url : child_url + } + }, + ui : { + theme_name : "apple" + }, + lang : { + new_node : new_taxon, + loading : loading + "..." + }, + plugins : { + contextmenu : { + items : { + // get rid of the remove item + remove :{ + visible : function (NODE, TREE_OBJ) { if(jQuery(NODE[0]).attr('rel')=="root") return false; return TREE_OBJ.check("renameable", NODE); }, + }, + rename :{ + visible : function (NODE, TREE_OBJ) { if(jQuery(NODE[0]).attr('rel')=="root") return false; return TREE_OBJ.check("renameable", NODE); }, + }, + cut :{ + id : "cut", + label : "Cut", + visible : function (NODE, TREE_OBJ) { if(NODE.length != 1 || NODE[0].id == 'root') return false; return true; }, + action : function (NODE, TREE_OBJ) { TREE_OBJ.cut(NODE); jQuery(NODE).hide(); }, + separator_before : true + }, + paste :{ + id : "paste", + label : "Paste", + visible : function (NODE, TREE_OBJ) { if(NODE.length != 1 || NODE[0].id == 'root') return false; return true; }, + action : function (NODE, TREE_OBJ) { TREE_OBJ.open_branch(NODE); TREE_OBJ.paste(NODE, "inside"); jQuery(NODE).find("li").show(); } + }, + edit :{ + id : "edit", + label : "Edit", + visible : function (NODE, TREE_OBJ) { if(NODE.length != 1 || NODE[0].id == 'root') return false; return TREE_OBJ.check("renameable", NODE); }, + action : function (NODE, TREE_OBJ) { jQuery.each(NODE, function () { window.location = base_url + this.id + "/edit/"; }); } + } + + } + } + }, + rules : { + // only nodes of type root can be top level nodes + valid_children : [ "root" ] + }, + types : { + // all node types inherit the "default" node type + "taxon" : {}, + "root" : { + deletable : false, + renameable : false, + draggable : false, + valid_children : [ "taxon" ] + } + }, + callback : { + onmove: handle_move, + ondblclk: handle_dblclick, + onrename: handle_rename, + oncreate: handle_create, + beforedelete: handle_before_delete, + ondelete: handle_delete, + beforedata: function (n, t) { + if(n == false) t.settings.data.opts.static = initial; + else t.settings.data.opts.static = false; + + return { parent_id : $(n).attr("id") || 0 }; + } + + } + } + + jQuery("#taxonomy_tree").tree(conf); + + jQuery(document).keypress(function(e){ + //surpress form submit on enter/return + if (e.keyCode == 13){ + e.preventDefault(); + } + }); +}); diff --git a/spec/test_app/public/javascripts/zone.js b/spec/test_app/public/javascripts/zone.js new file mode 100644 index 0000000..cd34f7b --- /dev/null +++ b/spec/test_app/public/javascripts/zone.js @@ -0,0 +1,40 @@ +$j(function() { + if ($j('#country_based').attr('checked')) { + show_country(); + } else if ($j('#state_based').attr('checked')) { + show_state(); + } else { + show_zone(); + } + $j('#country_based').click(function() { show_country();} ); + $j('#state_based').click(function() { show_state();} ); + $j('#zone_based').click(function() { show_zone();} ); +}) + +var show_country = function() { + $j('#state_members :input').each(function() { $(this).disable(); }) + $j('#state_members').hide(); + $j('#zone_members :input').each(function() { $(this).disable(); }) + $j('#zone_members').hide(); + $j('#country_members :input').each(function() { $(this).enable(); }) + $j('#country_members').show(); +}; + +var show_state = function() { + $j('#country_members :input').each(function() { $(this).disable(); }) + $j('#country_members').hide(); + $j('#zone_members :input').each(function() { $(this).disable(); }) + $j('#zone_members').hide(); + $j('#state_members :input').each(function() { $(this).enable(); }) + $j('#state_members').show(); +}; + +var show_zone = function() { + $j('#state_members :input').each(function() { $(this).disable(); }) + $j('#state_members').hide(); + $j('#country_members :input').each(function() { $(this).disable(); }) + $j('#country_members').hide(); + $j('#zone_members :input').each(function() { $(this).enable(); }) + $j('#zone_members').show(); +}; + diff --git a/spec/test_app/public/robots.txt b/spec/test_app/public/robots.txt new file mode 100644 index 0000000..085187f --- /dev/null +++ b/spec/test_app/public/robots.txt @@ -0,0 +1,5 @@ +# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file +# +# To ban all spiders from the entire site uncomment the next two lines: +# User-Agent: * +# Disallow: / diff --git a/spec/test_app/public/stylesheets/admin/admin-forms.css b/spec/test_app/public/stylesheets/admin/admin-forms.css new file mode 100755 index 0000000..15019ff --- /dev/null +++ b/spec/test_app/public/stylesheets/admin/admin-forms.css @@ -0,0 +1,159 @@ +/* -------------------------------------------------------------- + + forms.css + * Sets up some default styling for forms + * Gives you classes to enhance your forms + + Usage: + * For text fields, use class .title or .text + +-------------------------------------------------------------- */ + +label { font-weight: bold; } +fieldset { padding:1.4em; margin: 0 0 1.5em 0; border: 1px solid #ccc; } +legend { font-weight: bold; font-size:1.2em; margin:0; } + + +/* Form fields +-------------------------------------------------------------- */ + +input.text, input.title, +input, textarea, select { + margin:0.25em 0; + border:1px solid #bbb; +} + +input.text:focus, input.title:focus, +textarea:focus, select:focus { + border:1px solid #666; +} + +input.text, +input.title { padding:5px; } +input.title { font-size:1.5em; } +textarea { height: 250px; padding:5px; } + +.required { color:#f00; font-weight:bold; font-size:1.2em;} +.fullwidth { width:98% } + +/* container that holds a field that's got a master label then labels under each sub field e.g. Name might have firstname, lastname */ +.sub-field { margin:0; padding:0; margin:0 0 0.25em 0 } +.sub-field label, label.sub { font-weight:normal; color:#333; } +.sub-field input { margin-bottom:0 } + + +.date-range-filter {width:220px;} + .date-range-filter input {width:75px;} + .date-range-filter .yui-u { width:50% } + + +/* Multi-column form layout +-------------------------------------------------------------- */ +div.split { + background-color:#eee; +} +form div.left +{ + display:inline; + float:left; + width:48%; +} + +form div.right +{ + display:inline; + float:right; + width:48%; +} +form p { + clear:both; +} +form div.left.w70 { + width:68%; +} +form div.right.w30 { + width:28%; +} + + +/* Flashes and error messages +-------------------------------------------------------------- */ + +.flash { + font-size:130%;font-weight:bold; + padding: .4em 0 .4em 38px; margin-bottom: 1em; + border:1px solid #c00; + border-left:none;border-right:none; +} +.flash.error { + background: #FDE4E4 url(../../images/admin/icons/exclamation.png) 10px center no-repeat; + color:#c00; border-color:#c00; +} +.flash.notice { + background: #E7F8D7 url(../../images/admin/icons/tick.png) 10px center no-repeat; + color:#59A151; border-color: #59A151; +} + +.withError { + background-color:#FDE4E4; + background-image:url(../../images/admin/bg/red-stripes.png); +} +.formError { + color:#c00; font-weight:bold; + display:block; +} + + +.member-list { + list-style:none;margin:0; +} + + +.form-buttons { + margin-top: 1em; + clear: both; + } + .form-buttons a { + text-transform: lowercase; } + +.field { + margin-bottom: 1em; + clear: both; + position: relative; } + .field .formError { + color: #fff; + background: #f15700 url(../../images/admin/icons/fugue/exclamation_small.png) center left no-repeat; + padding: 3px 7px; + display: inline-block; + margin-bottom: 1em; + padding-left: 20px; } + .field.fluid { + clear: none; + float: left; + margin-right: 1em; } + .field label { + display: block; } + .field label span.label { + display: block; } + + + + + + +fieldset { + margin-bottom: 1em; + padding: 1em; + border: solid 1px #ccc; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; + } + fieldset h1 { + font-size: 1.75em; } + fieldset table.index th:first-child { + -moz-border-radius-topleft: 5px; + -webkit-border-top-left-radius: 5px; } + fieldset table.index th:last-child { + -moz-border-radius-topright: 5px; + -webkit-border-top-right-radius: 5px; } + diff --git a/spec/test_app/public/stylesheets/admin/admin-reset.css b/spec/test_app/public/stylesheets/admin/admin-reset.css new file mode 100644 index 0000000..70b7d48 --- /dev/null +++ b/spec/test_app/public/stylesheets/admin/admin-reset.css @@ -0,0 +1,67 @@ +html, body { + margin: 0; + padding: 0; + border: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; } + +div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, +pre, a, abbr, acronym, address, code, del, dfn, em, img, +dl, dt, dd, ol, ul, li, fieldset, form, label, legend, caption, tbody, tfoot, thead, tr, hr { + margin: 0; + padding: 0; + border: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; } + +body { line-height: 1.5 } + +blockquote, q { + margin: 0; + padding: 0; + border: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; + quotes: "" ""; } + blockquote:before, + blockquote:after, q:before, + q:after { + content: ""; } + +th, td, caption { + margin: 0; + padding: 0; + border: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; + text-align: left; + font-weight: normal; + vertical-align: top; } + +table { + margin: 0; + padding: 0; + border: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; + border-collapse: separate; + border-spacing: 0; + vertical-align: middle; } + +a img { border: none } + diff --git a/spec/test_app/public/stylesheets/admin/admin-tables.css b/spec/test_app/public/stylesheets/admin/admin-tables.css new file mode 100644 index 0000000..8a5829d --- /dev/null +++ b/spec/test_app/public/stylesheets/admin/admin-tables.css @@ -0,0 +1,39 @@ +table.index th { + background: #cdcdcd url(../../images/admin/bg/grid_header_back.png) top left repeat-x; + padding: 7px 10px; + border-left: 1px solid #ddd; + border-top: 1px solid #ddd; + border-right: 1px solid #aaa; + border-bottom: 1px solid #aaa; + text-shadow: #efefef 1px 1px 0px; } + table.index th .right { + float:right; + font-weight:normal; + } + table.index th.id-col { + text-align: center; } + table.index td { + border-bottom:1px solid #ddd; + padding: 3px 10px; + } + table.index td.lbl-col { + width: 12%; } + table.index td.val-col { + width: 38%; } +table.index tr.alt td { + background-color: #efefef; } +table.index.green th { + background: #cfefa7 url(/images/grid_header_back_green.png) top left repeat-x; + border-left: 1px solid #E4FDB4; + border-top: 1px solid #E4FDB4; + border-right: 1px solid #B7CB90; + border-bottom: 1px solid #B7CB90; } +table.index.green td { + background-color: #efe; } +table.index.order-summary { + clear: both; } + table.index.order-summary tr.totals th { + background: transparent; + text-align: right; + border: none; } +table.index td.actions {text-align:right;} diff --git a/spec/test_app/public/stylesheets/admin/admin-typography.css b/spec/test_app/public/stylesheets/admin/admin-typography.css new file mode 100755 index 0000000..345fe84 --- /dev/null +++ b/spec/test_app/public/stylesheets/admin/admin-typography.css @@ -0,0 +1,117 @@ +/* -------------------------------------------------------------- + + typography.css + * Sets up some sensible default typography. + +-------------------------------------------------------------- */ + +/* Default font settings. + The font-size percentage is of 16px. (0.75 * 16px = 12px) */ +body { + font-size: 75%; + color: #222; + font-family: "Helvetica Neue", Helvetica, Tahoma, Verdana, Arial, sans-serif; +} + +/* Headings +-------------------------------------------------------------- */ + +h1,h2,h3,h4,h5,h6 { font-weight: bold; color: #111; } + +h1 { font-size: 2.5em; margin-bottom: 0.75em; line-height: 1em; } +h2 { font-size: 1.5em; line-height: 1; margin-bottom: 0.6em; } +h3 { font-size: 1.5em; line-height: 1.25; margin-bottom: 0.6em; } +h4 { font-size: 1em; font-weight: bold; margin-bottom: 1.5em; } +h5 { font-size: 1em; font-weight: bold; } +h6 { font-weight: normal } + +h1 img, h2 img, h3 img, +h4 img, h5 img, h6 img { margin: 0 } + + +h1, h2 { letter-spacing: -1px } + + +/* Text elements +-------------------------------------------------------------- */ + +p { margin: 0 0 1em; } +p img.left { float: left; margin: 1.5em 1.5em 1.5em 0; padding: 0; } +p img.right { float: right; margin: 1.5em 0 1.5em 1.5em; } + +a:focus, +a:hover { color: #000; } +a { color: #009; text-decoration: none; } + +blockquote { margin: 1.5em; color: #666; font-style: italic; } +strong { font-weight: bold; } +em,dfn { font-style: italic; } +dfn { font-weight: bold; } +sup, sub { line-height: 0; } + +abbr, +acronym { border-bottom: 1px dotted #666; } +address { margin: 0 0 1.5em; font-style: italic; } +del { color:#666; } + +pre { margin: 1.5em 0; white-space: pre; } +pre,code,tt { font: 1em 'andale mono', 'lucida console', monospace; line-height: 1.5; } + + +/* Lists +-------------------------------------------------------------- */ + +li ul, +li ol { margin:0 1.5em; } +ul, ol { margin: 0 1.5em 1.5em 1.5em; } + +ul { list-style-type: disc; } +ol { list-style-type: decimal; } + +dl { margin: 0 0 1.5em 0; } +dl dt { font-weight: bold; } +dd { margin-left: 1.5em;} + + +/* Tables +-------------------------------------------------------------- */ + +table { margin-bottom: 1.4em; width:100%; } +th { font-weight: bold; } +thead th { background: #c3d9ff; } +th,td,caption { padding: 4px 10px 4px 5px; } +tr.even td { background: #e5ecf9; } +tfoot { font-style: italic; } +caption { background: #eee; } + + +/* Misc +-------------------------------------------------------------- */ + +hr { clear: both; height:0; border:none} + +.small { font-size: .8em; margin-bottom: 1.875em; line-height: 1.875em; } +.large { font-size: 1.2em; line-height: 2.5em; margin-bottom: 1.25em; } +.hide { display: none; } + +.quiet { color: #666; } +.loud { color: #000; } +.highlight { background:#ff0; } +.added { background:#060; color: #fff; } +.removed { background:#900; color: #fff; } + +.first { margin-left:0; padding-left:0; } +.last { margin-right:0; padding-right:0; } +.top { margin-top:0; padding-top:0; } +.bottom { margin-bottom:0; padding-bottom:0; } + + +.clear { clear: both } +.nowrap { white-space: nowrap } + +.clearfix { + overflow: auto; + overflow: -moz-scrollbars-none; + display: inline-block; } + .clearfix { + display: block; } diff --git a/spec/test_app/public/stylesheets/admin/admin.css b/spec/test_app/public/stylesheets/admin/admin.css new file mode 100644 index 0000000..216d1e5 --- /dev/null +++ b/spec/test_app/public/stylesheets/admin/admin.css @@ -0,0 +1,579 @@ +#language-bar, +#login-nav, +#store-nav { + float: right; + margin-top: 10px;} + #language-bar li, + #login-nav li, + #store-nav li { + float: left; + margin-right: 1em; + list-style: none; } + +.address-form label, +#creditcard label { + width: 200px; + display: block; + float: left; } + +#creditcard label { + width: 150px; } + +input.default { + color: #999; } + input.default:focus { + color: inherit; } + +p.help-text { + font-style: italic; + font-weight: normal; + margin-bottom: 0; + color: #999; } + + + + +body { + margin-top: 0px; + background-color: #162F54; + color: #476D9B; + } + + a { + color: #4884BD; } + a:active, + a:visited { + color: #4884BD; } + + #header { + height:95px; + position: relative; + margin-bottom: 13px; + } + #header, + #footer { + position: relative; + clear: both; } + #content { + margin: 0em 1em 1em 1em; + padding: 1em; + background: #fff; + color: #111; + min-height: 500px; } + #content a { + color: #3C7DFB; } + #content a:active, + #content a:visited { + color: #3C7DFB; } + #content.with-sidebar { + background: #fff url(../../images/admin/bg/content-back.png) right top repeat-y; + padding-right: 340px; + position: relative; } + #sidebar { + position: absolute; + width: 305px; + top: 0; right: 0; + padding-top: 3em; + } + #sidebar .box { + padding:10px; + } + #sidebar .box h3 { margin: 0 0 10px 0; } + #sidebar h3 { + margin: 0 10px; } + #sidebar h3 a { + color: #111; + text-decoration: none; } + #sidebar h5 { + margin: 0 10px; + width: 130px; + float: left;} + #sidebar span.sku { + display: block; + font-weight: normal; } + #sidebar img { + float: right; + margin-right: 1em; } + #sidebar img.calendar_date_select_popup_icon { + float: none; } + #sidebar .field { + padding: 0 1em; } + #sidebar .form-buttons { + padding: 0 1em; } + #sidebar h4 { + margin-left: 10px; } + #sidebar ul.sidebar { + clear: both; + position: relative; + margin: 0; + padding: 0; } + #sidebar ul.sidebar li { + list-style: none; } + #sidebar ul.sidebar li a { + display: block; + padding: 10px 20px 10px; + outline: none; + text-decoration: none; + color: #666 !important; } + #sidebar ul.sidebar li a:hover { background-color:#ddd } + #sidebar ul.sidebar li.active a { + font-weight: bold; + background: url(../../images/admin/bg/menu-current.png) left center no-repeat; + color: #363 !important; + margin-left: -20px; + padding-left: 30px; } + #sidebar .order-number, + #sidebar .order-status { + text-align: right; + margin-right: 20px; } + #sidebar .order-status { + padding: 7px 15px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + float: right; + background-color: #999; + color: #111; + text-transform: uppercase; } + #sidebar .order-status.new { + background-color: #5D9C0F; + color: #fff; } + #sidebar .order-status.canceled { + background-color: #c00; + color: #fff; } + + #header #logo { + position: absolute; + top: 0; + left: 10px; +} + #header h1 { + position: absolute; + left: 200px; + bottom: 19px; + margin: 10px 10px 10px 10px; + display: block; + text-decoration: none; + line-height: 100%; + + } + #header h1 a { + color: #8CB952; + } + #admin-menu { clear: both; } + #admin-menu, + #sub-menu { + margin: 0 1em; + } + #admin-menu li { + + } + #admin-menu ul, + #sub-menu ul { + padding: 0; + margin: 0; } + #admin-menu ul li, + #sub-menu ul li { + float: left; + margin-right: 1em; + list-style: none; } + #admin-menu ul li, + #sub-menu ul li { + margin-right: 0; margin-bottom: -1px;} + #admin-menu ul li a, + #sub-menu ul li a { + display: block; + padding: 10px 20px; + color: #fff; + text-decoration: none; + outline: none; } + #admin-menu ul li.selected a, + #sub-menu ul li.selected a { + background-color: #0095da; + } + #admin-menu ul li.selected { + border-bottom:1px solid #0095DA; + } + #IE7 #admin-menu { + height: 39px; } + #admin-menu { + background: #154e8c url(../../images/admin/bg/admin_tab_back.png) top left repeat-x; + border-top: 1px solid #4B83E2; + border-right: 1px solid #34599B; + border-bottom: 1px solid #41A6F0; + } + #admin-menu ul { + margin-bottom: -1px; } + #admin-menu ul li:first-child { + border-left: 1px solid #34599B; } + #admin-menu ul li.selected { + background: #0095da url(../../images/admin/bg/admin_tab_selected_back.png) top left repeat-x; + border-left: 1px solid #41A6F0; + border-top: 1px solid #41A6F0; + border-right: 1px solid #4986BF; + height: 40px; + margin-top: -2px; } + #sub-menu { + background: #0095da; + border-left: 1px solid #41A6F0; + border-right: 1px solid #4986BF; } + #IE7 #sub-menu ul { + height: 26px; } + #sub-menu ul li a { + padding: 3px 7px; + margin: 10px 5px; + color: #154e8c; + background: none; } + #sub-menu ul li.selected a { + background: #154e8c; + color: #9BC3FC; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; } + #slide-content { + margin: 0 1em; + background-color: #cdf; } + .toolbar { + float: right; + margin-bottom: 1em; } + .toolbar ul.actions { + margin: 0; + padding: 0; + float: right; } + .toolbar ul.actions li { + float: left; + margin-right: 1em; + list-style: none; } + .toolbar ul.actions li { + margin-right: 0; } + .toolbar.order-links a { + text-transform: capitalize; } + .search-form { + display: none; + padding: 1em; } + .search-form label { + display: block; } + a.button { + background: transparent url(../../images/admin/buttons/right_01.png) no-repeat scroll top right; + display: block; + float: left; + margin-right: 6px; + padding-right: 20px; + text-decoration: none; + color: #111 !important; + font-weight: bold; + outline: none; } + a.button span { + background: transparent url(../../images/admin/buttons/left_01.png) no-repeat; + display: block; + line-height: 22px; + padding: 7px 0 5px 14px; + text-shadow: #efefef 1px 1px 0px; } + a.button img { + vertical-align: middle; + margin: 0 3px 0 0; } + a.button.cancel span { + font-weight: normal; } + a.button.small { + font-size: 1em; + background: transparent url(../../images/admin/buttons/right_01_small.png) no-repeat scroll top right; + padding-right: 20px; } + a.button.small span { + background: transparent url(../../images/admin/buttons/left_01_small.png) no-repeat; + padding: 5px 0 3px 20px; + line-height: 21px; } + a.button.green { + background: transparent url(../../images/admin/buttons/green/right_01.png) no-repeat scroll top right; + color: #151 !important; } + a.button.green span { + background: transparent url(../../images/admin/buttons/green/left_01.png) no-repeat; } + button { + border: 0; + cursor: pointer; + font-weight: bold; + padding: 0 20px 0 0; + text-align: center; + background: url(../../images/admin/buttons/right_01.png) center right no-repeat; + font-size: 1.3em; + outline: none; } + button span { + position: relative; + display: block; + white-space: nowrap; + padding: 0 0 0 20px; + height: 35px; + line-height: 35px; + background: url(../../images/admin/buttons/left_01.png) center left no-repeat; + text-shadow: #efefef 1px 1px 0px; } + button span img { + vertical-align: middle; + margin: 0 3px 0 0; } + button:focus { + outline: none; } + button.tick { + background: none; + width: 24px; } + input.title, + textarea { + margin: 0; } + .errorExplanation { + border: solid 2px #f15700; + padding: 1em; + margin-bottom: 1em; + background: #cdf; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; } + .errorExplanation ul { + color: #f15700; + list-style: square; } + .errorExplanation h2 { + font-size: 1.75em; + padding-left: 40px; + background: url(../../images/admin/icons/orb/32x32/3.png) center left no-repeat; } + ul.checkbox-list { + list-style: none; } + ul.checkbox-list li { + display: block; + float: left; + width: 200px; } + ul.checkbox-list li label { + font-weight: normal !important; } + #busy_indicator { + margin-bottom: 1em; } + select#filter_state { + font-size: 1.5em; } + h2.order-number { + margin-bottom: 0; } + h4.order-status { + display: block; + font-weight: normal; } + .adr { + float: left; + margin-right: 1em; + margin-bottom: 1em; + padding: 1em; + border: solid 1px #999; + -moz-border-radius: .5em; + -webkit-border-radius: .5em; + min-width: 46%; } + .adr .fn { + font-weight: bold; } + .adr h4 { + margin-bottom: 1em; + border-bottom: 1px solid #ccc; + padding-bottom: .5em; + color: #666; } + ul.taxonomy-tree { + cursor: default; + list-style: none; + margin: 0; + padding: 0 0 0 35px; + min-height: 2em; } + ul.taxonomy-tree li.taxon { + clear: both; + padding: 5px; } + ul.taxonomy-tree li.taxon span, + ul.taxonomy-tree li.taxon input { + float: left; + margin-right: 1em; } + ul.taxonomy-tree li.taxon .name { + float: left; + cursor: move; } + ul.taxonomy-tree li.taxon.new ul.taxonomy-actions, + ul.taxonomy-tree li.taxon.editing ul.taxonomy-actions { + display: none; } + ul.taxonomy-tree li.taxon.to-destroy { + color: #900; + text-decoration: line-through; } + ul.taxonomy-tree li.taxon.to-destroy ul.taxonomy-actions { + display: none; } + .placeholder { + height: 30px; + clear: both; + border: dashed 2px #ddd; } + ul.taxonomy-actions { + float: left; + list-style: none; + margin: 0px 0px 10px 10px; + padding: 0; } + ul.taxonomy-actions li { + float: left; + margin-right: 5px; } + ul.taxonomy-actions li img { + vertical-align: text-top; } + ul.taxonomy-actions li.disabled { + opacity: .5; } + h3.warning { + background-image: url(../../images/admin/icons/fugue/exclamation.png); + background-position: 10px 15px; + background-repeat: no-repeat; + padding-left: 35px; } + #searching { + clear: both; + margin-top: 2em; } + + +.pagination{ + padding-top: 10px; + text-align: right; +} +a.page, span.page { + padding: 0px 5px; + margin: 0 3px; +} +a.page { + text-decoration: none; + border: 1px solid #9aafe5; + color: #2e6ab1; +} +a.page:hover, a.page:active { + border: 1px solid #2b66a5; + color: #000; + background-color: LightYellow; +} + +a.next_page { + font-weight: bold; +} + + +span.disabled_page { + border: 1px solid #929292; + color: #929292; +} + +span.current_page { + font-weight: bold; + border: 1px solid navy; + background-color: #2e6ab1; + color: #FFF; +} + +div#calculator-settings-warning { + color: #f00; +} +#progress{ + display:none; + background:#154E8C url(../../images/admin/bg/admin_tab_back.png) repeat-x scroll left top; + color:#fff; + font-size:170%; + height:25px; + left:33%; + padding:10px 0 15px; + position:fixed; + text-align:center; + width:320px; + font-weight:bold; + -moz-border-radius-bottomleft:15px; + -moz-border-radius-bottomright:15px; + -webkit-border-bottom-left-radius: 15px; + -webkit-border-bottom-right-radius: 15px; +} +#progress img{ + vertical-align:middle; + padding-right:10px; +} + +ul#shipping-specs { + margin: 0; + padding-bottom:10px; +} +ul#shipping-specs li { + list-style-image:none; + display:inline; +} + +.product-scopes ul > li { + float: left; + width: 220px; + margin-right: 20px; +} + +.product-scopes .invalid { + background-color: red; +} + +div.product-preview-products { + max-height: 200px; + overflow: auto; +} + +#preference-settings input, #preference-settings select, #preference-settings textarea{ + float:left; + +} + +#preference-settings input[type=text], #preference-settings input[type=password] { + width: 250px; +} + +#preference-settings input.input_integer[type=text] { + width: 100px; +} + +#preference-settings label{ + clear:both; + display:block; + float:left; + width:170px; +} +.index .price{ + width: 50px; + text-align:center; +} +.index .qty{ + width: 50px; + text-align:center; +} +.index .total{ + width: 50px; + text-align:right; +} +.index .orders-actions{ + width:40px; + padding-left:10px; +} + + + + + + + +/* Product Groups */ + +table#product_scopes tr { + background-color: #eee; + +} +table#product_scopes tr td { + border-top: 4px solid #fff; + border-bottom: 1px solid #bbb; + padding: 5px 10px; +} +table#product_scopes tr td.actions { + vertical-align: middle; + text-align: right; +} +table#product_scopes tr td table { + margin: 0; + width: auto; +} +table#product_scopes tr td table tr td { + padding: 0; + border: none; + padding-right: 5px; +} + +#product_group_forms_container { + position: relative; +} +#new_product_group_form { + position: absolute; + right: 25px; + bottom: 0; +} +#new_product_group_form p { + text-align: right; + margin: 0; +} + + diff --git a/spec/test_app/public/stylesheets/admin/autocomplete.css b/spec/test_app/public/stylesheets/admin/autocomplete.css new file mode 100644 index 0000000..7c5fe77 --- /dev/null +++ b/spec/test_app/public/stylesheets/admin/autocomplete.css @@ -0,0 +1,73 @@ +/* @override http://localhost:3000/stylesheets/admin/edit_orders.css */ + +.ac_results { + padding: 0px; + border: 1px solid #666; + background-color: white; + overflow: hidden; + z-index: 99999; +} + +.ac_results ul { + width: 100%; + list-style-position: outside; + list-style: none; + padding: 0; + margin: 0; +} + +.ac_results li { + margin: 0px; + padding: 5px 5px; + cursor: default; + display: block; + /* + if width will be 100% horizontal scrollbar will apear + when scroll mode will be used + */ + /*width: 100%;*/ + font: menu; + font-size: 12px; + /* + it is very important, if line-height not setted or setted + in relative units scroll will be broken in firefox + */ + line-height: 16px; + overflow: hidden; + border-bottom: 1px solid #666; + color: #000; + cursor: pointer; +} + +.ac_results li img{ + float:left; + padding-right: 5px; + width: 30px; +} +.ac_results li h4 { + margin-bottom: 3px; + width: 330px; + white-space: nowrap; + overflow: hidden; +} +.ac_results li div{ + float:left; +} +.ac_results li span{ + display: block; + float: left; +} +.ac_loading { + background: none; +} +.ac_odd { + background-color: #fff; +} +.ac_over { + background-color: #41A6F0; + color: #fff!important; +} +.ac_over h4 { + color: #fff; +} + diff --git a/spec/test_app/public/stylesheets/admin/dashboard.css b/spec/test_app/public/stylesheets/admin/dashboard.css new file mode 100644 index 0000000..ac79c51 --- /dev/null +++ b/spec/test_app/public/stylesheets/admin/dashboard.css @@ -0,0 +1,143 @@ +.dashboard h2{ + padding-bottom:5px; + color: #476D9B; + clear:both; +} + +.dashboard_left{ + width:25%; + float:left; +} + +.dashboard_main{ + width:55%; + float:left; +} + +.dashboard_main #orders_by_day_options{ + background-color:#0095DA; + -moz-border-radius-bottomleft:10px; + -moz-border-radius-bottomright:10px; + -moz-border-radius-topleft:10px; + -moz-border-radius-topright:10px; + -webkit-border-bottom-left-radius: 10px 10px; + -webkit-border-bottom-right-radius: 10px 10px; + -webkit-border-top-left-radius: 10px 10px; + -webkit-border-top-right-radius: 10px 10px; + color:#fff; + margin-top:10px; + padding:5px; + text-align:center; +} + +#order_by_day_title{ + padding-bottom:5px; + color: #476D9B; + clear:both; +} + +#order_totals{ + background:#154E8C url(../../images/admin/bg/admin_tab_back.png) repeat-x scroll left top; + -moz-border-radius-bottomleft:10px; + -moz-border-radius-bottomright:10px; + -moz-border-radius-topleft:10px; + -moz-border-radius-topright:10px; + -webkit-border-bottom-left-radius: 10px 10px; + -webkit-border-bottom-right-radius: 10px 10px; + -webkit-border-top-left-radius: 10px 10px; + -webkit-border-top-right-radius: 10px 10px; + color:#fff; + height:62px; + padding:0 10px; + margin-bottom:20px; +} + +#order_totals hr{ + background-color:#fff; + clear:none; + float:left; + height:80%; + margin-top:6px; + width:3px; +} + +#order_totals .spacer{ + padding: 0px 10px; + font-size: 50px; + line-height: 60px; + color: #476D9B; +} + +#order_totals p{ + float:left; + font-size:420%; + font-weight:bold; + line-height:60px; + margin:0 5px 0 0; +} + +#order_totals label{ + font-size:200%; + line-height:50px; +} + +#order_totals span{ + display:block; + font-size:90%; + font-weight:bold; + margin-top: -10px; +} + +.dashboard_main #orders_by_day_options label{ + padding: 0px 10px; +} + +.dashboard_right{ + width:20%; + float:left; +} + +.dashboard table th{ + background-color: #0095DA; + color: #fff; +} + +.dashboard_small_wrapper{ + padding: 0px 20px 0px 0px; +} + +.dashboard_main_wrapper{ + padding: 0px 30px 10px 30px; + margin-left: auto; + margin-right: auto; +} + +#pie_legend{ + width:50%; + float:left; + font-size: 80%; +} + +#pie_legend span{ + line-height:15px; + width:15px; + float:left; +} + +#pie_legend label{ + margin-left:5px; + float:left; +} + +#pie_legend div{ + clear:both; + text-align:right; +} + +.text-right{ + text-align:right; +} + +.jqplot-table-legend{ + width:60px; +} \ No newline at end of file diff --git a/spec/test_app/public/stylesheets/admin/edit_checkouts.css b/spec/test_app/public/stylesheets/admin/edit_checkouts.css new file mode 100644 index 0000000..e182102 --- /dev/null +++ b/spec/test_app/public/stylesheets/admin/edit_checkouts.css @@ -0,0 +1,57 @@ +.ac_results { + padding: 0px; + border: 1px solid black; + background-color: white; + overflow: hidden; + z-index: 99999; +} + +.ac_results ul { + width: 100%; + list-style-position: outside; + list-style: none; + padding: 0; + margin: 0; +} + +.ac_results li { + margin: 0px; + padding: 5px 5px; + cursor: default; + display: block; + /* + if width will be 100% horizontal scrollbar will apear + when scroll mode will be used + */ + /*width: 100%;*/ + font: menu; + font-size: 12px; + /* + it is very important, if line-height not setted or setted + in relative units scroll will be broken in firefox + */ + line-height: 16px; + overflow: hidden; + border-bottom: 1px solid black; + color: #000; + cursor: pointer; +} + +.ac_results li h4 { + margin-bottom: 3px; +} +.ac_results li span{ + display: block; +} +.ac_loading { + background: none; +} +.ac_odd { + background-color: #fff; +} +.ac_over { + background-color: #fff; +} +.ac_over h4{ + text-decoration: underline; +} \ No newline at end of file diff --git a/spec/test_app/public/stylesheets/admin/grids.css b/spec/test_app/public/stylesheets/admin/grids.css new file mode 100644 index 0000000..a1b19d2 --- /dev/null +++ b/spec/test_app/public/stylesheets/admin/grids.css @@ -0,0 +1,314 @@ +/* +Copyright (c) 2009, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.7.0 +*/ +/** + * YUI Grids + * @module grids + * @namespace yui- + * @requires reset, fonts + */ + +/** + * Note: Throughout this file, the *property (star-property) filter is used + * to give a value to IE that other browsers do not see. _property is only seen + * by IE7, so the combo of *prop and _prop can target between IE6 and IE7. + * + * More information on these filters and related validation errors: + * http://tech.groups.yahoo.com/group/ydn-javascript/message/40059 + */ + +/** + * Section: General Rules + */ + +/** + * Section: Page Width Rules (#doc, #doc2, #doc3, #doc4) + */ + +.yui-g .yui-u .yui-g { + width: 100%; +} + +/** + * Section: Grids and Nesting Grids + */ + +/* Children generally take half the available space */ +.yui-gb .yui-u, +.yui-g .yui-gb .yui-u, +.yui-gb .yui-g, +.yui-gb .yui-gb, +.yui-gb .yui-gc, +.yui-gb .yui-gd, +.yui-gb .yui-ge, +.yui-gb .yui-gf, +.yui-gc .yui-u, +.yui-gc .yui-g, +.yui-gd .yui-u { + float: left; +} + +/* Float units (and sub grids) to the right */ +.yui-g .yui-u, +.yui-g .yui-g, +.yui-g .yui-gb, +.yui-g .yui-gc, +.yui-g .yui-gd, +.yui-g .yui-ge, +.yui-g .yui-gf, +.yui-gc .yui-u, +.yui-gd .yui-g, +.yui-g .yui-gc .yui-u, +.yui-ge .yui-u, +.yui-ge .yui-g, +.yui-gf .yui-g, +.yui-gf .yui-u { + float: right; +} + +/*Float units (and sub grids) to the left */ +.yui-g div.first, +.yui-gb div.first, +.yui-gc div.first, +.yui-gd div.first, +.yui-ge div.first, +.yui-gf div.first, +.yui-g .yui-gc div.first, +.yui-g .yui-ge div.first, +.yui-gc div.first div.first { + float: left; +} + +.yui-g .yui-u, +.yui-g .yui-g, +.yui-g .yui-gb, +.yui-g .yui-gc, +.yui-g .yui-gd, +.yui-g .yui-ge, +.yui-g .yui-gf { + width: 49.1%; +} + +.yui-gb .yui-u, +.yui-g .yui-gb .yui-u, +.yui-gb .yui-g, +.yui-gb .yui-gb, +.yui-gb .yui-gc, +.yui-gb .yui-gd, +.yui-gb .yui-ge, +.yui-gb .yui-gf, +.yui-gc .yui-u, +.yui-gc .yui-g, +.yui-gd .yui-u { + width: 32%; + margin-left: 1.99%; +} + +/* Give IE some extra breathing room for 1/3-based rounding issues */ +.yui-gb .yui-u { + *margin-left: 1.9%; + *width: 31.9%; +} + +.yui-gc div.first, + .yui-gd .yui-u { + width: 66%; +} + +.yui-gd div.first { + width: 32%; +} + +.yui-ge div.first, + .yui-gf .yui-u { + width: 74.2%; +} + +.yui-ge .yui-u, + .yui-gf div.first { + width: 24%; +} + +.yui-g .yui-gb div.first, +.yui-gb div.first, +.yui-gc div.first, +.yui-gd div.first { + margin-left: 0; +} + +/** + * Section: Deep Nesting + */ + +.yui-g .yui-g .yui-u, +.yui-gb .yui-g .yui-u, +.yui-gc .yui-g .yui-u, +.yui-gd .yui-g .yui-u, +.yui-ge .yui-g .yui-u, +.yui-gf .yui-g .yui-u { + width: 49%; + *width: 48.1%; + *margin-left: 0; +} + +.yui-g .yui-g .yui-u { + width: 48.1%; +} + +/*SF 1927599 from 1.14 to 2.6.0*/ +.yui-g .yui-gb div.first, + .yui-gb .yui-gb div.first { + *margin-right: 0; + *width: 32%; + _width: 31.7%; +} + +.yui-g .yui-gc div.first, + .yui-gd .yui-g { + width: 66%; +} + +.yui-gb .yui-g div.first { + *margin-right: 4%; + _margin-right: 1.3%; +} + +.yui-gb .yui-gc div.first, + .yui-gb .yui-gd div.first { + *margin-right: 0; +} + +.yui-gb .yui-gb .yui-u, + .yui-gb .yui-gc .yui-u { + *margin-left: 1.8%; + _margin-left: 4%; +} + +.yui-g .yui-gb .yui-u { + _margin-left: 1.0%; +} + +.yui-gb .yui-gd .yui-u { + *width: 66%; + _width: 61.2%; +} + +.yui-gb .yui-gd div.first { + *width: 31%; + _width: 29.5%; +} + +.yui-g .yui-gc .yui-u, + .yui-gb .yui-gc .yui-u { + width: 32%; + _float: right; + margin-right: 0; + _margin-left: 0; +} + +.yui-gb .yui-gc div.first { + width: 66%; + *float: left; + *margin-left: 0; +} + +.yui-gb .yui-ge .yui-u, + .yui-gb .yui-gf .yui-u { + margin: 0; +} + +.yui-gb .yui-gb .yui-u { + _margin-left: .7%; +} + +.yui-gb .yui-g div.first, + .yui-gb .yui-gb div.first { + *margin-left: 0; +} + +.yui-gc .yui-g .yui-u, + .yui-gd .yui-g .yui-u { + *width: 48.1%; + *margin-left: 0; +} + +.yui-gb .yui-gd div.first { + width: 32%; +} + +.yui-g .yui-gd div.first { + _width: 29.9%; +} + +.yui-ge .yui-g { + width: 24%; +} + +.yui-gf .yui-g { + width: 74.2%; +} + +.yui-gb .yui-ge div.yui-u, + .yui-gb .yui-gf div.yui-u { + float: right; +} + +.yui-gb .yui-ge div.first, + .yui-gb .yui-gf div.first { + float: left; +} + +/* Width Accommodation for Nested Contexts */ +.yui-gb .yui-ge .yui-u, + .yui-gb .yui-gf div.first { + *width: 24%; + _width: 20%; +} + +/* Width Accommodation for Nested Contexts */ +.yui-gb .yui-ge div.first, + .yui-gb .yui-gf .yui-u { + *width: 73.5%; + _width: 65.5%; +} + +/* Patch for GD within GE */ +.yui-ge div.first .yui-gd .yui-u { + width: 65%; +} + +.yui-ge div.first .yui-gd div.first { + width: 32%; +} + +/* @group Clearing */ +#hd:after, +#bd:after, +#ft:after, +.yui-g:after, +.yui-gb:after, +.yui-gc:after, +.yui-gd:after, +.yui-ge:after, +.yui-gf:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} + +#hd, +#bd, +#ft, +.yui-g, +.yui-gb, +.yui-gc, +.yui-gd, +.yui-ge, +.yui-gf { + zoom: 1; +} diff --git a/spec/test_app/public/stylesheets/admin/reset-fonts-grids-2-6-0.css b/spec/test_app/public/stylesheets/admin/reset-fonts-grids-2-6-0.css new file mode 100644 index 0000000..b3e042c --- /dev/null +++ b/spec/test_app/public/stylesheets/admin/reset-fonts-grids-2-6-0.css @@ -0,0 +1,7 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}del,ins{text-decoration:none;}body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}select,input,button,textarea{font:99% arial,helvetica,clean,sans-serif;}table{font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,#doc4,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.25em;min-width:750px;}#doc2{width:73.076em;*width:71.25em;}#doc3{margin:auto 10px;width:auto;}#doc4{width:74.923em;*width:73.05em;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main,.yui-g .yui-u .yui-g{width:100%;}{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.30769em;*width:12.00em;}.yui-t1 #yui-main .yui-b{margin-left:13.30769em;*margin-left:13.05em;}.yui-t2 .yui-b{float:left;width:13.8461em;*width:13.50em;}.yui-t2 #yui-main .yui-b{margin-left:14.8461em;*margin-left:14.55em;}.yui-t3 .yui-b{float:left;width:23.0769em;*width:22.50em;}.yui-t3 #yui-main .yui-b{margin-left:24.0769em;*margin-left:23.62em;}.yui-t4 .yui-b{float:right;width:13.8456em;*width:13.50em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.55em;}.yui-t5 .yui-b{float:right;width:18.4615em;*width:18.00em;}.yui-t5 #yui-main .yui-b{margin-right:19.4615em;*margin-right:19.125em;}.yui-t6 .yui-b{float:right;width:23.0769em;*width:22.50em;}.yui-t6 #yui-main .yui-b{margin-right:24.0769em;*margin-right:23.62em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{float:left;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf,.yui-gc .yui-u,.yui-gd .yui-g,.yui-g .yui-gc .yui-u,.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf .yui-g,.yui-gf .yui-u{float:right;}.yui-g div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first,.yui-g .yui-gc div.first,.yui-g .yui-ge div.first,.yui-gc div.first div.first{float:left;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf{width:49.1%;}.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{width:32%;margin-left:1.99%;}.yui-gb .yui-u{*margin-left:1.9%;*width:31.9%;}.yui-gc div.first,.yui-gd .yui-u{width:66%;}.yui-gd div.first{width:32%;}.yui-ge div.first,.yui-gf .yui-u{width:74.2%;}.yui-ge .yui-u,.yui-gf div.first{width:24%;}.yui-g .yui-gb div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-g .yui-g .yui-u,.yui-gb .yui-g .yui-u,.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u,.yui-ge .yui-g .yui-u,.yui-gf .yui-g .yui-u{width:49%;*width:48.1%;*margin-left:0;}.yui-g .yui-g .yui-u{width:48.1%;}.yui-g .yui-gb div.first,.yui-gb .yui-gb div.first{*margin-right:0;*width:32%;_width:31.7%;}.yui-g .yui-gc div.first,.yui-gd .yui-g{width:66%;}.yui-gb .yui-g div.first{*margin-right:4%;_margin-right:1.3%;}.yui-gb .yui-gc div.first,.yui-gb .yui-gd div.first{*margin-right:0;}.yui-gb .yui-gb .yui-u,.yui-gb .yui-gc .yui-u{*margin-left:1.8%;_margin-left:4%;}.yui-g .yui-gb .yui-u{_margin-left:1.0%;}.yui-gb .yui-gd .yui-u{*width:66%;_width:61.2%;}.yui-gb .yui-gd div.first{*width:31%;_width:29.5%;}.yui-g .yui-gc .yui-u,.yui-gb .yui-gc .yui-u{width:32%;_float:right;margin-right:0;_margin-left:0;}.yui-gb .yui-gc div.first{width:66%;*float:left;*margin-left:0;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf .yui-u{margin:0;}.yui-gb .yui-gb .yui-u{_margin-left:.7%;}.yui-gb .yui-g div.first,.yui-gb .yui-gb div.first{*margin-left:0;}.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u{*width:48.1%;*margin-left:0;} .yui-gb .yui-gd div.first{width:32%;}.yui-g .yui-gd div.first{_width:29.9%;}.yui-ge .yui-g{width:24%;}.yui-gf .yui-g{width:74.2%;}.yui-gb .yui-ge div.yui-u,.yui-gb .yui-gf div.yui-u{float:right;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf div.first{float:left;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf div.first{*width:24%;_width:20%;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf .yui-u{*width:73.5%;_width:65.5%;}.yui-ge div.first .yui-gd .yui-u{width:65%;}.yui-ge div.first .yui-gd div.first{width:32%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;} \ No newline at end of file diff --git a/spec/test_app/public/stylesheets/admin/token-input.css b/spec/test_app/public/stylesheets/admin/token-input.css new file mode 100644 index 0000000..8647a92 --- /dev/null +++ b/spec/test_app/public/stylesheets/admin/token-input.css @@ -0,0 +1,109 @@ +/* Example tokeninput style #1: Token vertical list*/ +ul.token-input-list { + overflow: hidden; + height: auto !important; + height: 1%; + width: 400px; + border: 1px solid #999; + cursor: text; + font-size: 12px; + font-family: Verdana; + z-index: 999; + margin: 0; + padding: 0; + background-color: #fff; +} + +ul.token-input-list li { + list-style-type: none; +} + +ul.token-input-list li input { + border: 0; + width: 350px; + padding: 3px 8px; + background-color: white; +} + +li.token-input-token { + overflow: hidden; + height: auto !important; + height: 1%; + margin: 3px; + padding: 3px 5px; + color: #000; + font-weight: bold; + cursor: default; + display: block; +} + +li.token-input-token p { + float: left; + padding: 0; + margin: 0; +} + +li.token-input-token span { + float: right; + color: #777; + cursor: pointer; +} + +li.token-input-selected-token { + background-color: #08844e; + color: #fff; +} + +li.token-input-selected-token span { + color: #bbb; +} + +div.token-input-dropdown { + position: absolute; + width: 400px; + background-color: #fff; + overflow: hidden; + border-left: 1px solid #ccc; + border-right: 1px solid #ccc; + border-bottom: 1px solid #ccc; + cursor: default; + font-size: 12px; + font-family: Verdana; + z-index: 1; +} + +div.token-input-dropdown p { + margin: 0; + padding: 5px; + font-weight: bold; + color: #777; +} + +div.token-input-dropdown ul { + margin: 0; + padding: 0; +} + +div.token-input-dropdown ul li { + background-color: #fff; + padding: 3px; + list-style-type: none; +} + +div.token-input-dropdown ul li.token-input-dropdown-item { + background-color: #fafafa; +} + +div.token-input-dropdown ul li.token-input-dropdown-item2 { + background-color: #fff; +} + +div.token-input-dropdown ul li em { + font-weight: bold; + font-style: normal; +} + +li.token-input-token, div.token-input-dropdown ul li.token-input-selected-dropdown-item { + background-color: #BBDAFD; +} + diff --git a/spec/test_app/public/stylesheets/admin/yui-includes.css b/spec/test_app/public/stylesheets/admin/yui-includes.css new file mode 100755 index 0000000..d1559d2 --- /dev/null +++ b/spec/test_app/public/stylesheets/admin/yui-includes.css @@ -0,0 +1,14 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.5.2 +*/ +.yuimenubar{visibility:visible;position:static;}.yuimenu .yuimenu,.yuimenubar .yuimenu{visibility:hidden;position:absolute;top:-10000px;left:-10000px;}.yuimenubar li,.yuimenu li{list-style-type:none;}.yuimenubar ul,.yuimenu ul,.yuimenubar li,.yuimenu li,.yuimenu h6,.yuimenubar h6{margin:0;padding:0;}.yuimenuitemlabel,.yuimenubaritemlabel{text-align:left;white-space:nowrap;}.yuimenubar ul{*zoom:1;}.yuimenubar .yuimenu ul{*zoom:normal;}.yuimenubar>.bd>ul:after{content:".";display:block;clear:both;visibility:hidden;height:0;line-height:0;}.yuimenubaritem{float:left;}.yuimenubaritemlabel,.yuimenuitemlabel{display:block;}.yuimenuitemlabel .helptext{font-style:normal;display:block;margin:-1em 0 0 10em;}.yui-menu-shadow{position:absolute;visibility:hidden;z-index:-1;}.yui-menu-shadow-visible{top:2px;right:-3px;left:-3px;bottom:-3px;visibility:visible;}.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.yuimenu.show-scrollbars,.yuimenubar.show-scrollbars{overflow:visible;}.yuimenu.hide-scrollbars .yui-menu-shadow,.yuimenubar.hide-scrollbars .yui-menu-shadow{overflow:hidden;}.yuimenu.show-scrollbars .yui-menu-shadow,.yuimenubar.show-scrollbars .yui-menu-shadow{overflow:auto;}.yui-skin-sam .yuimenubar{font-size:93%;line-height:2;*line-height:1.9;border:solid 1px #808080;background:url(/images/yui-sprite.png) repeat-x 0 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritem{border-right:solid 1px #ccc;}.yui-skin-sam .yuimenubaritemlabel{padding:0 10px;color:#000;text-decoration:none;cursor:default;border-style:solid;border-color:#808080;border-width:1px 0;*position:relative;margin:-1px 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel{padding-right:20px;*display:inline-block;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu{background:url(/images/yui-menubaritem_submenuindicator.png) right center no-repeat;}.yui-skin-sam .yuimenubaritem-selected{background:url(/images/yui-sprite.png) repeat-x 0 -1700px;}.yui-skin-sam .yuimenubaritemlabel-selected{border-color:#7D98B8;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-selected{border-left-width:1px;margin-left:-1px;*left:-1px;}.yui-skin-sam .yuimenubaritemlabel-disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu-disabled{background-image:url(/images/yui-menubaritem_submenuindicator_disabled.png);}.yui-skin-sam .yuimenu{font-size:93%;line-height:1.5;*line-height:1.45;}.yui-skin-sam .yuimenubar .yuimenu,.yui-skin-sam .yuimenu .yuimenu{font-size:100%;}.yui-skin-sam .yuimenu .bd{border:solid 1px #808080;background-color:#fff;}.yui-skin-sam .yuimenu ul{padding:3px 0;border-width:1px 0 0 0;border-color:#ccc;border-style:solid;}.yui-skin-sam .yuimenu ul.first-of-type{border-width:0;}.yui-skin-sam .yuimenu h6{font-weight:bold;border-style:solid;border-color:#ccc;border-width:1px 0 0 0;color:#a4a4a4;padding:3px 10px 0 10px;}.yui-skin-sam .yuimenu ul.hastitle,.yui-skin-sam .yuimenu h6.first-of-type{border-width:0;}.yui-skin-sam .yuimenu .yui-menu-body-scrolled{border-color:#ccc #808080;overflow:hidden;}.yui-skin-sam .yuimenu .topscrollbar,.yui-skin-sam .yuimenu .bottomscrollbar{height:16px;border:solid 1px #808080;background:#fff url(/images/yui-sprite.png) no-repeat 0 0;}.yui-skin-sam .yuimenu .topscrollbar{border-bottom-width:0;background-position:center -950px;}.yui-skin-sam .yuimenu .topscrollbar_disabled{background-position:center -975px;}.yui-skin-sam .yuimenu .bottomscrollbar{border-top-width:0;background-position:center -850px;}.yui-skin-sam .yuimenu .bottomscrollbar_disabled{background-position:center -875px;}.yui-skin-sam .yuimenuitem{_border-bottom:solid 1px #fff;}.yui-skin-sam .yuimenuitemlabel{padding:0 20px;color:#000;text-decoration:none;cursor:default;}.yui-skin-sam .yuimenuitemlabel .helptext{margin-top:-1.5em;*margin-top:-1.45em;}.yui-skin-sam .yuimenuitem-hassubmenu{background-image:url(/images/yui-menuitem_submenuindicator.png);background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yuimenuitem-checked{background-image:url(/images/yui-menuitem_checkbox.png);background-position:left center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-shadow-visible{background-color:#000;opacity:.12;*filter:alpha(opacity=12);}.yui-skin-sam .yuimenuitem-selected{background-color:#B3D4FF;}.yui-skin-sam .yuimenuitemlabel-disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenuitem-hassubmenu-disabled{background-image:url(/images/yui-menuitem_submenuindicator_disabled.png);}.yui-skin-sam .yuimenuitem-checked-disabled{background-image:url(/images/yui-menuitem_checkbox_disabled.png);} +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.5.2 +*/ +.ygtvitem{}.ygtvitem table{margin-bottom:0;border:none;}.ygtvitem td{border:none;padding:0;}.ygtvtn{width:18px;height:22px;background:url(/images/tree-nav-icons/treeview-sprite.gif) 0 -5600px no-repeat;}.ygtvtm{width:18px;height:22px;cursor:pointer;background:url(/images/tree-nav-icons/treeview-sprite.gif) 0 -4000px no-repeat;}.ygtvtmh{width:18px;height:22px;cursor:pointer;background:url(/images/tree-nav-icons/treeview-sprite.gif) 0 -4800px no-repeat;}.ygtvtp{width:18px;height:22px;cursor:pointer;background:url(/images/tree-nav-icons/treeview-sprite.gif) 0 -6400px no-repeat;}.ygtvtph{width:18px;height:22px;cursor:pointer;background:url(/images/tree-nav-icons/treeview-sprite.gif) 0 -7200px no-repeat;}.ygtvln{width:18px;height:22px;background:url(/images/tree-nav-icons/treeview-sprite.gif) 0 -1600px no-repeat;}.ygtvlm{width:18px;height:22px;cursor:pointer;background:url(/images/tree-nav-icons/treeview-sprite.gif) 0 0px no-repeat;}.ygtvlmh{width:18px;height:22px;cursor:pointer;background:url(/images/tree-nav-icons/treeview-sprite.gif) 0 -800px no-repeat;}.ygtvlp{width:18px;height:22px;cursor:pointer;background:url(/images/tree-nav-icons/treeview-sprite.gif) 0 -2400px no-repeat;}.ygtvlph{width:18px;height:22px;cursor:pointer;background:url(/images/tree-nav-icons/treeview-sprite.gif) 0 -3200px no-repeat;}.ygtvloading{width:18px;height:22px;background:url(/images/tree-nav-icons/treeview-loading.gif) 0 0 no-repeat;}.ygtvdepthcell{width:18px;height:22px;background:url(/images/tree-nav-icons/treeview-sprite.gif) 0 -8000px no-repeat;}.ygtvblankdepthcell{width:18px;height:22px;}.ygtvchildren{}* html .ygtvchildren{height:2%;}.ygtvlabel,.ygtvlabel:link,.ygtvlabel:visited,.ygtvlabel:hover{margin-left:2px;text-decoration:none;background-color:white;}.ygtvspacer{height:22px;width:12px;} diff --git a/spec/test_app/public/stylesheets/datepicker.css b/spec/test_app/public/stylesheets/datepicker.css new file mode 100644 index 0000000..015b551 --- /dev/null +++ b/spec/test_app/public/stylesheets/datepicker.css @@ -0,0 +1,263 @@ +/* This is a very basic stylesheet for the date-picker. Feel free to create your own. */ + +/* The wrapper div */ +div.datePicker + { + position:absolute; + min-width:24em; + width:24em; + z-index:9999; + text-align:center; + + /* Change the font-size to suit your design's CSS. The following line is for the demo that has a 12px font-size defined on the body tag */ + font:900 0.8em/0.8em Verdana, Sans-Serif; + + /* For Example: If using the YUI font CSS, uncomment the following line to get a 10px font-size within the datePicker */ + /* font:900 77%/77% Verdana; */ + + background:transparent; + + /* Mozilla & Webkit extensions to stop text-selection. Remove if you wish to validate the CSS */ + -moz-user-select:none; + -khtml-user-select:none; + } +/* Styles for the static datePickers */ +div.staticDP + { + position:relative; + top:5px; + left:0; + } +/* The iframe hack to cover selectlists in Internet Explorer <= v6 */ +iframe.iehack + { + position:absolute; + background:#fff; + z-index:9998; + padding:0; + border:0; + display:none; + margin:0; + } +/* The "button" created beside each input for non-static datePickers */ +a.date-picker-control:link, +a.date-picker-control:visited, +a.date-picker-control:hover, +a.date-picker-control:active, +a.date-picker-control:focus + { + /*position:relative;*/ + /* Moz & FF */ + display: -moz-inline-stack; + border:0 none; + padding:0; + margin:0 0 0 4px; + background:transparent url(/images/datepicker/cal.gif) no-repeat 50% 50%; + min-width:16px; + line-height:1; + cursor:pointer; + visibility:visible; + text-decoration:none; + vertical-align:middle; + } +/* Feed IE6 the following rule, IE7 should handle the min-width declared above */ +* html a.date-picker-control + { + width:16px; + } +a.date-picker-control + { + /* IE, Safari & Opera. Seperate CSS rule seems to be required. */ + display:inline-block; + } +a.date-picker-control span + { + display:block; + width:16px; + height:16px; + margin:auto 0; + } +/* The next & previous buttons */ +div.datePicker th span + { + display:inline; + padding:0; + margin:0; + color:#000; + text-align:center; + line-height:1em; + border-width:0; + font-family: georgia, times new roman, palatino, times, bookman, serif; + background:transparent; + font-weight:bold; + cursor:pointer; + } +div.datePicker th span.month-display, +div.datePicker th span.year-display + { + text-transform:uppercase; + letter-spacing:1px; + font:normal 1.2em Verdana, Sans-Serif; + cursor:default; + } +div.datePicker th span.prev-but, +div.datePicker th span.next-but + { + font-size:1.8em; + cursor:pointer !important; + } + +div.datePicker th span.today-but + { + text-align:center; + margin:0 auto; + font:normal 1em Verdana, Sans-Serif; + width:100%; + text-decoration:none; + line-height:1.6em; + text-transform:uppercase; + cursor:pointer !important + } +div.datePicker thead th span.fd-disabled + { + color:#aaa; + cursor:default !important; + } +/* The mon, tue, wed etc day buttons */ +div.datePicker th span.fd-day-header + { + text-align:center; + margin:0 auto; + font:900 1em Verdana, Sans-Serif; + height:1.4em; + width:2em; + text-decoration:none; + text-transform:lowercase; + line-height:1.4em; + } +/* The table */ +div.datePicker table + { + position:relative; + margin:0; + padding:0; + border:1px solid #ccc; + background:#fff url(/images/datepicker/gradient-e5e5e5-ffffff.gif) repeat-x 0 -20px; + text-align:center; + width:100%; + border-spacing:2px; + table-layout:fixed; + border-collapse:separate; + } +/* Common TD & TH styling */ +div.datePicker table td + { + border:1px solid #ccc; + padding:0; + text-align:center; + vertical-align:middle; + /* Opera requires a line-height bigger than 1em in order to redraw properly */ + line-height:1.2em; + cursor:pointer; + background:#fff url(/images/datepicker/gradient-e5e5e5-ffffff.gif) repeat-x 0 -40px; + width:3em; + height:3em !important; + height:2.8em; + outline:none; + } +div.datePicker table th + { + border:0 none; + padding:0; + line-height:1em; + font-weight:bold; + color:#222; + text-align:center; + vertical-align:middle; + } +div.datePicker table td.date-picker-unused + { + background:#fff url(/images/datepicker/backstripes.gif); + border-color:#dcdcdc; + padding:0; + cursor:default !important; + } +div.datePicker table thead th.date-picker-title + { + width:auto; + height:auto; + padding:0.4em 0; + } +/* The "mon tue wed etc" day header button styles */ +div.datePicker table th.date-picker-day-header + { + text-transform:lowercase; + width:3em; + } +div.datePicker table th.date-picker-day-header span + { + display:block; + } +/* The "todays date" style */ +div.datePicker table td.date-picker-today + { + background:#fff url(/images/datepicker/bullet2.gif) no-repeat 0 0; + color:rgb(100,100,100) !important; + } +/* The "selected date" style */ +div.datePicker table td.date-picker-selected-date + { + color:#333 !important; + border-color:#333 !important; + } +/* the "highlight days" style */ +td.date-picker-highlight + { + color:#a86666; + } +/* The date "out of range" style */ +div.datePicker table td.out-of-range + { + color:#ccc !important; + font-style:oblique; + background:#fcfcfc !important; + cursor:default !important; + } +/* The "disabled days" style */ +div.datePicker table td.day-disabled + { + color:#aaa !important; + background:transparent !important; + cursor:default !important; + } +/* The "active cursor" style */ +div.datePicker table tbody td.date-picker-hover + { + background:#fff url(/images/datepicker/bg_header.jpg) no-repeat 0 0; + cursor:pointer; + border-color:rgb(100,130,170); + color:rgb(100,130,170); + } +/* + Quirksmode necessity? + --------------------- + + If your HTML document renders in quirksmode (i.e. has no doctype declaration) + then uncomment the following CSS rule to set a less drastic font-size in IE + +div.datePicker table th, +div.datePicker table td + { + font-size:100%; + } +*/ + +/* Remove the images for Internet Explorer <= v6 using the "* html" hack */ +* html div.datePicker table td + { + background-image:none; + } +* html div.datePicker table td.date-picker-unused + { + background:#f2f2f2; + } diff --git a/spec/test_app/public/stylesheets/jquery.autocomplete.css b/spec/test_app/public/stylesheets/jquery.autocomplete.css new file mode 100644 index 0000000..3ee6bf5 --- /dev/null +++ b/spec/test_app/public/stylesheets/jquery.autocomplete.css @@ -0,0 +1,48 @@ +.ac_results { + padding: 0px; + border: 1px solid black; + background-color: white; + overflow: hidden; + z-index: 99999; +} + +.ac_results ul { + width: 100%; + list-style-position: outside; + list-style: none; + padding: 0; + margin: 0; +} + +.ac_results li { + margin: 0px; + padding: 2px 5px; + cursor: default; + display: block; + /* + if width will be 100% horizontal scrollbar will apear + when scroll mode will be used + */ + /*width: 100%;*/ + font: menu; + font-size: 12px; + /* + it is very important, if line-height not setted or setted + in relative units scroll will be broken in firefox + */ + line-height: 16px; + overflow: hidden; +} + +.ac_loading { + background: white url('indicator.gif') right center no-repeat; +} + +.ac_odd { + background-color: #eee; +} + +.ac_over { + background-color: #0A246A; + color: white; +} \ No newline at end of file diff --git a/spec/test_app/public/stylesheets/scaffold.css b/spec/test_app/public/stylesheets/scaffold.css new file mode 100644 index 0000000..093c209 --- /dev/null +++ b/spec/test_app/public/stylesheets/scaffold.css @@ -0,0 +1,54 @@ +body { background-color: #fff; color: #333; } + +body, p, ol, ul, td { + font-family: verdana, arial, helvetica, sans-serif; + font-size: 13px; + line-height: 18px; +} + +pre { + background-color: #eee; + padding: 10px; + font-size: 11px; +} + +a { color: #000; } +a:visited { color: #666; } +a:hover { color: #fff; background-color:#000; } + +.fieldWithErrors { + padding: 2px; + background-color: red; + display: table; +} + +#errorExplanation { + width: 400px; + border: 2px solid red; + padding: 7px; + padding-bottom: 12px; + margin-bottom: 20px; + background-color: #f0f0f0; +} + +#errorExplanation h2 { + text-align: left; + font-weight: bold; + padding: 5px 5px 5px 15px; + font-size: 12px; + margin: -7px; + background-color: #c00; + color: #fff; +} + +#errorExplanation p { + color: #333; + margin-bottom: 0; + padding: 5px; +} + +#errorExplanation ul li { + font-size: 12px; + list-style: square; +} + diff --git a/spec/test_app/public/stylesheets/screen.css b/spec/test_app/public/stylesheets/screen.css new file mode 100644 index 0000000..49f8449 --- /dev/null +++ b/spec/test_app/public/stylesheets/screen.css @@ -0,0 +1,1195 @@ +html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} +*:focus { outline: 0; } +body { + line-height: 1em; + color: black; + background: #ffffff; +} +ol, ul { list-style: none; } +table { + border-collapse: separate; + border-spacing: 0; + vertical-align: middle; +} +caption, th, td { + text-align: left; + font-weight: normal; + vertical-align: middle; +} +q, blockquote { quotes: "" ""; } +q:before { content: ""; } +q:after { content: ""; } +blockquote:before { content: ""; } +blockquote:after { content: ""; } +img a { border: none; } +hr { + background: #dddddd; + color: #dddddd; + clear: both; + float: none; + width: 100%; + height: 0.1em; + margin: 0 0 1.45em; + border: none; +} +hr.space { + background: #dddddd; + color: #dddddd; + clear: both; + float: none; + width: 100%; + height: 0.1em; + margin: 0 0 1.45em; + border: none; + background: #ffffff; + color: #ffffff; +} +body { + line-height: 1.5; + font-family: Helvetica Neue, Arial, Helvetica, sans-serif; + color: #333333; + font-size: 75%; +} +h1 { + font-weight: normal; + color: #222222; + font-size: 3em; + line-height: 1; + margin-bottom: 0.5em; +} +h1 img { margin: 0; } +h2 { + font-weight: normal; + color: #222222; + font-size: 2em; + margin-bottom: 0.75em; +} +h3 { + font-weight: normal; + color: #222222; + font-size: 1.5em; + line-height: 1; + margin-bottom: 1em; +} +h4 { + font-weight: normal; + color: #222222; + font-size: 1.2em; + line-height: 1.25; + margin-bottom: 1.25em; +} +h5 { + font-weight: normal; + color: #222222; + font-size: 1em; + font-weight: bold; + margin-bottom: 1.5em; +} +h6 { + font-weight: normal; + color: #222222; + font-size: 1em; + font-weight: bold; +} +h2 img { margin: 0; } +h3 img { margin: 0; } +h4 img { margin: 0; } +h5 img { margin: 0; } +h6 img { margin: 0; } +p { margin: 0 0 1.5em; } +p img.left { + display: inline; + float: left; + margin: 1.5em 1.5em 1.5em 0; + padding: 0; +} +p img.right { + display: inline; + float: right; + margin: 1.5em 0 1.5em 1.5em; + padding: 0; +} +a { + text-decoration: underline; + color: #2e6ab1; +} +blockquote { + margin: 1.5em; + color: #666666; + font-style: italic; +} +strong { font-weight: bold; } +em { font-style: italic; } +dfn { + font-style: italic; + font-weight: bold; +} +sup, sub { line-height: 0; } +abbr, acronym { border-bottom: 1px dotted #666666; } +address { + margin: 0 0 1.5em; + font-style: italic; +} +del { color: #666666; } +pre { + margin: 1.5em 0; + white-space: pre; +} +pre, code, tt { + font: 1em 'andale mono', 'lucida console', monospace; + line-height: 1.5; +} +li ul { margin: 0 1.5em; } +li ol { margin: 0 1.5em; } +ul { + margin: 0 1.5em 1.5em 1.5em; + list-style-type: disc; +} +ol { + margin: 0 1.5em 1.5em 1.5em; + list-style-type: decimal; +} +dl { margin: 0 0 1.5em 0; } +dl dt { font-weight: bold; } +dd { margin-left: 1.5em; } +table { + margin-bottom: 1.4em; + width: 100%; +} +th { font-weight: bold; } +thead th { background: #c3d9ff; } +th, td, caption { padding: 4px 10px 4px 5px; } +tr.even td { background: #e5ecf9; } +tfoot { font-style: italic; } +caption { background: #eeeeee; } +.quiet { color: #666666; } +.loud { color: #111111; } +form p.field { + margin-bottom: 0.5em; + clear: both; +} +form p.field span.req { + color: red; + float: left; + margin-left: 2px; + position: relative; + top: -3px; +} +form p.field input[type=text] { + float: left; + margin: 0 5px 7px 0; +} +form p.field select { + float: left; + margin: 0 5px 7px 0; +} +form p.field.radios { line-height: 150%; } +label { font-weight: bold; } +div#checkout #checkout_form_address #billing label.error { + color: red; + float: left; + text-align: left; + display: inline-block; + top: 0px; + font-size: 11px; + border: none; + padding: 0px; + width: auto; +} +div#checkout #checkout_form_address #shipping label.error { + color: red; + float: left; + text-align: left; + display: inline-block; + top: 0px; + font-size: 11px; + border: none; + padding: 0px; + width: auto; +} +fieldset { margin-bottom: 1em; } +legend { + font-size: 150%; + font-weight: bold; + margin-bottom: 0.5em; +} +.no_margin_or_padding { + margin: 0; + padding: 0; +} +.leftie { + float: left; + width: 49%; +} +.rightie { + float: right; + width: 49%; +} +.clearfix { + overflow: hidden; + display: inline-block; +} +.clearfix { display: block; } +.nowrap { white-space: nowrap; } +.no-bullets { list-style: none; } +.inline-list { + list-style-type: none; + margin: 0px; + padding: 0px; + display: inline; +} +.inline-list li { + margin: 0px; + padding: 0px; + display: inline; +} +.colborder { + padding-right: 24px; + margin-right: 25px; + border-right: 1px solid #eeeeee; +} +body { + margin-top: 10px; + background: #ffffff url(../images/body-back.png) top left repeat-x; +} +div.left { + float: left; + width: 49%; +} +div.right { + float: right; + width: 49%; +} +a { outline: none; } +#wrapper { + background: transparent url(../images/wrapper-back.png) top center no-repeat; + padding: 25px 20px 20px; + position: relative; +} +body.two-col #wrapper { background-image: url(../images/wrapper-back-2.png); } +.container { + width: 950px; + margin: 0 auto; + overflow: hidden; + display: block; +} +#sidebar { + display: inline; + float: left; + width: 150px; + margin-right: 10px; + padding-right: 24px; + margin-right: 25px; + border-right: 1px solid #eeeeee; +} +#sidebar h3 { margin-bottom: 0.5em; } +body.one-col #content { + display: inline; + float: left; + width: 950px; +} +body.two-col #content { + display: inline; + float: left; + width: 750px; +} +#header { + position: relative; + color: #2e6ab1; + clear: both; +} +#header a { color: #2e6ab1; } +#header a:hover { color: #eeeeee; } +#footer { + padding-top: 2em; + clear: both; +} +#footer div.left { width: 37%; } +#footer div.right { + width: 63%; + text-align: right; +} +h1 { font-size: 2.5em; } +.form-buttons, .clear { clear: both; } +input.title { width: auto; } +p.follow-all { + font-size: 1.3em; + text-align: center; + display: block; +} +p img { + float: left; + margin-right: 5px; + vertical-align: middle; +} +.no_margin_or_padding { + margin: 0; + padding: 0; +} +.leftie { + float: left; + width: 49%; +} +.rightie { + float: right; + width: 49%; +} +.clearfix { + overflow: hidden; + display: inline-block; +} +.clearfix { display: block; } +.nowrap { white-space: nowrap; } +.no-bullets { list-style: none; } +.inline-list { + list-style-type: none; + margin: 0px; + padding: 0px; + display: inline; +} +.inline-list li { + margin: 0px; + padding: 0px; + display: inline; +} +.colborder { + padding-right: 24px; + margin-right: 25px; + border-right: 1px solid #eeeeee; +} +.navigation-list { + list-style: none; + margin: 0 0 1.5em -15px; +} +.navigation-list li { margin: 0; } +.navigation-list li a { + cursor: pointer !important; + text-decoration: none; + color: #333333; + display: block; + line-height: 2.5em; + padding-left: 20px; + width: 170px; + white-space: nowrap; + overflow: hidden; +} +.navigation-list li a:hover { background: url(../images/menu-hover.png) right center no-repeat; } +.navigation-list li.current { width: 200px; } +.navigation-list li.current a { + width: 180px; + background: url(../images/menu-current.png) right center no-repeat; + white-space: nowrap; + overflow: hidden; +} +.navigation-list li.current a.root { width: 183px; } +.navigation-list a.root { + color: #222222; + font-size: 1.5em; + text-indent: -5px; + line-height: 2.2em; +} +.breadcrumbs { margin-bottom: 1em; } +.breadcrumbs ul { + list-style-type: none; + margin: 0px; + padding: 0px; + display: inline; + margin: 0; + padding: 0; + overflow: auto; +} +.breadcrumbs ul li { + margin: 0px; + padding: 0px; + display: inline; +} +.breadcrumbs ul li { + line-height: 20px; + color: #666666; +} +.breadcrumbs ul li a { + text-decoration: none; + padding: 5px 7px; + color: #666666; +} +.breadcrumbs ul li span { + text-decoration: none; + padding: 5px 7px; + color: #666666; +} +.breadcrumbs ul li span { color: #333333; } +div#login-bar { display: inline; } +ul#language-bar { + list-style-type: none; + margin: 0px; + padding: 0px; + display: inline; +} +ul#language-bar li { + margin: 0px; + padding: 0px; + display: inline; +} +ul#language-bar strong { font-weight: normal; } +ul#nav-bar { + line-height: 50px; + float: right; + clear: both; + font-size: 1.2em; + list-style: none; + margin: 0; + padding: 0; +} +ul#nav-bar li { + float: left; + margin-left: 1em; +} +ul#nav-bar li.cart-indicator a { + padding-right: 40px; + background: transparent url(../images/cart-empty_x32.png) center right no-repeat; + display: block; +} +ul#nav-bar li.cart-indicator a.full { background-image: url(../images/cart-full_x32.png); } +.pagination { + padding-top: 10px; + text-align: right; +} +.pagination a.page { + padding: 0px 5px; + margin: 0px 3px; +} +.pagination span.page { + padding: 0px 5px; + margin: 0px 3px; +} +.pagination a.page { + text-decoration: none; + border: 1px solid #9aafe5; + color: #2e6ab1; +} +.pagination a.page:hover { + border: 1px solid #2b66a5; + color: #000000; +} +.pagination a.page:active { + border: 1px solid #2b66a5; + color: #000000; +} +.pagination a.next_page { font-weight: bold; } +.pagination span.disabled_page { + border: 1px solid #929292; + color: #929292; +} +.pagination span.current_page { + font-weight: bold; + border: 1px solid; + border-color: #162f54; + background-color: #2e6ab1; + color: #ffffff; +} +.no_margin_or_padding { + margin: 0; + padding: 0; +} +.leftie { + float: left; + width: 49%; +} +.rightie { + float: right; + width: 49%; +} +.clearfix { + overflow: hidden; + display: inline-block; +} +.clearfix { display: block; } +.nowrap { white-space: nowrap; } +.no-bullets { list-style: none; } +.inline-list { + list-style-type: none; + margin: 0px; + padding: 0px; + display: inline; +} +.inline-list li { + margin: 0px; + padding: 0px; + display: inline; +} +.colborder { + padding-right: 24px; + margin-right: 25px; + border-right: 1px solid #eeeeee; +} +.flash { + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + font-size: 1.3em; + margin-bottom: 1em; + padding: 0.8em; +} +.flash.notice { + background: #ccddff url(../images/shadow_top.png) 0px -50px repeat-x; + color: #556699; + border: 1px solid #99aacc; +} +.flash.errors { + background: #f4b4b4 url(../images/shadow_top.png) 0px -50px repeat-x; + color: #000000; + border: 1px solid #000000; +} +.formError { + font-size: 1.3em; + margin-bottom: 1em; + padding: 0.8em; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + background: #f4b4b4 url(../images/shadow_top.png) 0px -50px repeat-x; + color: #000000; + border: 1px solid #000000; +} +.formError p { margin: 0px; } +.formError ul { margin-bottom: 0px; } +.formError h2 { + font-weight: bold; + font-size: 1em; + margin: 0px; +} +.errorExplanation { + font-size: 1.3em; + margin-bottom: 1em; + padding: 0.8em; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + background: #f4b4b4 url(../images/shadow_top.png) 0px -50px repeat-x; + color: #000000; + border: 1px solid #000000; +} +.errorExplanation p { margin: 0px; } +.errorExplanation ul { margin-bottom: 0px; } +.errorExplanation h2 { + font-weight: bold; + font-size: 1em; + margin: 0px; +} +.fieldWithErrors { clear: none; } +.no_margin_or_padding { + margin: 0; + padding: 0; +} +.leftie { + float: left; + width: 49%; +} +.rightie { + float: right; + width: 49%; +} +.clearfix { + overflow: hidden; + display: inline-block; +} +.clearfix { display: block; } +.nowrap { white-space: nowrap; } +.no-bullets { list-style: none; } +.inline-list { + list-style-type: none; + margin: 0px; + padding: 0px; + display: inline; +} +.inline-list li { + margin: 0px; + padding: 0px; + display: inline; +} +.colborder { + padding-right: 24px; + margin-right: 25px; + border-right: 1px solid #eeeeee; +} +button, a.button, input.button { + -moz-border-radius: 0.3em; + -webkit-border-radius: 0.3em; + border-radius: 0.3em; + background: #efefef url(../images/buttons/bg-button.png) center left repeat-x !important; + border-style: solid; + border-width: 1px !important; + border-color: #dddddd #999999 #999999 #dddddd !important; + -moz-outline-radius: 0.3em; + color: #111111; + display: inline-block; + font-family: Helvetica Neue, Helvetica, Arial, Sans-serif; + font-size: 1.1em !important; + font-size-adjust: none; + font-stretch: normal; + font-style: normal; + font-variant: normal; + font-weight: normal; + line-height: 1.2em; + margin: 0px; + overflow: visible; + padding: 10px 17px; + text-decoration: none; + text-transform: lowercase; + width: auto; + height: auto; + cursor: pointer; +} +button.primary, a.button.primary, input.button.primary { + font-weight: bold; + color: #000000; +} +button:hover { background-image: url(../images/buttons/bg-button-hover.png) !important; } +a.button:hover { background-image: url(../images/buttons/bg-button-hover.png) !important; } +input.button:hover { background-image: url(../images/buttons/bg-button-hover.png) !important; } +button.large, a.button.large, input.button.large { + -moz-border-radius: 0.3em; + -webkit-border-radius: 0.3em; + border-radius: 0.3em; + font-size: 1.4em !important; + line-height: 1.4em; +} +button.small, a.button.small, input.button.small { + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + font-size: 0.9em; + line-height: 1.4em; + padding: 5px 10px; +} +button.small img { margin: 0 3px 0 0 !important; } +a.button.small img { margin: 0 3px 0 0 !important; } +input.button.small img { margin: 0 3px 0 0 !important; } +button.update img { margin-right: 7px; } +button.checkout img { margin-right: 7px; } +a.button.update img { margin-right: 7px; } +a.button.checkout img { margin-right: 7px; } +input.button.update img { margin-right: 7px; } +input.button.checkout img { margin-right: 7px; } +button img { vertical-align: middle; } +a.button img { vertical-align: middle; } +input.button img { vertical-align: middle; } +button:focus { outline: none; } +a.button:focus { outline: none; } +input.button:focus { outline: none; } +button::-moz-focus-inner { + padding: 0px; + border: none; +} +p a.button img { margin: 0 5px 0 0; } +p button img { margin: 0 5px 0 0; } +.prices { font-weight: bold; } +.prices #product-details .prices { font-size: 1.25em; } +.price.selling { color: #2e6ab1; } +#product-details .price.selling { font-size: 1.5em; } +.price.diff { + font-style: italic; + font-weight: normal; + color: #666666; +} +.no_margin_or_padding { + margin: 0; + padding: 0; +} +.leftie { + float: left; + width: 49%; +} +.rightie { + float: right; + width: 49%; +} +.clearfix { + overflow: hidden; + display: inline-block; +} +.clearfix { display: block; } +.nowrap { white-space: nowrap; } +.no-bullets { list-style: none; } +.inline-list { + list-style-type: none; + margin: 0px; + padding: 0px; + display: inline; +} +.inline-list li { + margin: 0px; + padding: 0px; + display: inline; +} +.colborder { + padding-right: 24px; + margin-right: 25px; + border-right: 1px solid #eeeeee; +} +.product-listing { + list-style: none; + margin: 2em 0px 0px 0px; + padding: 0px; +} +.product-listing li { + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + height: 180px; + width: 140px; + text-align: center; + float: left; + margin: 10px; + padding: 10px; + border: 1px solid #dddddd; + position: relative; +} +.product-listing li a { + display: block; + text-decoration: none; + color: #111111; +} +.product-listing li a.info { + position: absolute; + bottom: 0px; + right: 0px; + padding: 5px; + width: 150px; + min-height: 60px; + background: #ffffff url(../images/shadow_top.png) 0px -35px repeat-x; + border-top: 1px solid #ffffff; +} +.product-listing li a.info span { display: block; } +.product-listing li:hover { border-color: #1b1b1b; } +.product-listing li:hover a.info { + background: #1b1b1b url(../images/bottom_shine.png) bottom left repeat-x; + color: #ffffff; +} +ul.thumbnails { + margin: 0; + padding: 0; + list-style: none; +} +ul.thumbnails li { + float: left; + margin-right: 5px; + padding: 3px; + border: 1px solid #ffffff; + min-height: 50px; + width: 50px; + position: relative; +} +ul.thumbnails li img { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + margin: auto; +} +ul.thumbnails li:hover { border-color: #cccccc; } +ul.thumbnails li.selected { border-color: #999999; } +.no_margin_or_padding { + margin: 0; + padding: 0; +} +.leftie { + float: left; + width: 49%; +} +.rightie { + float: right; + width: 49%; +} +.clearfix { + overflow: hidden; + display: inline-block; +} +.clearfix { display: block; } +.nowrap { white-space: nowrap; } +.no-bullets { list-style: none; } +.inline-list { + list-style-type: none; + margin: 0px; + padding: 0px; + display: inline; +} +.inline-list li { + margin: 0px; + padding: 0px; + display: inline; +} +.colborder { + padding-right: 24px; + margin-right: 25px; + border-right: 1px solid #eeeeee; +} +#product-variants { margin-bottom: 1em; } +#product-variants ul { + list-style: none; + margin: 0; + padding: 0; +} +#product-images { + display: inline; + float: left; + width: 270px; + margin-right: 10px; +} +#product-images h4 { + padding: 6px 0px; + margin: 0px; + font-weight: bold; + clear: both; +} +#product-images #main-image { + min-height: 250px; + position: relative; +} +#product-images #main-image img { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + margin: auto; +} +#product-description { + display: inline; + float: left; + width: 310px; + margin-right: 10px; + padding-right: 24px; + margin-right: 25px; + border-right: 1px solid #eeeeee; +} +#cart-form { + display: inline; + float: left; + width: 270px; +} +#taxon-crumbs { + display: inline; + float: left; + width: 950px; + margin-right: 10px; + display: block; + float: right; + margin-top: 20px; + width: 300px; +} +dl.table-display { + margin: 0; + padding: 0; +} +dl.table-display dt { + float: left; + margin: 0; + padding: 5px; + border-top: 1px solid #dddddd; +} +dl.table-display dd { + float: left; + margin: 0; + padding: 5px; + border-top: 1px solid #dddddd; +} +dl.table-display dt { width: 100px; } +dl.table-display dd { width: 180px; } +.no_margin_or_padding { + margin: 0; + padding: 0; +} +.leftie { + float: left; + width: 49%; +} +.rightie { + float: right; + width: 49%; +} +.clearfix { + overflow: hidden; + display: inline-block; +} +.clearfix { display: block; } +.nowrap { white-space: nowrap; } +.no-bullets { list-style: none; } +.inline-list { + list-style-type: none; + margin: 0px; + padding: 0px; + display: inline; +} +.inline-list li { + margin: 0px; + padding: 0px; + display: inline; +} +.colborder { + padding-right: 24px; + margin-right: 25px; + border-right: 1px solid #eeeeee; +} +div#subtotal { + float: right; + width: 49%; + width: auto; + text-align: left; +} +table { border-collapse: collapse; } +table th { + background: transparent; + border-bottom: 1px solid #dddddd; +} +table#cart tr td { + border-bottom: 1px solid #dddddd; + padding: 1em 0; +} +table#cart tr#none td { border-bottom: none; } +table#cart h4 { margin-bottom: 0em; } +.no_margin_or_padding { + margin: 0; + padding: 0; +} +.leftie { + float: left; + width: 49%; +} +.rightie { + float: right; + width: 49%; +} +.clearfix { + overflow: hidden; + display: inline-block; +} +.clearfix { display: block; } +.nowrap { white-space: nowrap; } +.no-bullets { list-style: none; } +.inline-list { + list-style-type: none; + margin: 0px; + padding: 0px; + display: inline; +} +.inline-list li { + margin: 0px; + padding: 0px; + display: inline; +} +.colborder { + padding-right: 24px; + margin-right: 25px; + border-right: 1px solid #eeeeee; +} +#signup #new-customer { + display: inline; + float: left; + width: 470px; + margin-right: 10px; +} +#signup #new-customer h2 { margin-bottom: 0.25em; } +#signup #new-customer p { margin-bottom: 10px; } +#signup #new-customer p input.title { + padding: 3px; + margin: 0px; +} +#signup #new-customer input[type=checkbox] { top: 0em; } +#login #existing-customer { + display: inline; + float: left; + width: 470px; + margin-right: 10px; +} +#login #existing-customer h2 { margin-bottom: 0.25em; } +#login #existing-customer p { margin-bottom: 10px; } +#login #existing-customer p input.title { + padding: 3px; + margin: 0px; +} +#login #existing-customer input[type=checkbox] { top: 0em; } +input.openid_url { + background: #ffffff url(../images/openid-inputicon.gif) no-repeat scroll 0pt 50%; + padding-left: 18px; + border: 1px solid #bbbbbb; + font-size: 1.5em; +} +.no_margin_or_padding { + margin: 0; + padding: 0; +} +.leftie { + float: left; + width: 49%; +} +.rightie { + float: right; + width: 49%; +} +.clearfix { + overflow: hidden; + display: inline-block; +} +.clearfix { display: block; } +.nowrap { white-space: nowrap; } +.no-bullets { list-style: none; } +.inline-list { + list-style-type: none; + margin: 0px; + padding: 0px; + display: inline; +} +.inline-list li { + margin: 0px; + padding: 0px; + display: inline; +} +.colborder { + padding-right: 24px; + margin-right: 25px; + border-right: 1px solid #eeeeee; +} +ol.progress-steps { + list-style: none; + margin: 0; + padding: 0; + line-height: 1em; + font-size: 12px; +} +ol.progress-steps li { + margin: 0; + padding: 0; + list-style: none; + display: block; + float: left; + color: #999999; + background-position: top left; + background-repeat: no-repeat; + background-image: url(../images/step-progress/incomplete-incomplete.gif); +} +ol.progress-steps li span { + padding: 5px 14px 7px 24px; + display: block; + float: left; + background-position: top right; + background-repeat: no-repeat; +} +ol.progress-steps li a { + text-decoration: none; + color: #333333; +} +ol.progress-steps li.current-first span { padding-left: 14px; } +ol.progress-steps li.completed-first span { padding-left: 14px; } +ol.progress-steps li.current-first { background-image: url(../images/step-progress/current-first.gif); } +ol.progress-steps li.completed-first { background-image: url(../images/step-progress/completed-first.gif) !important; } +ol.progress-steps li.current { color: #ffffff; } +ol.progress-steps li.current-first { color: #ffffff; } +ol.progress-steps li.current-last { color: #ffffff; } +ol.progress-steps li.completed { background-image: url(../images/step-progress/completed-completed.gif); } +ol.progress-steps li.current { background-image: url(../images/step-progress/completed-current.gif); } +ol.progress-steps li.current-last { background-image: url(../images/step-progress/completed-current.gif); } +ol.progress-steps li.next { background-image: url(../images/step-progress/current-incomplete.gif); } +ol.progress-steps li.next-last { background-image: url(../images/step-progress/current-incomplete.gif); } +ol.progress-steps li.last span { background-image: url(../images/step-progress/incomplete-right.gif); } +ol.progress-steps li.next-last span { background-image: url(../images/step-progress/incomplete-right.gif); } +ol.progress-steps li.current-last span { background-image: url(../images/step-progress/current-right.gif); } +div#checkout { position: relative; } +div#checkout .progress-steps { + position: absolute; + top: 0.5em; + right: 0; +} +div#checkout form { + background-position: top right; + background-repeat: no-repeat; +} +div#checkout #checkout_form_address { background-image: url("../images/steps/2.png"); } +div#checkout #checkout_form_delivery { background-image: url("../images/steps/3.png"); } +div#checkout #checkout_form_address #billing label { + width: 190px; + float: left; + padding-right: 10px; + text-align: right; +} +div#checkout #checkout_form_address #shipping label { + width: 190px; + float: left; + padding-right: 10px; + text-align: right; +} +div#checkout #checkout_form_address #billing input { width: 304px; } +div#checkout #checkout_form_address #shipping input { width: 304px; } +div#checkout #checkout_form_address #billing select { width: 304px; } +div#checkout #checkout_form_address #shipping select { width: 304px; } +div#checkout #checkout_form_address #billing p.checkbox { padding-left: 200px; } +div#checkout #checkout_form_address #shipping p.checkbox { padding-left: 200px; } +div#checkout #checkout_form_address .form-buttons { padding-left: 200px; } +div#checkout #checkout_form_address #billing p.checkbox label { + width: auto !important; + float: none !important; +} +div#checkout #checkout_form_address #shipping p.checkbox label { + width: auto !important; + float: none !important; +} +div#checkout #checkout_form_address #billing p.checkbox input { width: auto !important; } +div#checkout #checkout_form_address #shipping p.checkbox input { width: auto !important; } +div#checkout #checkout_form_payment { background-image: url("../images/steps/5.png"); } +div#checkout #checkout_form_payment select { width: 75px; } +div#checkout #checkout_form_payment #payment { + display: inline; + float: left; + width: 310px; + margin-right: 10px; +} +div#checkout #checkout_form_payment #order_details { + display: inline; + float: left; + width: 470px; + margin-right: 10px; +} +div#checkout #payment-methods { + list-style: none; + display: block; + padding: 0; + margin: 0; + width: 720px; +} +div#checkout #payment-methods li { + display: block; + display: inline; + float: left; + width: 190px; + margin-right: 10px; +} +div#checkout #payment-methods li.last { + display: inline; + float: left; + width: 190px; +} +div#checkout #checkout-summary { + background-color: #c3c9df; + float: right; + margin-top: 10px; + padding: 20px; + width: 180px; +} +div#checkout #checkout-summary { + background-color: #c3c9df; + float: right; + margin-top: 10px; + padding: 20px; + width: 180px; +} diff --git a/spec/test_app/script/rails b/spec/test_app/script/rails new file mode 100755 index 0000000..f138a34 --- /dev/null +++ b/spec/test_app/script/rails @@ -0,0 +1,6 @@ +#!/usr/bin/env ruby1.8 +# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. + +APP_PATH = File.expand_path('../../config/application', __FILE__) +require File.expand_path('../../config/boot', __FILE__) +require 'rails/commands' diff --git a/spec/test_app/tmp/cache/588/EC0/Spree%3A%3AConfig b/spec/test_app/tmp/cache/588/EC0/Spree%3A%3AConfig new file mode 100644 index 0000000..dbbf977 Binary files /dev/null and b/spec/test_app/tmp/cache/588/EC0/Spree%3A%3AConfig differ diff --git a/spree_faq.gemspec b/spree_faq.gemspec new file mode 100644 index 0000000..1db696b --- /dev/null +++ b/spree_faq.gemspec @@ -0,0 +1,22 @@ +Gem::Specification.new do |s| + s.platform = Gem::Platform::RUBY + s.name = 'spree_faq' + s.version = '3.0.2' + s.summary = 'Adds an easy faq page to your spree site' + s.description = 'With this gem you get an faq page and the management tools to make it very easy to update your faq and reduce the demand on your sites customer service' + s.required_ruby_version = '>= 1.8.7' + + s.author = 'Josh Nussbaum' + s.email = 'joshnuss@gmail.com' + s.homepage = 'http://spreecommerce.com' + s.rubyforge_project = 'spree_faq' + + s.files = Dir['README.md', 'lib/**/*', 'app/**/*', 'config/*', 'db/*'] + s.require_path = 'lib' + s.requirements << 'none' + + s.has_rdoc = false + + s.add_dependency('spree_core', '>= 0.30.1') +end +