synergy_bootstrap_theme 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. data/.gitignore +4 -0
  2. data/LICENSE +23 -0
  3. data/README.md +22 -0
  4. data/app/controllers/home_controller.rb +8 -0
  5. data/app/helpers/base_helper_decorator.rb +16 -0
  6. data/app/helpers/checkout_helper_decorator.rb +69 -0
  7. data/app/helpers/orders_helper_decorator.rb +5 -0
  8. data/app/helpers/product_helper_decorator.rb +22 -0
  9. data/app/helpers/taxons_helper_decorator.rb +7 -0
  10. data/app/models/image_decorator.rb +3 -0
  11. data/app/models/product_decorator.rb +7 -0
  12. data/app/models/taxon_decorator.rb +4 -0
  13. data/app/views/addresses/_form.html.erb +15 -0
  14. data/app/views/addresses/edit.html.erb +15 -0
  15. data/app/views/admin/taxonomies/_list.html.erb +23 -0
  16. data/app/views/admin/taxonomies/_show_on_homepage_field.html.erb +4 -0
  17. data/app/views/checkout/_address.html.erb +191 -0
  18. data/app/views/checkout/_confirm.html.erb +10 -0
  19. data/app/views/checkout/_delivery.html.erb +22 -0
  20. data/app/views/checkout/_payment.html.erb +31 -0
  21. data/app/views/checkout/_summary.html.erb +23 -0
  22. data/app/views/checkout/edit.html.erb +27 -0
  23. data/app/views/checkout/registration.html.erb +25 -0
  24. data/app/views/home/index.html.erb +14 -0
  25. data/app/views/layouts/spree_application.html.erb +53 -0
  26. data/app/views/orders/_form.html.erb +19 -0
  27. data/app/views/orders/_line_item.html.erb +45 -0
  28. data/app/views/orders/edit.html.erb +53 -0
  29. data/app/views/products/_cart_form.html.erb +54 -0
  30. data/app/views/products/_description.html.erb +9 -0
  31. data/app/views/products/_image.html.erb +21 -0
  32. data/app/views/products/_properties.html.erb +15 -0
  33. data/app/views/products/_similar_products.html.erb +21 -0
  34. data/app/views/products/_thumbnails.html.erb +32 -0
  35. data/app/views/products/show.html.erb +37 -0
  36. data/app/views/shared/_breadcrumbs.html.erb +8 -0
  37. data/app/views/shared/_carousel.html.erb +39 -0
  38. data/app/views/shared/_error_messages.html.erb +12 -0
  39. data/app/views/shared/_footer.html.erb +10 -0
  40. data/app/views/shared/_head.html.erb +13 -0
  41. data/app/views/shared/_header.html.erb +45 -0
  42. data/app/views/shared/_login.html.erb +29 -0
  43. data/app/views/shared/_main_menu.html.erb +35 -0
  44. data/app/views/shared/_order_details.html.erb +50 -0
  45. data/app/views/shared/_products.html.erb +50 -0
  46. data/app/views/shared/_taxonomies.html.erb +26 -0
  47. data/app/views/shared/_user_form.html.erb +22 -0
  48. data/app/views/taxons/_taxon.html.erb +10 -0
  49. data/app/views/taxons/show.html.erb +26 -0
  50. data/app/views/user_passwords/edit.html.erb +26 -0
  51. data/app/views/user_passwords/new.html.erb +16 -0
  52. data/app/views/user_registrations/new.html.erb +17 -0
  53. data/app/views/user_sessions/new.html.erb +7 -0
  54. data/app/views/users/_addresses.html.erb +20 -0
  55. data/app/views/users/edit.html.erb +11 -0
  56. data/app/views/users/show.html.erb +57 -0
  57. data/config/initializers/advanced_cart.rb +3 -0
  58. data/config/initializers/constants.rb +3 -0
  59. data/config/locales/ru.yml +47 -0
  60. data/config/routes.rb +4 -0
  61. data/db/migrate/20110330125354_add_show_on_main_page_flag_to_taxonomies.rb +9 -0
  62. data/db/migrate/20110404120925_change_column_title_in_reviews.rb +13 -0
  63. data/db/migrate/20110510080413_revert_changes_column_title_in_reviews.rb +13 -0
  64. data/lib/synergy_bootstrap_theme.rb +39 -0
  65. data/lib/synergy_bootstrap_theme_hooks.rb +5 -0
  66. data/lib/tasks/install.rake +25 -0
  67. data/public/images/carousel_1.jpg +0 -0
  68. data/public/images/carousel_2.jpg +0 -0
  69. data/public/images/carousel_3.jpg +0 -0
  70. data/public/images/cart.png +0 -0
  71. data/public/images/glyphicons-halflings-white.png +0 -0
  72. data/public/images/glyphicons-halflings.png +0 -0
  73. data/public/images/noimage/taxon.png +0 -0
  74. data/public/javascripts/application.js +12 -0
  75. data/public/javascripts/bootstrap-image-gallery.min.js +1 -0
  76. data/public/javascripts/bootstrap.min.js +6 -0
  77. data/public/javascripts/jquery.min.js +4 -0
  78. data/public/javascripts/load-image.min.js +1 -0
  79. data/public/javascripts/rails.js +377 -0
  80. data/public/stylesheets/bootstrap-image-gallery.min.css +21 -0
  81. data/public/stylesheets/bootstrap.min.css +689 -0
  82. data/public/stylesheets/main.css +166 -0
  83. data/synergy_bootstrap_theme.gemspec +21 -0
  84. metadata +139 -0
@@ -0,0 +1,50 @@
1
+ <%
2
+ paginated_products = @searcher.products if params.key?(:keywords)
3
+ paginated_products ||= products
4
+ %>
5
+
6
+ <% if products.empty? %>
7
+ <%= t(:no_products_found) %>
8
+ <% elsif params.key?(:keywords) %>
9
+ <%= t(:search_results, :keywords => h(params[:keywords])) %>
10
+ <% end %>
11
+
12
+ <% if products.any? %>
13
+ <ul class="thumbnails">
14
+ <% products.each do |product| %>
15
+ <% if Spree::Config[:show_zero_stock_products] || product.has_stock? %>
16
+
17
+ <li class="span3 product" id="<%= dom_id(product) %>">
18
+ <%= hook :products_list_item, {:product => product} do %>
19
+ <div class="thumbnail">
20
+ <div class="caption centered">
21
+ <%= link_to raw(product.name), product %>
22
+ </div>
23
+ <div class="product-image-wrapper">
24
+ <%= link_to small_image(product), product %>
25
+ </div>
26
+ <div class="caption centered">
27
+ <span class="label label-info label-price"><%= product_price(product) %></span>
28
+ </div>
29
+ </div>
30
+ <% end %>
31
+ </li>
32
+ <% end %>
33
+ <% end %>
34
+ </ul>
35
+ <% end %>
36
+
37
+ <% if paginated_products.respond_to?(:total_pages)
38
+ params.delete(:search)
39
+ params.delete(:taxon) %>
40
+ <%= will_paginate(paginated_products,
41
+ :previous_label => "&#171; #{t('previous')}",
42
+ :next_label => "#{t('next')} &#187;") %>
43
+ <% end %>
44
+
45
+
46
+
47
+
48
+
49
+
50
+
@@ -0,0 +1,26 @@
1
+ <% cache ['taxonomies', @taxon], :expires_in => SHORT_INTERVAL do %>
2
+ <div class="span3">
3
+ <% get_taxonomies.each do |taxonomy| %>
4
+ <ul class="breadcrumb">
5
+ <li><%= link_to taxonomy.name, seo_url(taxonomy.root) %></li>
6
+ </ul>
7
+ <div class="span3 product_list">
8
+ <ul class="nav">
9
+ <% taxonomy.root.children.each do |taxon| %>
10
+ <li>
11
+ <%= link_to taxon.name, seo_url(taxon), :class => ("active" if @taxon and ([@taxon] + @taxon.ancestors).include?(taxon)) %>
12
+ <% if taxon.children.any? %>
13
+ <ul>
14
+ <% taxon.children.each do |t| %>
15
+ <li><%= link_to " - #{t.name} (#{t.products.count})", seo_url(t), :class => ("active" if @taxon == t) %></li>
16
+ <% end %>
17
+ </ul>
18
+ <% end %>
19
+ </li>
20
+ <% end %>
21
+ </ul>
22
+ </div>
23
+ <% end %>
24
+ </div>
25
+ <% end %>
26
+
@@ -0,0 +1,22 @@
1
+ <div class="control-group">
2
+ <%= f.label :email, t("email"), :class => "control-label" %>
3
+ <div class="controls">
4
+ <%= f.text_field :email %>
5
+ </div>
6
+ </div>
7
+
8
+ <div class="control-group">
9
+ <%= f.label :password, t("password"), :class => "control-label" %>
10
+ <div class="controls">
11
+ <%= f.password_field :password %>
12
+ </div>
13
+ </div>
14
+
15
+ <div class="control-group">
16
+ <%= f.label :password_confirmation, t("confirm_password"), :class => "control-label" %>
17
+ <div class="controls">
18
+ <%= f.password_field :password_confirmation %>
19
+ </div>
20
+ </div>
21
+
22
+ <%= hook :signup_below_password_fields %>
@@ -0,0 +1,10 @@
1
+ <li class="span3">
2
+ <div class="thumbnail">
3
+ <div class="product-image-wrapper">
4
+ <%= link_to image_tag(taxon.icon.url(:normal)), seo_url(taxon) %>
5
+ </div>
6
+ <div class="caption centered">
7
+ <%= link_to "#{taxon.name} (#{taxon.products.count})" %>
8
+ </div>
9
+ </div>
10
+ </li>
@@ -0,0 +1,26 @@
1
+ <%= render :partial => "shared/breadcrumbs", :locals => {
2
+ :crumbs => @taxon.children.empty? ? [{:path => seo_url(@taxon.parent), :name => @taxon.parent.name}] : [],
3
+ :location => accurate_title
4
+ } %>
5
+
6
+ <h1><%= accurate_title %></h1>
7
+
8
+ <% content_for :sidebar do %>
9
+ <%= hook :taxon_sidebar_navigation do %>
10
+ <%= render :partial => "shared/taxonomies" %>
11
+ <%= render(:partial => "shared/filters") if @taxon.children.empty? %>
12
+ <% end %>
13
+ <% end %>
14
+
15
+ <% if @taxon.children.empty? || !params[:keywords].blank? %>
16
+ <%= hook :taxon_products do %>
17
+ <%= render :partial => "shared/products", :locals => {:products => @products, :taxon => @taxon } %>
18
+ </ul>
19
+ <% end %>
20
+ <% else %>
21
+ <%= hook :taxon_children do %>
22
+ <ul class="thumbnails">
23
+ <%= render :partial => "taxon", :collection => @taxon.children %>
24
+ </ul>
25
+ <% end %>
26
+ <% end %>
@@ -0,0 +1,26 @@
1
+ <%= render "shared/error_messages", :target => @user %>
2
+
3
+ <%= form_for @user, :url => user_password_path, :html => {:class => "form-horizontal", :method => :put} do |f| %>
4
+ <fieldset>
5
+ <legend><%= t(:change_my_password) %></legend>
6
+
7
+ <div class="control-group">
8
+ <%= f.label :password, t("password"), :class => "control-label" %>
9
+ <div class="controls">
10
+ <%= f.password_field :password %>
11
+ </div>
12
+ </div>
13
+
14
+ <div class="control-group">
15
+ <%= f.label :password_confirmation, t("confirm_password"), :class => "control-label" %>
16
+ <div class="controls">
17
+ <%= f.password_field :password_confirmation %>
18
+ </div>
19
+ </div>
20
+
21
+ <div class="form-actions">
22
+ <%= f.submit t("update_password"), :class => "btn btn-primary" %>
23
+ </div>
24
+ </fieldset>
25
+ <% end %>
26
+
@@ -0,0 +1,16 @@
1
+ <%= form_for User.new, :as => :user, :url => user_password_path, :html => {:class => "form-horizontal"} do |f| %>
2
+ <fieldset>
3
+ <legend><%= t(:instructions_to_reset_password) %></legend>
4
+
5
+ <div class="control-group">
6
+ <%= f.label :email, t("email"), :class => "control-label" %>
7
+ <div class="controls">
8
+ <%= f.text_field :email %>
9
+ </div>
10
+ </div>
11
+
12
+ <div class="form-actions">
13
+ <%= f.submit t("reset_password"), :class => "btn btn-primary" %>
14
+ </div>
15
+ </fieldset>
16
+ <% end %>
@@ -0,0 +1,17 @@
1
+ <% @body_id = 'signup' %>
2
+
3
+ <%= render "shared/error_messages", :target => @user %>
4
+
5
+ <%= hook :signup do %>
6
+ <%= form_for(:user, :url => registration_path(@user), :html => {:class => "form-horizontal"}) do |f| %>
7
+ <fieldset>
8
+ <legend><%= t("new_customer") %></legend>
9
+ <%= render 'shared/user_form', :f => f %>
10
+ <div class="form-actions">
11
+ <%= f.submit t("registrate"), :class => "btn btn-primary" %>
12
+ </div>
13
+ </fieldset>
14
+ <% end %>
15
+ <% end %>
16
+
17
+ <%= hook :login_extras %>
@@ -0,0 +1,7 @@
1
+ <% @body_id = 'login' %>
2
+ <div id="existing-customer">
3
+ <%= hook :login do %>
4
+ <%= render :partial => 'shared/login' %>
5
+ <% end %>
6
+ </div>
7
+ <%= hook :login_extras %>
@@ -0,0 +1,20 @@
1
+ <% if current_user.addresses.present? %>
2
+ <h2><%= Address.human_name(:count => 2) %></h2>
3
+ <table class="table table-bordered">
4
+ <thead>
5
+ <tr>
6
+ <th><%= Address.human_name %></th>
7
+ <th></th>
8
+ </tr>
9
+ </thead>
10
+ <tbody>
11
+ <% current_user.addresses.each do |address| %>
12
+ <tr class="<%= cycle('even', 'odd') %>">
13
+ <td><%= address %></td>
14
+ <td><%= link_to t(:edit), edit_address_path(address) %></td>
15
+ <td><%= link_to t(:remove), address_path(address), :method => :delete, :confirm => t(:are_you_sure) %></td>
16
+ </tr>
17
+ <% end %>
18
+ </tbody>
19
+ </table>
20
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <%= render "shared/error_messages", :target => @user %>
2
+
3
+ <%= form_for(@user, :html => { :method => :put, :class => "form-horizontal"}) do |f| %>
4
+ <fieldset>
5
+ <legend><%= t(:editing_user) %></legend>
6
+ <%= render 'shared/user_form', :f => f %>
7
+ <div class="form-actions">
8
+ <%= f.submit t(:update), :class => "btn btn-primary" %>
9
+ </div>
10
+ </fieldset>
11
+ <% end %>
@@ -0,0 +1,57 @@
1
+ <h1><%= t("my_account") %></h1>
2
+
3
+ <%= hook :account_summary do %>
4
+ <div class="span8" style="margin-left: 0">
5
+ <table class="table table-bordered">
6
+ <tr>
7
+ <td><%= t("email") %>:</td>
8
+ <td>
9
+ <%= @user.email %>
10
+ </td>
11
+ </tr>
12
+ </table>
13
+ </div>
14
+
15
+ <div class="row"></div>
16
+ <%= link_to edit_account_path, :class => "btn btn-mini" do %>
17
+ <i class="icon-edit"></i>
18
+ <%= t('edit') %>
19
+ <% end %>
20
+ <br><br>
21
+
22
+ <% end %>
23
+
24
+ <%= hook :account_my_orders do %>
25
+
26
+ <h2><%= t("my_orders") %></h2>
27
+ <% if @orders.present? %>
28
+ <table class="table table-bordered" width="545">
29
+ <thead>
30
+ <tr>
31
+ <th><%= t("order_number") %></th>
32
+ <th><%= t("order_date") %></th>
33
+ <th><%= t("status") %></th>
34
+ <th><%= t("payment_state") %></th>
35
+ <th><%= t("shipment_state") %></th>
36
+ <th><%= t("total") %></th>
37
+ </tr>
38
+ </thead>
39
+ <tbody>
40
+ <% @orders.each do |order| %>
41
+ <tr class="<%= cycle('even', 'odd') %>">
42
+ <td><%= link_to order.number, order_url(order) %></td>
43
+ <td><%=order.created_at.to_date%></td>
44
+ <td><%= t(order.state).titleize %></td>
45
+ <td><%= t("payment_states.#{order.payment_state}") if order.payment_state %></td>
46
+ <td><%= t("shipment_states.#{order.shipment_state}") if order.shipment_state %></td>
47
+ <td><%= number_to_currency order.total %></td>
48
+ </tr>
49
+ <% end %>
50
+ </tbody>
51
+ </table>
52
+ <% else %>
53
+ <p><%= t(:you_have_no_orders_yet) %></p>
54
+ <% end %>
55
+ <br />
56
+
57
+ <% end %>
@@ -0,0 +1,3 @@
1
+ if defined?(Spree::AdvancedCart) && Spree::AdvancedCart::Config.instance
2
+ Spree::AdvancedCart::Config.set(:enable_shipping_cost_calculation => false)
3
+ end
@@ -0,0 +1,3 @@
1
+ # time intervals for memcached
2
+ LONG_INTERVAL = 30.minutes
3
+ SHORT_INTERVAL = 5.minutes
@@ -0,0 +1,47 @@
1
+ ru:
2
+ activerecord:
3
+ attributes:
4
+ user:
5
+ email: "Электронная почта"
6
+ taxonomy:
7
+ show_on_homepage: "отображать на главной странице"
8
+
9
+ number:
10
+ # Used in number_to_currency()
11
+ currency:
12
+ format:
13
+ precision: 0
14
+ shipping_method: Способ доставки
15
+ order_processed_successfully: Ваш заказ был успешно оформлен
16
+ new_customer: Регистрация в магазине
17
+ add_to_cart: В корзину
18
+ compare_products:
19
+ сomparable_products: "Список товаров:"
20
+ subtotal: Стоимость товаров
21
+ recalculate: Пересчитать
22
+ save_and_continue: Продолжить
23
+ email: "Электронная почта"
24
+ email_address: "Адрес электронной почты"
25
+ back_to_store: "Назад в магазин"
26
+ review_name: "Ваше имя"
27
+ product_properties: "Характеристики"
28
+ recently_viewed_products: "Вы недавно смотрели"
29
+ submit_your_review: "Добавить отзыв"
30
+ jgrowl_closer_template: "Закрыть все"
31
+ you_must_rate_the_product: "Вы должны оценить товар"
32
+ notice: "Уведомление"
33
+ create_a_new_account: "Зарегистрироваться"
34
+ empty: "Пусто"
35
+ login_as_existing: "Войти"
36
+ registrate: "Зарегистрироваться"
37
+ main_page: "Главная"
38
+ next: "Следующее"
39
+ previous: "Предыдущее"
40
+ wait: "Подождите..."
41
+ update_cart: "Обновить"
42
+ checkout: "Оформить заказ"
43
+ edit_address: "Редактировать адрес"
44
+ similar_products: "Похожие товары"
45
+ search: "Поиск"
46
+ find: "Искать"
47
+
data/config/routes.rb ADDED
@@ -0,0 +1,4 @@
1
+ Rails.application.routes.draw do
2
+ # Add your extension routes here
3
+ root :controller => "home", :action => "index"
4
+ end
@@ -0,0 +1,9 @@
1
+ class AddShowOnMainPageFlagToTaxonomies < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :taxonomies, :show_on_homepage, :boolean, :null => false, :default => false
4
+ end
5
+
6
+ def self.down
7
+ remove_column :taxonomies, :show_on_homepage
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ class ChangeColumnTitleInReviews < ActiveRecord::Migration
2
+ def self.up
3
+ if table_exists?(:reviews)
4
+ change_column(:reviews, :title, :string, :default => '-')
5
+ end
6
+ end
7
+
8
+ def self.down
9
+ if table_exists?(:reviews)
10
+ change_column(:reviews, :title, :string, :default => nil)
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class RevertChangesColumnTitleInReviews < ActiveRecord::Migration
2
+ def self.up
3
+ if table_exists?(:reviews)
4
+ change_column(:reviews, :title, :string, :default => nil)
5
+ end
6
+ end
7
+
8
+ def self.down
9
+ if table_exists?(:reviews)
10
+ change_column(:reviews, :title, :string, :default => '-')
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,39 @@
1
+ require 'spree_core'
2
+ require 'synergy_bootstrap_theme_hooks'
3
+
4
+ module SynergyBootstrapTheme
5
+ class Engine < Rails::Engine
6
+
7
+ config.autoload_paths += %W(#{config.root}/lib)
8
+
9
+ def self.activate
10
+ Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
11
+ Rails.env.production? ? require(c) : load(c)
12
+ end
13
+
14
+ #Admin::PagesController.cache_sweeper :page_sweeper
15
+ #Admin::TrackersController.cache_sweeper :tracker_sweeper
16
+
17
+ if defined?(Spree::RecentlyViewed) && Spree::RecentlyViewed::Config.instance
18
+ Spree::RecentlyViewed::Config.set :recently_viewed_products_max_count => 3
19
+ end
20
+
21
+ if Spree::Config.instance
22
+ Spree::Config.set :products_per_page => 12
23
+ end
24
+
25
+ =begin
26
+ Image.attachment_definitions[:attachment].merge!({
27
+ :styles => {
28
+ :mini => '50x50>',
29
+ :small => '150x150>',
30
+ :product => '240x240>',
31
+ :large => '600x600>'
32
+ }
33
+ })
34
+ =end
35
+ end
36
+
37
+ config.to_prepare &method(:activate).to_proc
38
+ end
39
+ end
@@ -0,0 +1,5 @@
1
+ class SynergyBootstrapThemeHooks < Spree::ThemeSupport::HookListener
2
+ insert_after :admin_inside_taxonomy_form, 'admin/taxonomies/show_on_homepage_field'
3
+
4
+ remove :continue_shopping_or_empty_cart
5
+ end
@@ -0,0 +1,25 @@
1
+ namespace :synergy_bootstrap_theme do
2
+ desc "Copies all migrations and assets (NOTE: This will be obsolete with Rails 3.1)"
3
+ task :install do
4
+ Rake::Task['synergy_bootstrap_theme:install:migrations'].invoke
5
+ Rake::Task['synergy_bootstrap_theme:install:assets'].invoke
6
+ end
7
+
8
+ namespace :install do
9
+ desc "Copies all migrations (NOTE: This will be obsolete with Rails 3.1)"
10
+ task :migrations do
11
+ source = File.join(File.dirname(__FILE__), '..', '..', 'db')
12
+ destination = File.join(Rails.root, 'db')
13
+ Spree::FileUtilz.mirror_files(source, destination)
14
+ end
15
+
16
+ desc "Copies all assets (NOTE: This will be obsolete with Rails 3.1)"
17
+ task :assets do
18
+ source = File.join(File.dirname(__FILE__), '..', '..', 'public')
19
+ destination = File.join(Rails.root, 'public')
20
+ puts "INFO: Mirroring assets from #{source} to #{destination}"
21
+ Spree::FileUtilz.mirror_files(source, destination)
22
+ end
23
+ end
24
+
25
+ end
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,12 @@
1
+ (function($){
2
+ $(document).ready(function(){
3
+
4
+ // Remove an item from the cart by setting its quantity to zero and posting the update form
5
+ $('form#updatecart a.delete').show().live('click', function(e){
6
+ $(this).parents('tr').find('input.line_item_quantity').val(0);
7
+ $(this).parents('form').submit();
8
+ e.preventDefault();
9
+ });
10
+
11
+ });
12
+ })(jQuery);
@@ -0,0 +1 @@
1
+ (function(a){"use strict",typeof define=="function"&&define.amd?define(["jquery","./load-image.js","bootstrap"],a):a(window.jQuery,window.loadImage)})(function(a,b){"use strict",a.extend(a.fn.modal.defaults,{delegate:document,selector:null,index:0,href:null,preloadRange:2,offsetWidth:100,offsetHeight:200,canvas:!1,slideshow:0,imageClickDivision:.5});var c=a.fn.modal.Constructor.prototype.show,d=a.fn.modal.Constructor.prototype.hide;a.extend(a.fn.modal.Constructor.prototype,{initLinks:function(){var b=this,c=this.options,d=c.selector||"a[data-target="+c.target+"]",e=0;a(c.delegate).find(d).each(function(d,f){var g=f.href||a(f).data("href");b.urls[b.urls.length-1]!==g&&(b.urls.push(g),b.titles.push(f.title),g===c.href&&(c.index=e),e+=1)}),this.urls[c.index]||(c.index=0)},startSlideShow:function(){var a=this;this.options.slideshow&&(this._slideShow=window.setTimeout(function(){a.next()},this.options.slideshow))},stopSlideShow:function(){window.clearTimeout(this._slideShow)},toggleSlideShow:function(){var a=this.$element.find(".modal-slideshow");this.options.slideshow?(this.options.slideshow=0,this.stopSlideShow()):(this.options.slideshow=a.data("slideshow")||5e3,this.startSlideShow()),a.find("i").toggleClass("icon-play icon-pause")},preloadImages:function(){var b=this.options,c=b.index+b.preloadRange+1,d,e;for(e=b.index-b.preloadRange;e<c;e+=1)d=this.urls[e],d&&e!==b.index&&a("<img>").prop("src",d)},loadImage:function(){var a=this,c=this.$element,d=this.options.index,e;c.trigger("beforeLoad"),this.abortLoad(),this.stopSlideShow(),this._loadingTimeout=window.setTimeout(function(){c.addClass("modal-loading")},100),e=c.find(".modal-image").children().removeClass("in"),window.setTimeout(function(){e.remove()},3e3),c.find(".modal-title").text(this.titles[d]),c.find(".modal-download").prop("href",this.urls[d]),this.loadingImage=b(this.urls[d],function(b){a.img=b,window.clearTimeout(a._loadingTimeout),c.removeClass("modal-loading"),c.trigger("load"),a.showImage(b),a.startSlideShow()},a.loadImageOptions),this.preloadImages()},showImage:function(b){var c=this.$element,d=a.support.transition&&c.hasClass("fade"),e=d?c.animate:c.css,f=c.find(".modal-image"),g,h;f.css({width:b.width,height:b.height}),c.find(".modal-title").css({width:Math.max(b.width,380)}),a(window).width()>480&&(d&&(g=c.clone().hide().appendTo(document.body)),e.call(c.stop(),{"margin-top":-((g||c).outerHeight()/2),"margin-left":-((g||c).outerWidth()/2)}),g&&g.remove()),f.append(b),h=b.offsetWidth,a(b).addClass("in")},abortLoad:function(){this.loadingImage&&(this.loadingImage.onload=this.loadingImage.onerror=null),window.clearTimeout(this._loadingTimeout)},prev:function(){var a=this.options;a.index-=1,a.index<0&&(a.index=this.urls.length-1),this.loadImage()},next:function(){var a=this.options;a.index+=1,a.index>this.urls.length-1&&(a.index=0),this.loadImage()},keyHandler:function(a){switch(a.which){case 37:case 38:a.preventDefault(),this.prev();break;case 39:case 40:a.preventDefault(),this.next()}},wheelHandler:function(a){a.preventDefault(),a=a.originalEvent,this._wheelCounter=this._wheelCounter||0,this._wheelCounter+=a.wheelDelta||a.detail||0;if(a.wheelDelta&&this._wheelCounter>=120||!a.wheelDelta&&this._wheelCounter<0)this.prev(),this._wheelCounter=0;else if(a.wheelDelta&&this._wheelCounter<=-120||!a.wheelDelta&&this._wheelCounter>0)this.next(),this._wheelCounter=0},initGalleryEvents:function(){var b=this,c=this.$element;c.find(".modal-image").on("click.modal-gallery",function(c){var d=a(this);b.urls.length===1?b.hide():(c.pageX-d.offset().left)/d.width()<b.options.imageClickDivision?b.prev(c):b.next(c)}),c.find(".modal-prev").on("click.modal-gallery",function(a){b.prev(a)}),c.find(".modal-next").on("click.modal-gallery",function(a){b.next(a)}),c.find(".modal-slideshow").on("click.modal-gallery",function(a){b.toggleSlideShow(a)}),a(document).on("keydown.modal-gallery",function(a){b.keyHandler(a)}).on("mousewheel.modal-gallery, DOMMouseScroll.modal-gallery",function(a){b.wheelHandler(a)})},destroyGalleryEvents:function(){var b=this.$element;this.abortLoad(),this.stopSlideShow(),b.find(".modal-image, .modal-prev, .modal-next, .modal-slideshow").off("click.modal-gallery"),a(document).off("keydown.modal-gallery").off("mousewheel.modal-gallery, DOMMouseScroll.modal-gallery")},show:function(){if(!this.isShown&&this.$element.hasClass("modal-gallery")){var b=this.$element,d=this.options,e=a(window).width(),f=a(window).height();this.urls=[],this.titles=[],b.hasClass("modal-fullscreen")?this.loadImageOptions={minWidth:e,minHeight:f,maxWidth:e,maxHeight:f,canvas:d.canvas}:this.loadImageOptions={maxWidth:e-d.offsetWidth,maxHeight:f-d.offsetHeight,canvas:d.canvas},e>480&&b.css({"margin-top":-(b.outerHeight()/2),"margin-left":-(b.outerWidth()/2)}),this.initGalleryEvents(),this.initLinks(),this.urls.length&&(b.find(".modal-slideshow, .modal-prev, .modal-next").toggle(this.urls.length!==1),b.toggleClass("modal-single",this.urls.length===1),this.loadImage())}c.apply(this,arguments)},hide:function(){this.isShown&&this.$element.hasClass("modal-gallery")&&(this.options.delegate=document,this.options.href=null,this.destroyGalleryEvents()),d.apply(this,arguments)}}),a(function(){a(document.body).on("click.modal-gallery.data-api",'[data-toggle="modal-gallery"]',function(b){var c=a(this),d=c.data(),e=a(d.target),f=e.data("modal"),g;f||(d=a.extend(e.data(),d)),d.selector||(d.selector="a[rel=gallery]"),g=a(b.target).closest(d.selector),g.length&&e.length&&(b.preventDefault(),d.href=g.prop("href")||g.data("href"),d.delegate=g[0]!==this?this:document,f&&a.extend(f.options,d),e.modal(d))})})});
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Bootstrap.js by @fat & @mdo
3
+ * Copyright 2012 Twitter, Inc.
4
+ * http://www.apache.org/licenses/LICENSE-2.0.txt
5
+ */
6
+ !function(a){a(function(){"use strict",a.support.transition=function(){var b=document.body||document.documentElement,c=b.style,d=c.transition!==undefined||c.WebkitTransition!==undefined||c.MozTransition!==undefined||c.MsTransition!==undefined||c.OTransition!==undefined;return d&&{end:function(){var b="TransitionEnd";return a.browser.webkit?b="webkitTransitionEnd":a.browser.mozilla?b="transitionend":a.browser.opera&&(b="oTransitionEnd"),b}()}}()})}(window.jQuery),!function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype={constructor:c,close:function(b){function f(){e.trigger("closed").remove()}var c=a(this),d=c.attr("data-target"),e;d||(d=c.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),e=a(d),e.trigger("close"),b&&b.preventDefault(),e.length||(e=c.hasClass("alert")?c:c.parent()),e.trigger("close").removeClass("in"),a.support.transition&&e.hasClass("fade")?e.on(a.support.transition.end,f):f()}},a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("alert");e||d.data("alert",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.alert.Constructor=c,a(function(){a("body").on("click.alert.data-api",b,c.prototype.close)})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.button.defaults,c)};b.prototype={constructor:b,setState:function(a){var b="disabled",c=this.$element,d=c.data(),e=c.is("input")?"val":"html";a+="Text",d.resetText||c.data("resetText",c[e]()),c[e](d[a]||this.options[a]),setTimeout(function(){a=="loadingText"?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},toggle:function(){var a=this.$element.parent('[data-toggle="buttons-radio"]');a&&a.find(".active").removeClass("active"),this.$element.toggleClass("active")}},a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("button"),f=typeof c=="object"&&c;e||d.data("button",e=new b(this,f)),c=="toggle"?e.toggle():c&&e.setState(c)})},a.fn.button.defaults={loadingText:"loading..."},a.fn.button.Constructor=b,a(function(){a("body").on("click.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle")})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.carousel.defaults,c),this.options.slide&&this.slide(this.options.slide),this.options.pause=="hover"&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.prototype={cycle:function(){return this.interval=setInterval(a.proxy(this.next,this),this.options.interval),this},to:function(b){var c=this.$element.find(".active"),d=c.parent().children(),e=d.index(c),f=this;if(b>d.length-1||b<0)return;return this.sliding?this.$element.one("slid",function(){f.to(b)}):e==b?this.pause().cycle():this.slide(b>e?"next":"prev",a(d[b]))},pause:function(){return clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(b,c){var d=this.$element.find(".active"),e=c||d[b](),f=this.interval,g=b=="next"?"left":"right",h=b=="next"?"first":"last",i=this;this.sliding=!0,f&&this.pause(),e=e.length?e:this.$element.find(".item")[h]();if(e.hasClass("active"))return;return!a.support.transition&&this.$element.hasClass("slide")?(this.$element.trigger("slide"),d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")):(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),this.$element.trigger("slide"),this.$element.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)})),f&&this.cycle(),this}},a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("carousel"),f=typeof c=="object"&&c;e||d.data("carousel",e=new b(this,f)),typeof c=="number"?e.to(c):typeof c=="string"||(c=f.slide)?e[c]():e.cycle()})},a.fn.carousel.defaults={interval:5e3,pause:"hover"},a.fn.carousel.Constructor=b,a(function(){a("body").on("click.carousel.data-api","[data-slide]",function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=!e.data("modal")&&a.extend({},e.data(),c.data());e.carousel(f),b.preventDefault()})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.collapse.defaults,c),this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.prototype={constructor:b,dimension:function(){var a=this.$element.hasClass("width");return a?"width":"height"},show:function(){var b=this.dimension(),c=a.camelCase(["scroll",b].join("-")),d=this.$parent&&this.$parent.find(".in"),e;d&&d.length&&(e=d.data("collapse"),d.collapse("hide"),e||d.data("collapse",null)),this.$element[b](0),this.transition("addClass","show","shown"),this.$element[b](this.$element[0][c])},hide:function(){var a=this.dimension();this.reset(this.$element[a]()),this.transition("removeClass","hide","hidden"),this.$element[a](0)},reset:function(a){var b=this.dimension();return this.$element.removeClass("collapse")[b](a||"auto")[0].offsetWidth,this.$element[a?"addClass":"removeClass"]("collapse"),this},transition:function(b,c,d){var e=this,f=function(){c=="show"&&e.reset(),e.$element.trigger(d)};this.$element.trigger(c)[b]("in"),a.support.transition&&this.$element.hasClass("collapse")?this.$element.one(a.support.transition.end,f):f()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("collapse"),f=typeof c=="object"&&c;e||d.data("collapse",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.collapse.defaults={toggle:!0},a.fn.collapse.Constructor=b,a(function(){a("body").on("click.collapse.data-api","[data-toggle=collapse]",function(b){var c=a(this),d,e=c.attr("data-target")||b.preventDefault()||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),f=a(e).data("collapse")?"toggle":c.data();a(e).collapse(f)})})}(window.jQuery),!function(a){function d(){a(b).parent().removeClass("open")}"use strict";var b='[data-toggle="dropdown"]',c=function(b){var c=a(b).on("click.dropdown.data-api",this.toggle);a("html").on("click.dropdown.data-api",function(){c.parent().removeClass("open")})};c.prototype={constructor:c,toggle:function(b){var c=a(this),e=c.attr("data-target"),f,g;return e||(e=c.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,"")),f=a(e),f.length||(f=c.parent()),g=f.hasClass("open"),d(),!g&&f.toggleClass("open"),!1}},a.fn.dropdown=function(b){return this.each(function(){var d=a(this),e=d.data("dropdown");e||d.data("dropdown",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.dropdown.Constructor=c,a(function(){a("html").on("click.dropdown.data-api",d),a("body").on("click.dropdown.data-api",b,c.prototype.toggle)})}(window.jQuery),!function(a){function c(){var b=this,c=setTimeout(function(){b.$element.off(a.support.transition.end),d.call(b)},500);this.$element.one(a.support.transition.end,function(){clearTimeout(c),d.call(b)})}function d(a){this.$element.hide().trigger("hidden"),e.call(this)}function e(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;this.$backdrop=a('<div class="modal-backdrop '+d+'" />').appendTo(document.body),this.options.backdrop!="static"&&this.$backdrop.click(a.proxy(this.hide,this)),e&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),e?this.$backdrop.one(a.support.transition.end,b):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,a.proxy(f,this)):f.call(this)):b&&b()}function f(){this.$backdrop.remove(),this.$backdrop=null}function g(){var b=this;this.isShown&&this.options.keyboard?a(document).on("keyup.dismiss.modal",function(a){a.which==27&&b.hide()}):this.isShown||a(document).off("keyup.dismiss.modal")}"use strict";var b=function(b,c){this.options=c,this.$element=a(b).delegate('[data-dismiss="modal"]',"click.dismiss.modal",a.proxy(this.hide,this))};b.prototype={constructor:b,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var b=this;if(this.isShown)return;a("body").addClass("modal-open"),this.isShown=!0,this.$element.trigger("show"),g.call(this),e.call(this,function(){var c=a.support.transition&&b.$element.hasClass("fade");!b.$element.parent().length&&b.$element.appendTo(document.body),b.$element.show(),c&&b.$element[0].offsetWidth,b.$element.addClass("in"),c?b.$element.one(a.support.transition.end,function(){b.$element.trigger("shown")}):b.$element.trigger("shown")})},hide:function(b){b&&b.preventDefault();if(!this.isShown)return;var e=this;this.isShown=!1,a("body").removeClass("modal-open"),g.call(this),this.$element.trigger("hide").removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?c.call(this):d.call(this)}},a.fn.modal=function(c){return this.each(function(){var d=a(this),e=d.data("modal"),f=a.extend({},a.fn.modal.defaults,d.data(),typeof c=="object"&&c);e||d.data("modal",e=new b(this,f)),typeof c=="string"?e[c]():f.show&&e.show()})},a.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},a.fn.modal.Constructor=b,a(function(){a("body").on("click.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({},e.data(),c.data());b.preventDefault(),e.modal(f)})})}(window.jQuery),!function(a){"use strict";var b=function(a,b){this.init("tooltip",a,b)};b.prototype={constructor:b,init:function(b,c,d){var e,f;this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.enabled=!0,this.options.trigger!="manual"&&(e=this.options.trigger=="hover"?"mouseenter":"focus",f=this.options.trigger=="hover"?"mouseleave":"blur",this.$element.on(e,this.options.selector,a.proxy(this.enter,this)),this.$element.on(f,this.options.selector,a.proxy(this.leave,this))),this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(b){return b=a.extend({},a.fn[this.type].defaults,b,this.$element.data()),b.delay&&typeof b.delay=="number"&&(b.delay={show:b.delay,hide:b.delay}),b},enter:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);!c.options.delay||!c.options.delay.show?c.show():(c.hoverState="in",setTimeout(function(){c.hoverState=="in"&&c.show()},c.options.delay.show))},leave:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);!c.options.delay||!c.options.delay.hide?c.hide():(c.hoverState="out",setTimeout(function(){c.hoverState=="out"&&c.hide()},c.options.delay.hide))},show:function(){var a,b,c,d,e,f,g;if(this.hasContent()&&this.enabled){a=this.tip(),this.setContent(),this.options.animation&&a.addClass("fade"),f=typeof this.options.placement=="function"?this.options.placement.call(this,a[0],this.$element[0]):this.options.placement,b=/in/.test(f),a.remove().css({top:0,left:0,display:"block"}).appendTo(b?this.$element:document.body),c=this.getPosition(b),d=a[0].offsetWidth,e=a[0].offsetHeight;switch(b?f.split(" ")[1]:f){case"bottom":g={top:c.top+c.height,left:c.left+c.width/2-d/2};break;case"top":g={top:c.top-e,left:c.left+c.width/2-d/2};break;case"left":g={top:c.top+c.height/2-e/2,left:c.left-d};break;case"right":g={top:c.top+c.height/2-e/2,left:c.left+c.width}}a.css(g).addClass(f).addClass("in")}},setContent:function(){var a=this.tip();a.find(".tooltip-inner").html(this.getTitle()),a.removeClass("fade in top bottom left right")},hide:function(){function d(){var b=setTimeout(function(){c.off(a.support.transition.end).remove()},500);c.one(a.support.transition.end,function(){clearTimeout(b),c.remove()})}var b=this,c=this.tip();c.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d():c.remove()},fixTitle:function(){var a=this.$element;(a.attr("title")||typeof a.attr("data-original-title")!="string")&&a.attr("data-original-title",a.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(b){return a.extend({},b?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||(typeof c.title=="function"?c.title.call(b[0]):c.title),a=(a||"").toString().replace(/(^\s*|\s*$)/,""),a},tip:function(){return this.$tip=this.$tip||a(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()}},a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("tooltip"),f=typeof c=="object"&&c;e||d.data("tooltip",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.tooltip.Constructor=b,a.fn.tooltip.defaults={animation:!0,delay:0,selector:!1,placement:"top",trigger:"hover",title:"",template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'}}(window.jQuery),!function(a){"use strict";var b=function(a,b){this.init("popover",a,b)};b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype,{constructor:b,setContent:function(){var b=this.tip(),c=this.getTitle(),d=this.getContent();b.find(".popover-title")[a.type(c)=="object"?"append":"html"](c),b.find(".popover-content > *")[a.type(d)=="object"?"append":"html"](d),b.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-content")||(typeof c.content=="function"?c.content.call(b[0]):c.content),a=a.toString().replace(/(^\s*|\s*$)/,""),a},tip:function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip}}),a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("popover"),f=typeof c=="object"&&c;e||d.data("popover",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.defaults=a.extend({},a.fn.tooltip.defaults,{placement:"right",content:"",template:'<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'})}(window.jQuery),!function(a){function b(b,c){var d=a.proxy(this.process,this),e=a(b).is("body")?a(window):a(b),f;this.options=a.extend({},a.fn.scrollspy.defaults,c),this.$scrollElement=e.on("scroll.scroll.data-api",d),this.selector=(this.options.target||(f=a(b).attr("href"))&&f.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=a("body").on("click.scroll.data-api",this.selector,d),this.refresh(),this.process()}"use strict",b.prototype={constructor:b,refresh:function(){this.targets=this.$body.find(this.selector).map(function(){var b=a(this).attr("href");return/^#\w/.test(b)&&a(b).length?b:null}),this.offsets=a.map(this.targets,function(b){return a(b).position().top})},process:function(){var a=this.$scrollElement.scrollTop()+this.options.offset,b=this.offsets,c=this.targets,d=this.activeTarget,e;for(e=b.length;e--;)d!=c[e]&&a>=b[e]&&(!b[e+1]||a<=b[e+1])&&this.activate(c[e])},activate:function(a){var b;this.activeTarget=a,this.$body.find(this.selector).parent(".active").removeClass("active"),b=this.$body.find(this.selector+'[href="'+a+'"]').parent("li").addClass("active"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active")}},a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("scrollspy"),f=typeof c=="object"&&c;e||d.data("scrollspy",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.defaults={offset:10},a(function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(window.jQuery),!function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype={constructor:b,show:function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target"),e,f;d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,""));if(b.parent("li").hasClass("active"))return;e=c.find(".active a").last()[0],b.trigger({type:"show",relatedTarget:e}),f=a(d),this.activate(b.parent("li"),c),this.activate(f,f.parent(),function(){b.trigger({type:"shown",relatedTarget:e})})},activate:function(b,c,d){function g(){e.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),f?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var e=c.find("> .active"),f=d&&a.support.transition&&e.hasClass("fade");f?e.one(a.support.transition.end,g):g(),e.removeClass("in")}},a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("tab");e||d.data("tab",e=new b(this)),typeof c=="string"&&e[c]()})},a.fn.tab.Constructor=b,a(function(){a("body").on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.typeahead.defaults,c),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.$menu=a(this.options.menu).appendTo("body"),this.source=this.options.source,this.shown=!1,this.listen()};b.prototype={constructor:b,select:function(){var a=this.$menu.find(".active").attr("data-value");return this.$element.val(a),this.$element.change(),this.hide()},show:function(){var b=a.extend({},this.$element.offset(),{height:this.$element[0].offsetHeight});return this.$menu.css({top:b.top+b.height,left:b.left}),this.$menu.show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(b){var c=this,d,e;return this.query=this.$element.val(),this.query?(d=a.grep(this.source,function(a){if(c.matcher(a))return a}),d=this.sorter(d),d.length?this.render(d.slice(0,this.options.items)).show():this.shown?this.hide():this):this.shown?this.hide():this},matcher:function(a){return~a.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(a){var b=[],c=[],d=[],e;while(e=a.shift())e.toLowerCase().indexOf(this.query.toLowerCase())?~e.indexOf(this.query)?c.push(e):d.push(e):b.push(e);return b.concat(c,d)},highlighter:function(a){return a.replace(new RegExp("("+this.query+")","ig"),function(a,b){return"<strong>"+b+"</strong>"})},render:function(b){var c=this;return b=a(b).map(function(b,d){return b=a(c.options.item).attr("data-value",d),b.find("a").html(c.highlighter(d)),b[0]}),b.first().addClass("active"),this.$menu.html(b),this},next:function(b){var c=this.$menu.find(".active").removeClass("active"),d=c.next();d.length||(d=a(this.$menu.find("li")[0])),d.addClass("active")},prev:function(a){var b=this.$menu.find(".active").removeClass("active"),c=b.prev();c.length||(c=this.$menu.find("li").last()),c.addClass("active")},listen:function(){this.$element.on("blur",a.proxy(this.blur,this)).on("keypress",a.proxy(this.keypress,this)).on("keyup",a.proxy(this.keyup,this)),(a.browser.webkit||a.browser.msie)&&this.$element.on("keydown",a.proxy(this.keypress,this)),this.$menu.on("click",a.proxy(this.click,this)).on("mouseenter","li",a.proxy(this.mouseenter,this))},keyup:function(a){switch(a.keyCode){case 40:case 38:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}a.stopPropagation(),a.preventDefault()},keypress:function(a){if(!this.shown)return;switch(a.keyCode){case 9:case 13:case 27:a.preventDefault();break;case 38:a.preventDefault(),this.prev();break;case 40:a.preventDefault(),this.next()}a.stopPropagation()},blur:function(a){var b=this;setTimeout(function(){b.hide()},150)},click:function(a){a.stopPropagation(),a.preventDefault(),this.select()},mouseenter:function(b){this.$menu.find(".active").removeClass("active"),a(b.currentTarget).addClass("active")}},a.fn.typeahead=function(c){return this.each(function(){var d=a(this),e=d.data("typeahead"),f=typeof c=="object"&&c;e||d.data("typeahead",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>'},a.fn.typeahead.Constructor=b,a(function(){a("body").on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(b){var c=a(this);if(c.data("typeahead"))return;b.preventDefault(),c.typeahead(c.data())})})}(window.jQuery);