comfypress 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/.travis.yml +22 -0
- data/Gemfile +22 -0
- data/Gemfile.lock +175 -0
- data/LICENSE +20 -0
- data/README.md +79 -0
- data/Rakefile +5 -0
- data/app/assets/images/comfypress/arrow_bottom.gif +0 -0
- data/app/assets/images/comfypress/arrow_right.gif +0 -0
- data/app/assets/images/comfypress/bootstrap/glyphicons-halflings-white.png +0 -0
- data/app/assets/images/comfypress/bootstrap/glyphicons-halflings.png +0 -0
- data/app/assets/images/comfypress/checkerboard.gif +0 -0
- data/app/assets/images/comfypress/icon_draft.gif +0 -0
- data/app/assets/images/comfypress/icon_file.gif +0 -0
- data/app/assets/images/comfypress/icon_layout.gif +0 -0
- data/app/assets/images/comfypress/icon_move.gif +0 -0
- data/app/assets/images/comfypress/icon_page.gif +0 -0
- data/app/assets/images/comfypress/icon_site.gif +0 -0
- data/app/assets/images/comfypress/icon_snippet.gif +0 -0
- data/app/assets/images/comfypress/nav_arrow.png +0 -0
- data/app/assets/javascripts/comfypress/admin/application.js +1 -0
- data/app/assets/javascripts/comfypress/application.js.coffee +175 -0
- data/app/assets/javascripts/comfypress/lib/bootstrap-datetimepicker.js +21 -0
- data/app/assets/javascripts/comfypress/lib/bootstrap-wysihtml5.js +492 -0
- data/app/assets/javascripts/comfypress/lib/bootstrap.js +6 -0
- data/app/assets/javascripts/comfypress/lib/codemirror.js +10 -0
- data/app/assets/javascripts/comfypress/lib/wysihtml5.js +261 -0
- data/app/assets/stylesheets/comfypress/admin/application.css +1 -0
- data/app/assets/stylesheets/comfypress/application.css.sass +8 -0
- data/app/assets/stylesheets/comfypress/base.css.sass +333 -0
- data/app/assets/stylesheets/comfypress/bootstrap_overrides.css.sass +45 -0
- data/app/assets/stylesheets/comfypress/codemirror_overrides.css.sass +27 -0
- data/app/assets/stylesheets/comfypress/lib/bootstrap-datetimepicker.css +9 -0
- data/app/assets/stylesheets/comfypress/lib/bootstrap-wysihtml5.css +102 -0
- data/app/assets/stylesheets/comfypress/lib/bootstrap.css +9 -0
- data/app/assets/stylesheets/comfypress/lib/codemirror.css +240 -0
- data/app/assets/stylesheets/comfypress/wysihtml5_overrides.css.sass +5 -0
- data/app/controllers/application_controller.rb +5 -0
- data/app/controllers/cms_admin/base_controller.rb +51 -0
- data/app/controllers/cms_admin/categories_controller.rb +35 -0
- data/app/controllers/cms_admin/files_controller.rb +108 -0
- data/app/controllers/cms_admin/layouts_controller.rb +67 -0
- data/app/controllers/cms_admin/menu_items_controller.rb +65 -0
- data/app/controllers/cms_admin/menus_controller.rb +60 -0
- data/app/controllers/cms_admin/pages_controller.rb +112 -0
- data/app/controllers/cms_admin/revisions_controller.rb +57 -0
- data/app/controllers/cms_admin/sites_controller.rb +64 -0
- data/app/controllers/cms_admin/snippets_controller.rb +64 -0
- data/app/controllers/cms_content_controller.rb +79 -0
- data/app/helpers/application_helper.rb +16 -0
- data/app/models/cms/block.rb +48 -0
- data/app/models/cms/categorization.rb +21 -0
- data/app/models/cms/category.rb +30 -0
- data/app/models/cms/file.rb +75 -0
- data/app/models/cms/layout.rb +99 -0
- data/app/models/cms/menu.rb +26 -0
- data/app/models/cms/menu_item.rb +14 -0
- data/app/models/cms/page.rb +202 -0
- data/app/models/cms/revision.rb +17 -0
- data/app/models/cms/site.rb +113 -0
- data/app/models/cms/snippet.rb +58 -0
- data/app/models/cms.rb +5 -0
- data/app/views/cms_admin/categories/_categories.html.haml +3 -0
- data/app/views/cms_admin/categories/_edit.html.haml +6 -0
- data/app/views/cms_admin/categories/_form.html.haml +8 -0
- data/app/views/cms_admin/categories/_index.html.haml +24 -0
- data/app/views/cms_admin/categories/_show.html.haml +13 -0
- data/app/views/cms_admin/categories/create.js.erb +7 -0
- data/app/views/cms_admin/categories/destroy.js.erb +3 -0
- data/app/views/cms_admin/categories/edit.js.erb +3 -0
- data/app/views/cms_admin/categories/update.js.erb +6 -0
- data/app/views/cms_admin/files/_file.html.haml +13 -0
- data/app/views/cms_admin/files/_form.html.haml +14 -0
- data/app/views/cms_admin/files/_index.html.haml +14 -0
- data/app/views/cms_admin/files/_page_form.html.haml +9 -0
- data/app/views/cms_admin/files/destroy.js.coffee +2 -0
- data/app/views/cms_admin/files/edit.html.haml +5 -0
- data/app/views/cms_admin/files/index.html.haml +28 -0
- data/app/views/cms_admin/files/new.html.haml +5 -0
- data/app/views/cms_admin/layouts/_form.html.haml +17 -0
- data/app/views/cms_admin/layouts/_index_branch.html.haml +23 -0
- data/app/views/cms_admin/layouts/edit.html.haml +9 -0
- data/app/views/cms_admin/layouts/index.html.haml +9 -0
- data/app/views/cms_admin/layouts/new.html.haml +5 -0
- data/app/views/cms_admin/menu_items/_form.html.haml +22 -0
- data/app/views/cms_admin/menu_items/edit.html.haml +8 -0
- data/app/views/cms_admin/menu_items/index.html.haml +24 -0
- data/app/views/cms_admin/menu_items/new.html.haml +5 -0
- data/app/views/cms_admin/menus/_form.html.haml +8 -0
- data/app/views/cms_admin/menus/edit.html.haml +8 -0
- data/app/views/cms_admin/menus/index.html.haml +24 -0
- data/app/views/cms_admin/menus/new.html.haml +5 -0
- data/app/views/cms_admin/pages/_form.html.haml +38 -0
- data/app/views/cms_admin/pages/_form_blocks.html.haml +28 -0
- data/app/views/cms_admin/pages/_index_branch.html.haml +35 -0
- data/app/views/cms_admin/pages/edit.html.haml +9 -0
- data/app/views/cms_admin/pages/form_blocks.js.erb +2 -0
- data/app/views/cms_admin/pages/index.html.haml +11 -0
- data/app/views/cms_admin/pages/new.html.haml +5 -0
- data/app/views/cms_admin/pages/toggle_branch.js.erb +11 -0
- data/app/views/cms_admin/revisions/show.html.haml +28 -0
- data/app/views/cms_admin/sites/_form.html.haml +14 -0
- data/app/views/cms_admin/sites/_mirrors.html.haml +17 -0
- data/app/views/cms_admin/sites/edit.html.haml +5 -0
- data/app/views/cms_admin/sites/index.html.haml +24 -0
- data/app/views/cms_admin/sites/new.html.haml +5 -0
- data/app/views/cms_admin/snippets/_form.html.haml +11 -0
- data/app/views/cms_admin/snippets/edit.html.haml +9 -0
- data/app/views/cms_admin/snippets/index.html.haml +28 -0
- data/app/views/cms_admin/snippets/new.html.haml +5 -0
- data/app/views/cms_content/_menu.html.haml +5 -0
- data/app/views/cms_content/render_sitemap.xml.builder +15 -0
- data/app/views/layouts/cms_admin/_body.html.haml +16 -0
- data/app/views/layouts/cms_admin/_center.html.haml +7 -0
- data/app/views/layouts/cms_admin/_footer.html.haml +3 -0
- data/app/views/layouts/cms_admin/_footer_js.html.haml +7 -0
- data/app/views/layouts/cms_admin/_head.html.haml +12 -0
- data/app/views/layouts/cms_admin/_left.html.haml +11 -0
- data/app/views/layouts/cms_admin/_right.html.haml +1 -0
- data/app/views/layouts/cms_admin.html.haml +4 -0
- data/comfypress.gemspec +28 -0
- data/config/application.rb +69 -0
- data/config/boot.rb +6 -0
- data/config/database.sqlite.yml +47 -0
- data/config/database.yml +47 -0
- data/config/environment.rb +5 -0
- data/config/environments/development.rb +39 -0
- data/config/environments/production.rb +67 -0
- data/config/environments/test.rb +39 -0
- data/config/initializers/comfypress.rb +100 -0
- data/config/initializers/paperclip.rb +3 -0
- data/config/locales/de.yml +236 -0
- data/config/locales/en.yml +285 -0
- data/config/locales/es.yml +236 -0
- data/config/locales/fr.yml +236 -0
- data/config/locales/ja.yml +237 -0
- data/config/locales/pl.yml +236 -0
- data/config/locales/pt-BR.yml +236 -0
- data/config/locales/ru.yml +236 -0
- data/config/locales/sv.yml +236 -0
- data/config/locales/zh-CN.yml +236 -0
- data/config/routes.rb +10 -0
- data/config.ru +4 -0
- data/db/cms_fixtures/sample-site/layouts/default/_default.yml +1 -0
- data/db/cms_fixtures/sample-site/layouts/default/content.html +5 -0
- data/db/cms_fixtures/sample-site/layouts/default/css.css +1 -0
- data/db/cms_fixtures/sample-site/layouts/default/js.js +1 -0
- data/db/cms_fixtures/sample-site/layouts/default/nested/_nested.yml +2 -0
- data/db/cms_fixtures/sample-site/layouts/default/nested/content.html +2 -0
- data/db/cms_fixtures/sample-site/layouts/default/nested/css.css +1 -0
- data/db/cms_fixtures/sample-site/layouts/default/nested/js.js +1 -0
- data/db/cms_fixtures/sample-site/pages/index/_index.yml +2 -0
- data/db/cms_fixtures/sample-site/pages/index/child/_child.yml +3 -0
- data/db/cms_fixtures/sample-site/pages/index/child/left.html +1 -0
- data/db/cms_fixtures/sample-site/pages/index/child/right.html +1 -0
- data/db/cms_fixtures/sample-site/pages/index/content.html +2 -0
- data/db/cms_fixtures/sample-site/snippets/default/_default.yml +1 -0
- data/db/cms_fixtures/sample-site/snippets/default/content.html +1 -0
- data/db/migrate/01_create_cms.rb +163 -0
- data/db/seeds.rb +9 -0
- data/db/upgrade_migrations/02_upgrade_to_1_1_0.rb +19 -0
- data/db/upgrade_migrations/03_upgrade_to_1_2_0.rb +15 -0
- data/db/upgrade_migrations/04_upgrade_to_1_3_0.rb +23 -0
- data/db/upgrade_migrations/05_upgrade_to_1_4_0.rb +33 -0
- data/db/upgrade_migrations/06_upgrade_to_1_5_0.rb +21 -0
- data/db/upgrade_migrations/07_upgrade_to_1_6_0.rb +25 -0
- data/doc/preview.png +0 -0
- data/doc/sofa.png +0 -0
- data/lib/comfypress/authentication/dummy_auth.rb +8 -0
- data/lib/comfypress/authentication/http_auth.rb +18 -0
- data/lib/comfypress/configuration.rb +99 -0
- data/lib/comfypress/engine.rb +18 -0
- data/lib/comfypress/error.rb +24 -0
- data/lib/comfypress/extensions/acts_as_tree.rb +102 -0
- data/lib/comfypress/extensions/has_revisions.rb +64 -0
- data/lib/comfypress/extensions/is_categorized.rb +49 -0
- data/lib/comfypress/extensions/is_mirrored.rb +85 -0
- data/lib/comfypress/extensions/rails.rb +24 -0
- data/lib/comfypress/fixtures.rb +289 -0
- data/lib/comfypress/form_builder.rb +97 -0
- data/lib/comfypress/render_methods.rb +85 -0
- data/lib/comfypress/routing.rb +62 -0
- data/lib/comfypress/sitemap.rb +27 -0
- data/lib/comfypress/tag.rb +154 -0
- data/lib/comfypress/tags/asset.rb +25 -0
- data/lib/comfypress/tags/collection.rb +64 -0
- data/lib/comfypress/tags/field_datetime.rb +17 -0
- data/lib/comfypress/tags/field_integer.rb +17 -0
- data/lib/comfypress/tags/field_rich_text.rb +17 -0
- data/lib/comfypress/tags/field_string.rb +17 -0
- data/lib/comfypress/tags/field_text.rb +17 -0
- data/lib/comfypress/tags/file.rb +29 -0
- data/lib/comfypress/tags/helper.rb +24 -0
- data/lib/comfypress/tags/menu.rb +27 -0
- data/lib/comfypress/tags/page_datetime.rb +13 -0
- data/lib/comfypress/tags/page_file.rb +51 -0
- data/lib/comfypress/tags/page_files.rb +52 -0
- data/lib/comfypress/tags/page_integer.rb +13 -0
- data/lib/comfypress/tags/page_markdown.rb +22 -0
- data/lib/comfypress/tags/page_rich_text.rb +13 -0
- data/lib/comfypress/tags/page_string.rb +13 -0
- data/lib/comfypress/tags/page_text.rb +13 -0
- data/lib/comfypress/tags/partial.rb +23 -0
- data/lib/comfypress/tags/snippet.rb +19 -0
- data/lib/comfypress/version.rb +3 -0
- data/lib/comfypress/view_hooks.rb +32 -0
- data/lib/comfypress/view_methods.rb +52 -0
- data/lib/comfypress.rb +66 -0
- data/lib/generators/comfy/cms/README +10 -0
- data/lib/generators/comfy/cms/cms_generator.rb +57 -0
- data/lib/tasks/comfypress.rake +45 -0
- data/script/rails +6 -0
- data/test/fixtures/cms/blocks.yml +12 -0
- data/test/fixtures/cms/categories.yml +4 -0
- data/test/fixtures/cms/categorizations.yml +3 -0
- data/test/fixtures/cms/files.yml +9 -0
- data/test/fixtures/cms/layouts.yml +40 -0
- data/test/fixtures/cms/menu_items.yml +15 -0
- data/test/fixtures/cms/menus.yml +9 -0
- data/test/fixtures/cms/pages.yml +39 -0
- data/test/fixtures/cms/revisions.yml +21 -0
- data/test/fixtures/cms/sites.yml +6 -0
- data/test/fixtures/cms/snippets.yml +6 -0
- data/test/fixtures/files/data.zip +0 -0
- data/test/fixtures/files/document.pdf +0 -0
- data/test/fixtures/files/image.gif +0 -0
- data/test/fixtures/files/image.jpg +0 -0
- data/test/fixtures/views/_nav_hook.html.erb +1 -0
- data/test/fixtures/views/_nav_hook_2.html.erb +1 -0
- data/test/fixtures/views/render_test/_test.html.erb +1 -0
- data/test/fixtures/views/render_test/new.html.erb +1 -0
- data/test/fixtures/views/render_test/render_layout.html.erb +1 -0
- data/test/functional/cms_admin/base_controller_test.rb +18 -0
- data/test/functional/cms_admin/categories_controller_test.rb +70 -0
- data/test/functional/cms_admin/files_controller_test.rb +216 -0
- data/test/functional/cms_admin/layouts_controller_test.rb +123 -0
- data/test/functional/cms_admin/pages_controller_test.rb +450 -0
- data/test/functional/cms_admin/revisions_controller_test.rb +138 -0
- data/test/functional/cms_admin/sites_controller_test.rb +105 -0
- data/test/functional/cms_admin/snippets_controller_test.rb +140 -0
- data/test/functional/cms_content_controller_test.rb +205 -0
- data/test/gemfiles/Gemfile.rails.3.1 +16 -0
- data/test/gemfiles/Gemfile.rails.3.2 +16 -0
- data/test/gemfiles/Gemfile.rails.4.0 +16 -0
- data/test/integration/authentication_test.rb +48 -0
- data/test/integration/fixtures_test.rb +61 -0
- data/test/integration/mirrors_test.rb +72 -0
- data/test/integration/render_cms_test.rb +233 -0
- data/test/integration/sites_test.rb +120 -0
- data/test/integration/view_hooks_test.rb +43 -0
- data/test/test_helper.rb +124 -0
- data/test/unit/cms/menu_item_test.rb +7 -0
- data/test/unit/cms/menu_test.rb +7 -0
- data/test/unit/configuration_test.rb +42 -0
- data/test/unit/fixtures_test.rb +357 -0
- data/test/unit/mirrors_test.rb +242 -0
- data/test/unit/models/block_test.rb +199 -0
- data/test/unit/models/categorization_test.rb +76 -0
- data/test/unit/models/category_test.rb +39 -0
- data/test/unit/models/file_test.rb +89 -0
- data/test/unit/models/layout_test.rb +125 -0
- data/test/unit/models/page_test.rb +255 -0
- data/test/unit/models/site_test.rb +152 -0
- data/test/unit/models/snippet_test.rb +49 -0
- data/test/unit/revisions_test.rb +185 -0
- data/test/unit/sitemap_test.rb +20 -0
- data/test/unit/tag_test.rb +308 -0
- data/test/unit/tags/asset_test.rb +56 -0
- data/test/unit/tags/collection_test.rb +116 -0
- data/test/unit/tags/field_datetime_test.rb +50 -0
- data/test/unit/tags/field_integer_test.rb +49 -0
- data/test/unit/tags/field_rich_text_test.rb +49 -0
- data/test/unit/tags/field_string_test.rb +52 -0
- data/test/unit/tags/field_text_test.rb +48 -0
- data/test/unit/tags/file_test.rb +67 -0
- data/test/unit/tags/helper_test.rb +86 -0
- data/test/unit/tags/page_datetime_test.rb +50 -0
- data/test/unit/tags/page_file_test.rb +119 -0
- data/test/unit/tags/page_files_test.rb +113 -0
- data/test/unit/tags/page_integer_test.rb +49 -0
- data/test/unit/tags/page_markdown_test.rb +48 -0
- data/test/unit/tags/page_rich_text_test.rb +49 -0
- data/test/unit/tags/page_string_test.rb +49 -0
- data/test/unit/tags/page_text_test.rb +52 -0
- data/test/unit/tags/partial_test.rb +76 -0
- data/test/unit/tags/snippet_test.rb +45 -0
- data/test/unit/view_methods_test.rb +80 -0
- metadata +457 -0
@@ -0,0 +1,492 @@
|
|
1
|
+
!function($, wysi) {
|
2
|
+
"use strict";
|
3
|
+
|
4
|
+
var tpl = {
|
5
|
+
"font-styles": function(locale, options) {
|
6
|
+
var size = (options && options.size) ? ' btn-'+options.size : '';
|
7
|
+
return "<li class='dropdown'>" +
|
8
|
+
"<a class='btn dropdown-toggle" + size + "' data-toggle='dropdown' href='#'>" +
|
9
|
+
"<i class='icon-font'></i> <span class='current-font'>" + locale.font_styles.normal + "</span> <b class='caret'></b>" +
|
10
|
+
"</a>" +
|
11
|
+
"<ul class='dropdown-menu'>" +
|
12
|
+
"<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='div' tabindex='-1'>" + locale.font_styles.normal + "</a></li>" +
|
13
|
+
"<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h1' tabindex='-1'>" + locale.font_styles.h1 + "</a></li>" +
|
14
|
+
"<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h2' tabindex='-1'>" + locale.font_styles.h2 + "</a></li>" +
|
15
|
+
"<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h3' tabindex='-1'>" + locale.font_styles.h3 + "</a></li>" +
|
16
|
+
"</ul>" +
|
17
|
+
"</li>";
|
18
|
+
},
|
19
|
+
|
20
|
+
"emphasis": function(locale, options) {
|
21
|
+
var size = (options && options.size) ? ' btn-'+options.size : '';
|
22
|
+
return "<li>" +
|
23
|
+
"<div class='btn-group'>" +
|
24
|
+
"<a class='btn" + size + "' data-wysihtml5-command='bold' title='CTRL+B' tabindex='-1'>" + locale.emphasis.bold + "</a>" +
|
25
|
+
"<a class='btn" + size + "' data-wysihtml5-command='italic' title='CTRL+I' tabindex='-1'>" + locale.emphasis.italic + "</a>" +
|
26
|
+
"<a class='btn" + size + "' data-wysihtml5-command='underline' title='CTRL+U' tabindex='-1'>" + locale.emphasis.underline + "</a>" +
|
27
|
+
"</div>" +
|
28
|
+
"</li>";
|
29
|
+
},
|
30
|
+
|
31
|
+
"lists": function(locale, options) {
|
32
|
+
var size = (options && options.size) ? ' btn-'+options.size : '';
|
33
|
+
return "<li>" +
|
34
|
+
"<div class='btn-group'>" +
|
35
|
+
"<a class='btn" + size + "' data-wysihtml5-command='insertUnorderedList' title='" + locale.lists.unordered + "' tabindex='-1'><i class='icon-list'></i></a>" +
|
36
|
+
"<a class='btn" + size + "' data-wysihtml5-command='insertOrderedList' title='" + locale.lists.ordered + "' tabindex='-1'><i class='icon-th-list'></i></a>" +
|
37
|
+
"<a class='btn" + size + "' data-wysihtml5-command='Outdent' title='" + locale.lists.outdent + "' tabindex='-1'><i class='icon-indent-right'></i></a>" +
|
38
|
+
"<a class='btn" + size + "' data-wysihtml5-command='Indent' title='" + locale.lists.indent + "' tabindex='-1'><i class='icon-indent-left'></i></a>" +
|
39
|
+
"</div>" +
|
40
|
+
"</li>";
|
41
|
+
},
|
42
|
+
|
43
|
+
"link": function(locale, options) {
|
44
|
+
var size = (options && options.size) ? ' btn-'+options.size : '';
|
45
|
+
return "<li>" +
|
46
|
+
"<div class='bootstrap-wysihtml5-insert-link-modal modal hide fade'>" +
|
47
|
+
"<div class='modal-header'>" +
|
48
|
+
"<a class='close' data-dismiss='modal'>×</a>" +
|
49
|
+
"<h3>" + locale.link.insert + "</h3>" +
|
50
|
+
"</div>" +
|
51
|
+
"<div class='modal-body'>" +
|
52
|
+
"<input value='http://' class='bootstrap-wysihtml5-insert-link-url input-xlarge'>" +
|
53
|
+
"</div>" +
|
54
|
+
"<div class='modal-footer'>" +
|
55
|
+
"<a href='#' class='btn' data-dismiss='modal'>" + locale.link.cancel + "</a>" +
|
56
|
+
"<a href='#' class='btn btn-primary' data-dismiss='modal'>" + locale.link.insert + "</a>" +
|
57
|
+
"</div>" +
|
58
|
+
"</div>" +
|
59
|
+
"<a class='btn" + size + "' data-wysihtml5-command='createLink' title='" + locale.link.insert + "' tabindex='-1'><i class='icon-share'></i></a>" +
|
60
|
+
"</li>";
|
61
|
+
},
|
62
|
+
|
63
|
+
"image": function(locale, options) {
|
64
|
+
var size = (options && options.size) ? ' btn-'+options.size : '';
|
65
|
+
return "<li>" +
|
66
|
+
"<div class='bootstrap-wysihtml5-insert-image-modal modal hide fade'>" +
|
67
|
+
"<div class='modal-header'>" +
|
68
|
+
"<a class='close' data-dismiss='modal'>×</a>" +
|
69
|
+
"<h3>" + locale.image.insert + "</h3>" +
|
70
|
+
"</div>" +
|
71
|
+
"<div class='modal-body'>" +
|
72
|
+
"<input value='http://' class='bootstrap-wysihtml5-insert-image-url input-xlarge'>" +
|
73
|
+
"</div>" +
|
74
|
+
"<div class='modal-footer'>" +
|
75
|
+
"<a href='#' class='btn' data-dismiss='modal'>" + locale.image.cancel + "</a>" +
|
76
|
+
"<a href='#' class='btn btn-primary' data-dismiss='modal'>" + locale.image.insert + "</a>" +
|
77
|
+
"</div>" +
|
78
|
+
"</div>" +
|
79
|
+
"<a class='btn" + size + "' data-wysihtml5-command='insertImage' title='" + locale.image.insert + "' tabindex='-1'><i class='icon-picture'></i></a>" +
|
80
|
+
"</li>";
|
81
|
+
},
|
82
|
+
|
83
|
+
"html": function(locale, options) {
|
84
|
+
var size = (options && options.size) ? ' btn-'+options.size : '';
|
85
|
+
return "<li>" +
|
86
|
+
"<div class='btn-group'>" +
|
87
|
+
"<a class='btn" + size + "' data-wysihtml5-action='change_view' title='" + locale.html.edit + "' tabindex='-1'><i class='icon-pencil'></i></a>" +
|
88
|
+
"</div>" +
|
89
|
+
"</li>";
|
90
|
+
},
|
91
|
+
|
92
|
+
"color": function(locale, options) {
|
93
|
+
var size = (options && options.size) ? ' btn-'+options.size : '';
|
94
|
+
return "<li class='dropdown'>" +
|
95
|
+
"<a class='btn dropdown-toggle" + size + "' data-toggle='dropdown' href='#' tabindex='-1'>" +
|
96
|
+
"<span class='current-color'>" + locale.colours.black + "</span> <b class='caret'></b>" +
|
97
|
+
"</a>" +
|
98
|
+
"<ul class='dropdown-menu'>" +
|
99
|
+
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='black'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='black'>" + locale.colours.black + "</a></li>" +
|
100
|
+
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='silver'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='silver'>" + locale.colours.silver + "</a></li>" +
|
101
|
+
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='gray'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='gray'>" + locale.colours.gray + "</a></li>" +
|
102
|
+
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='maroon'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='maroon'>" + locale.colours.maroon + "</a></li>" +
|
103
|
+
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='red'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='red'>" + locale.colours.red + "</a></li>" +
|
104
|
+
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='purple'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='purple'>" + locale.colours.purple + "</a></li>" +
|
105
|
+
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='green'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='green'>" + locale.colours.green + "</a></li>" +
|
106
|
+
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='olive'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='olive'>" + locale.colours.olive + "</a></li>" +
|
107
|
+
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='navy'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='navy'>" + locale.colours.navy + "</a></li>" +
|
108
|
+
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='blue'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='blue'>" + locale.colours.blue + "</a></li>" +
|
109
|
+
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='orange'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='orange'>" + locale.colours.orange + "</a></li>" +
|
110
|
+
"</ul>" +
|
111
|
+
"</li>";
|
112
|
+
}
|
113
|
+
};
|
114
|
+
|
115
|
+
var templates = function(key, locale, options) {
|
116
|
+
return tpl[key](locale, options);
|
117
|
+
};
|
118
|
+
|
119
|
+
|
120
|
+
var Wysihtml5 = function(el, options) {
|
121
|
+
this.el = el;
|
122
|
+
var toolbarOpts = options || defaultOptions;
|
123
|
+
for(var t in toolbarOpts.customTemplates) {
|
124
|
+
tpl[t] = toolbarOpts.customTemplates[t];
|
125
|
+
}
|
126
|
+
this.toolbar = this.createToolbar(el, toolbarOpts);
|
127
|
+
this.editor = this.createEditor(options);
|
128
|
+
|
129
|
+
window.editor = this.editor;
|
130
|
+
|
131
|
+
$('iframe.wysihtml5-sandbox').each(function(i, el){
|
132
|
+
$(el.contentWindow).off('focus.wysihtml5').on({
|
133
|
+
'focus.wysihtml5' : function(){
|
134
|
+
$('li.dropdown').removeClass('open');
|
135
|
+
}
|
136
|
+
});
|
137
|
+
});
|
138
|
+
};
|
139
|
+
|
140
|
+
Wysihtml5.prototype = {
|
141
|
+
|
142
|
+
constructor: Wysihtml5,
|
143
|
+
|
144
|
+
createEditor: function(options) {
|
145
|
+
options = options || {};
|
146
|
+
options.toolbar = this.toolbar[0];
|
147
|
+
|
148
|
+
var editor = new wysi.Editor(this.el[0], options);
|
149
|
+
|
150
|
+
if(options && options.events) {
|
151
|
+
for(var eventName in options.events) {
|
152
|
+
editor.on(eventName, options.events[eventName]);
|
153
|
+
}
|
154
|
+
}
|
155
|
+
return editor;
|
156
|
+
},
|
157
|
+
|
158
|
+
createToolbar: function(el, options) {
|
159
|
+
var self = this;
|
160
|
+
var toolbar = $("<ul/>", {
|
161
|
+
'class' : "wysihtml5-toolbar",
|
162
|
+
'style': "display:none"
|
163
|
+
});
|
164
|
+
var culture = options.locale || defaultOptions.locale || "en";
|
165
|
+
for(var key in defaultOptions) {
|
166
|
+
var value = false;
|
167
|
+
|
168
|
+
if(options[key] !== undefined) {
|
169
|
+
if(options[key] === true) {
|
170
|
+
value = true;
|
171
|
+
}
|
172
|
+
} else {
|
173
|
+
value = defaultOptions[key];
|
174
|
+
}
|
175
|
+
|
176
|
+
if(value === true) {
|
177
|
+
toolbar.append(templates(key, locale[culture], options));
|
178
|
+
|
179
|
+
if(key === "html") {
|
180
|
+
this.initHtml(toolbar);
|
181
|
+
}
|
182
|
+
|
183
|
+
if(key === "link") {
|
184
|
+
this.initInsertLink(toolbar);
|
185
|
+
}
|
186
|
+
|
187
|
+
if(key === "image") {
|
188
|
+
this.initInsertImage(toolbar);
|
189
|
+
}
|
190
|
+
}
|
191
|
+
}
|
192
|
+
|
193
|
+
if(options.toolbar) {
|
194
|
+
for(key in options.toolbar) {
|
195
|
+
toolbar.append(options.toolbar[key]);
|
196
|
+
}
|
197
|
+
}
|
198
|
+
|
199
|
+
toolbar.find("a[data-wysihtml5-command='formatBlock']").click(function(e) {
|
200
|
+
var target = e.target || e.srcElement;
|
201
|
+
var el = $(target);
|
202
|
+
self.toolbar.find('.current-font').text(el.html());
|
203
|
+
});
|
204
|
+
|
205
|
+
toolbar.find("a[data-wysihtml5-command='foreColor']").click(function(e) {
|
206
|
+
var target = e.target || e.srcElement;
|
207
|
+
var el = $(target);
|
208
|
+
self.toolbar.find('.current-color').text(el.html());
|
209
|
+
});
|
210
|
+
|
211
|
+
this.el.before(toolbar);
|
212
|
+
|
213
|
+
return toolbar;
|
214
|
+
},
|
215
|
+
|
216
|
+
initHtml: function(toolbar) {
|
217
|
+
var changeViewSelector = "a[data-wysihtml5-action='change_view']";
|
218
|
+
toolbar.find(changeViewSelector).click(function(e) {
|
219
|
+
toolbar.find('a.btn').not(changeViewSelector).toggleClass('disabled');
|
220
|
+
});
|
221
|
+
},
|
222
|
+
|
223
|
+
initInsertImage: function(toolbar) {
|
224
|
+
var self = this;
|
225
|
+
var insertImageModal = toolbar.find('.bootstrap-wysihtml5-insert-image-modal');
|
226
|
+
var urlInput = insertImageModal.find('.bootstrap-wysihtml5-insert-image-url');
|
227
|
+
var insertButton = insertImageModal.find('a.btn-primary');
|
228
|
+
var initialValue = urlInput.val();
|
229
|
+
var caretBookmark;
|
230
|
+
|
231
|
+
var insertImage = function() {
|
232
|
+
var url = urlInput.val();
|
233
|
+
urlInput.val(initialValue);
|
234
|
+
self.editor.currentView.element.focus();
|
235
|
+
if (caretBookmark) {
|
236
|
+
self.editor.composer.selection.setBookmark(caretBookmark);
|
237
|
+
caretBookmark = null;
|
238
|
+
}
|
239
|
+
self.editor.composer.commands.exec("insertImage", url);
|
240
|
+
};
|
241
|
+
|
242
|
+
urlInput.keypress(function(e) {
|
243
|
+
if(e.which == 13) {
|
244
|
+
insertImage();
|
245
|
+
insertImageModal.modal('hide');
|
246
|
+
}
|
247
|
+
});
|
248
|
+
|
249
|
+
insertButton.click(insertImage);
|
250
|
+
|
251
|
+
insertImageModal.on('shown', function() {
|
252
|
+
urlInput.focus();
|
253
|
+
});
|
254
|
+
|
255
|
+
insertImageModal.on('hide', function() {
|
256
|
+
self.editor.currentView.element.focus();
|
257
|
+
});
|
258
|
+
|
259
|
+
toolbar.find('a[data-wysihtml5-command=insertImage]').click(function() {
|
260
|
+
var activeButton = $(this).hasClass("wysihtml5-command-active");
|
261
|
+
|
262
|
+
if (!activeButton) {
|
263
|
+
self.editor.currentView.element.focus(false);
|
264
|
+
caretBookmark = self.editor.composer.selection.getBookmark();
|
265
|
+
insertImageModal.modal('show');
|
266
|
+
insertImageModal.on('click.dismiss.modal', '[data-dismiss="modal"]', function(e) {
|
267
|
+
e.stopPropagation();
|
268
|
+
});
|
269
|
+
return false;
|
270
|
+
}
|
271
|
+
else {
|
272
|
+
return true;
|
273
|
+
}
|
274
|
+
});
|
275
|
+
},
|
276
|
+
|
277
|
+
initInsertLink: function(toolbar) {
|
278
|
+
var self = this;
|
279
|
+
var insertLinkModal = toolbar.find('.bootstrap-wysihtml5-insert-link-modal');
|
280
|
+
var urlInput = insertLinkModal.find('.bootstrap-wysihtml5-insert-link-url');
|
281
|
+
var insertButton = insertLinkModal.find('a.btn-primary');
|
282
|
+
var initialValue = urlInput.val();
|
283
|
+
var caretBookmark;
|
284
|
+
|
285
|
+
var insertLink = function() {
|
286
|
+
var url = urlInput.val();
|
287
|
+
urlInput.val(initialValue);
|
288
|
+
self.editor.currentView.element.focus();
|
289
|
+
if (caretBookmark) {
|
290
|
+
self.editor.composer.selection.setBookmark(caretBookmark);
|
291
|
+
caretBookmark = null;
|
292
|
+
}
|
293
|
+
self.editor.composer.commands.exec("createLink", {
|
294
|
+
href: url,
|
295
|
+
target: "_blank",
|
296
|
+
rel: "nofollow"
|
297
|
+
});
|
298
|
+
};
|
299
|
+
var pressedEnter = false;
|
300
|
+
|
301
|
+
urlInput.keypress(function(e) {
|
302
|
+
if(e.which == 13) {
|
303
|
+
insertLink();
|
304
|
+
insertLinkModal.modal('hide');
|
305
|
+
}
|
306
|
+
});
|
307
|
+
|
308
|
+
insertButton.click(insertLink);
|
309
|
+
|
310
|
+
insertLinkModal.on('shown', function() {
|
311
|
+
urlInput.focus();
|
312
|
+
});
|
313
|
+
|
314
|
+
insertLinkModal.on('hide', function() {
|
315
|
+
self.editor.currentView.element.focus();
|
316
|
+
});
|
317
|
+
|
318
|
+
toolbar.find('a[data-wysihtml5-command=createLink]').click(function() {
|
319
|
+
var activeButton = $(this).hasClass("wysihtml5-command-active");
|
320
|
+
|
321
|
+
if (!activeButton) {
|
322
|
+
self.editor.currentView.element.focus(false);
|
323
|
+
caretBookmark = self.editor.composer.selection.getBookmark();
|
324
|
+
insertLinkModal.appendTo('body').modal('show');
|
325
|
+
insertLinkModal.on('click.dismiss.modal', '[data-dismiss="modal"]', function(e) {
|
326
|
+
e.stopPropagation();
|
327
|
+
});
|
328
|
+
return false;
|
329
|
+
}
|
330
|
+
else {
|
331
|
+
return true;
|
332
|
+
}
|
333
|
+
});
|
334
|
+
}
|
335
|
+
};
|
336
|
+
|
337
|
+
// these define our public api
|
338
|
+
var methods = {
|
339
|
+
resetDefaults: function() {
|
340
|
+
$.fn.wysihtml5.defaultOptions = $.extend(true, {}, $.fn.wysihtml5.defaultOptionsCache);
|
341
|
+
},
|
342
|
+
bypassDefaults: function(options) {
|
343
|
+
return this.each(function () {
|
344
|
+
var $this = $(this);
|
345
|
+
$this.data('wysihtml5', new Wysihtml5($this, options));
|
346
|
+
});
|
347
|
+
},
|
348
|
+
shallowExtend: function (options) {
|
349
|
+
var settings = $.extend({}, $.fn.wysihtml5.defaultOptions, options || {});
|
350
|
+
var that = this;
|
351
|
+
return methods.bypassDefaults.apply(that, [settings]);
|
352
|
+
},
|
353
|
+
deepExtend: function(options) {
|
354
|
+
var settings = $.extend(true, {}, $.fn.wysihtml5.defaultOptions, options || {});
|
355
|
+
var that = this;
|
356
|
+
return methods.bypassDefaults.apply(that, [settings]);
|
357
|
+
},
|
358
|
+
init: function(options) {
|
359
|
+
var that = this;
|
360
|
+
return methods.shallowExtend.apply(that, [options]);
|
361
|
+
}
|
362
|
+
};
|
363
|
+
|
364
|
+
$.fn.wysihtml5 = function ( method ) {
|
365
|
+
if ( methods[method] ) {
|
366
|
+
return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
|
367
|
+
} else if ( typeof method === 'object' || ! method ) {
|
368
|
+
return methods.init.apply( this, arguments );
|
369
|
+
} else {
|
370
|
+
$.error( 'Method ' + method + ' does not exist on jQuery.wysihtml5' );
|
371
|
+
}
|
372
|
+
};
|
373
|
+
|
374
|
+
$.fn.wysihtml5.Constructor = Wysihtml5;
|
375
|
+
|
376
|
+
var defaultOptions = $.fn.wysihtml5.defaultOptions = {
|
377
|
+
"font-styles": true,
|
378
|
+
"color": false,
|
379
|
+
"emphasis": true,
|
380
|
+
"lists": true,
|
381
|
+
"html": false,
|
382
|
+
"link": true,
|
383
|
+
"image": true,
|
384
|
+
events: {},
|
385
|
+
parserRules: {
|
386
|
+
classes: {
|
387
|
+
// (path_to_project/lib/css/wysiwyg-color.css)
|
388
|
+
"wysiwyg-color-silver" : 1,
|
389
|
+
"wysiwyg-color-gray" : 1,
|
390
|
+
"wysiwyg-color-white" : 1,
|
391
|
+
"wysiwyg-color-maroon" : 1,
|
392
|
+
"wysiwyg-color-red" : 1,
|
393
|
+
"wysiwyg-color-purple" : 1,
|
394
|
+
"wysiwyg-color-fuchsia" : 1,
|
395
|
+
"wysiwyg-color-green" : 1,
|
396
|
+
"wysiwyg-color-lime" : 1,
|
397
|
+
"wysiwyg-color-olive" : 1,
|
398
|
+
"wysiwyg-color-yellow" : 1,
|
399
|
+
"wysiwyg-color-navy" : 1,
|
400
|
+
"wysiwyg-color-blue" : 1,
|
401
|
+
"wysiwyg-color-teal" : 1,
|
402
|
+
"wysiwyg-color-aqua" : 1,
|
403
|
+
"wysiwyg-color-orange" : 1
|
404
|
+
},
|
405
|
+
tags: {
|
406
|
+
"b": {},
|
407
|
+
"i": {},
|
408
|
+
"br": {},
|
409
|
+
"ol": {},
|
410
|
+
"ul": {},
|
411
|
+
"li": {},
|
412
|
+
"h1": {},
|
413
|
+
"h2": {},
|
414
|
+
"h3": {},
|
415
|
+
"blockquote": {},
|
416
|
+
"u": 1,
|
417
|
+
"img": {
|
418
|
+
"check_attributes": {
|
419
|
+
"width": "numbers",
|
420
|
+
"alt": "alt",
|
421
|
+
"src": "url",
|
422
|
+
"height": "numbers"
|
423
|
+
}
|
424
|
+
},
|
425
|
+
"a": {
|
426
|
+
set_attributes: {
|
427
|
+
target: "_blank",
|
428
|
+
rel: "nofollow"
|
429
|
+
},
|
430
|
+
check_attributes: {
|
431
|
+
href: "url" // important to avoid XSS
|
432
|
+
}
|
433
|
+
},
|
434
|
+
"span": 1,
|
435
|
+
"div": 1
|
436
|
+
}
|
437
|
+
},
|
438
|
+
stylesheets: ["./lib/css/wysiwyg-color.css"], // (path_to_project/lib/css/wysiwyg-color.css)
|
439
|
+
locale: "en"
|
440
|
+
};
|
441
|
+
|
442
|
+
if (typeof $.fn.wysihtml5.defaultOptionsCache === 'undefined') {
|
443
|
+
$.fn.wysihtml5.defaultOptionsCache = $.extend(true, {}, $.fn.wysihtml5.defaultOptions);
|
444
|
+
}
|
445
|
+
|
446
|
+
var locale = $.fn.wysihtml5.locale = {
|
447
|
+
en: {
|
448
|
+
font_styles: {
|
449
|
+
normal: "Normal text",
|
450
|
+
h1: "Heading 1",
|
451
|
+
h2: "Heading 2",
|
452
|
+
h3: "Heading 3"
|
453
|
+
},
|
454
|
+
emphasis: {
|
455
|
+
bold: "Bold",
|
456
|
+
italic: "Italic",
|
457
|
+
underline: "Underline"
|
458
|
+
},
|
459
|
+
lists: {
|
460
|
+
unordered: "Unordered list",
|
461
|
+
ordered: "Ordered list",
|
462
|
+
outdent: "Outdent",
|
463
|
+
indent: "Indent"
|
464
|
+
},
|
465
|
+
link: {
|
466
|
+
insert: "Insert link",
|
467
|
+
cancel: "Cancel"
|
468
|
+
},
|
469
|
+
image: {
|
470
|
+
insert: "Insert image",
|
471
|
+
cancel: "Cancel"
|
472
|
+
},
|
473
|
+
html: {
|
474
|
+
edit: "Edit HTML"
|
475
|
+
},
|
476
|
+
colours: {
|
477
|
+
black: "Black",
|
478
|
+
silver: "Silver",
|
479
|
+
gray: "Grey",
|
480
|
+
maroon: "Maroon",
|
481
|
+
red: "Red",
|
482
|
+
purple: "Purple",
|
483
|
+
green: "Green",
|
484
|
+
olive: "Olive",
|
485
|
+
navy: "Navy",
|
486
|
+
blue: "Blue",
|
487
|
+
orange: "Orange"
|
488
|
+
}
|
489
|
+
}
|
490
|
+
};
|
491
|
+
|
492
|
+
}(window.jQuery, window.wysihtml5);
|
@@ -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(e){"use strict";e(function(){e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.alert.data-api",t,n.prototype.close)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},getActiveIndex:function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},to:function(t){var n=this.getActiveIndex(),r=this;if(t>this.$items.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){r.to(t)}):n==t?this.pause().cycle():this.slide(t>n?"next":"prev",e(this.$items[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle()),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(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f;this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u](),f=e.Event("slide",{relatedTarget:i[0],direction:o});if(i.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var t=e(a.$indicators.children()[a.getActiveIndex()]);t&&t.addClass("active")}));if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.pause().cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=e.extend({},i.data(),n.data()),o;i.carousel(s),(o=n.attr("data-slide-to"))&&i.data("carousel").pause().to(o).cycle(),t.preventDefault()})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning||this.$element.hasClass("in"))return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning||!this.$element.hasClass("in"))return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=e.extend({},e.fn.collapse.defaults,r.data(),typeof n=="object"&&n);i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})}(window.jQuery),!function(e){"use strict";function r(){e(t).each(function(){i(e(this)).removeClass("open")})}function i(t){var n=t.attr("data-target"),r;n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=n&&e(n);if(!r||!r.length)r=t.parent();return r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||s.toggleClass("open"),n.focus(),!1},keydown:function(n){var r,s,o,u,a,f;if(!/(38|40|27)/.test(n.keyCode))return;r=e(this),n.preventDefault(),n.stopPropagation();if(r.is(".disabled, :disabled"))return;u=i(r),a=u.hasClass("open");if(!a||a&&n.keyCode==27)return n.which==27&&u.find(t).focus(),r.click();s=e("[role=menu] li:not(.divider):visible a",u);if(!s.length)return;f=s.index(s.filter(":focus")),n.keyCode==38&&f>0&&f--,n.keyCode==40&&f<s.length-1&&f++,~f||(f=0),s.eq(f).focus()}};var s=e.fn.dropdown;e.fn.dropdown=function(t){return this.each(function(){var r=e(this),i=r.data("dropdown");i||r.data("dropdown",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.dropdown.Constructor=n,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=s,this},e(document).on("click.dropdown.data-api",r).on("click.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on(".dropdown-menu",function(e){e.stopPropagation()}).on("click.dropdown.data-api",t,n.prototype.toggle).on("keydown.dropdown.data-api",t+", [role=menu]",n.prototype.keydown)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")})},hide:function(t){t&&t.preventDefault();var n=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var t=this;e(document).on("focusin.modal",function(e){t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){t.which==27&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},hideModal:function(){var e=this;this.$element.hide(),this.backdrop(function(){e.removeBackdrop(),e.$element.trigger("hidden")})},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="modal-backdrop '+r+'" />').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?e.proxy(this.$element[0].focus,this.$element[0]):e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,t):t()):t&&t()}};var n=e.fn.modal;e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})})}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s,o,u,a;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,o=this.options.trigger.split(" ");for(a=o.length;a--;)u=o[a],u=="click"?this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this)):u!="manual"&&(i=u=="hover"?"mouseenter":"focus",s=u=="hover"?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.leave,this)));this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);if(!n.options.delay||!n.options.delay.show)return n.show();clearTimeout(this.timeout),n.hoverState="in",this.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var t,n,r,i,s,o,u=e.Event("show");if(this.hasContent()&&this.enabled){this.$element.trigger(u);if(u.isDefaultPrevented())return;t=this.tip(),this.setContent(),this.options.animation&&t.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement,t.detach().css({top:0,left:0,display:"block"}),this.options.container?t.appendTo(this.options.container):t.insertAfter(this.$element),n=this.getPosition(),r=t[0].offsetWidth,i=t[0].offsetHeight;switch(s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}this.applyPlacement(o,s),this.$element.trigger("shown")}},applyPlacement:function(e,t){var n=this.tip(),r=n[0].offsetWidth,i=n[0].offsetHeight,s,o,u,a;n.offset(e).addClass(t).addClass("in"),s=n[0].offsetWidth,o=n[0].offsetHeight,t=="top"&&o!=i&&(e.top=e.top+i-o,a=!0),t=="bottom"||t=="top"?(u=0,e.left<0&&(u=e.left*-2,e.left=0,n.offset(e),s=n[0].offsetWidth,o=n[0].offsetHeight),this.replaceArrow(u-r+s,s,"left")):this.replaceArrow(o-i,o,"top"),a&&n.offset(e)},replaceArrow:function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function i(){var t=setTimeout(function(){n.off(e.support.transition.end).detach()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.detach()})}var t=this,n=this.tip(),r=e.Event("hide");this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?i():n.detach(),this.$element.trigger("hidden"),this},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},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(t){var n=t?e(t.currentTarget)[this.type](this._options).data(this.type):this;n.tip().hasClass("in")?n.hide():n.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=(typeof n.content=="function"?n.content.call(t[0]):n.content)||t.attr("data-content"),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(window.jQuery),!function(e){"use strict";function t(t,n){var r=e.proxy(this.process,this),i=e(t).is("body")?e(window):e(t),s;this.options=e.extend({},e.fn.scrollspy.defaults,n),this.$scrollElement=i.on("scroll.scroll-spy.data-api",r),this.selector=(this.options.target||(s=e(t).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=e("body"),this.refresh(),this.process()}t.prototype={constructor:t,refresh:function(){var t=this,n;this.offsets=e([]),this.targets=e([]),n=this.$body.find(this.selector).map(function(){var n=e(this),r=n.data("target")||n.attr("href"),i=/^#\w/.test(r)&&e(r);return i&&i.length&&[[i.position().top+(!e.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),r]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},process:function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=t-this.$scrollElement.height(),r=this.offsets,i=this.targets,s=this.activeTarget,o;if(e>=n)return s!=(o=i.last()[0])&&this.activate(o);for(o=r.length;o--;)s!=i[o]&&e>=r[o]&&(!r[o+1]||e<=r[o+1])&&this.activate(i[o])},activate:function(t){var n,r;this.activeTarget=t,e(this.selector).parent(".active").removeClass("active"),r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',n=e(r).parent("li").addClass("active"),n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate")}};var n=e.fn.scrollspy;e.fn.scrollspy=function(n){return this.each(function(){var r=e(this),i=r.data("scrollspy"),s=typeof n=="object"&&n;i||r.data("scrollspy",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.defaults={offset:10},e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=n,this},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active:last a")[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.typeahead.defaults,n),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.$menu=e(this.options.menu),this.shown=!1,this.listen()};t.prototype={constructor:t,select:function(){var e=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(e)).change(),this.hide()},updater:function(e){return e},show:function(){var t=e.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:t.top+t.height,left:t.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var n;return this.query=this.$element.val(),!this.query||this.query.length<this.options.minLength?this.shown?this.hide():this:(n=e.isFunction(this.source)?this.source(this.query,e.proxy(this.process,this)):this.source,n?this.process(n):this)},process:function(t){var n=this;return t=e.grep(t,function(e){return n.matcher(e)}),t=this.sorter(t),t.length?this.render(t.slice(0,this.options.items)).show():this.shown?this.hide():this},matcher:function(e){return~e.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(e){var t=[],n=[],r=[],i;while(i=e.shift())i.toLowerCase().indexOf(this.query.toLowerCase())?~i.indexOf(this.query)?n.push(i):r.push(i):t.push(i);return t.concat(n,r)},highlighter:function(e){var t=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return e.replace(new RegExp("("+t+")","ig"),function(e,t){return"<strong>"+t+"</strong>"})},render:function(t){var n=this;return t=e(t).map(function(t,r){return t=e(n.options.item).attr("data-value",r),t.find("a").html(n.highlighter(r)),t[0]}),t.first().addClass("active"),this.$menu.html(t),this},next:function(t){var n=this.$menu.find(".active").removeClass("active"),r=n.next();r.length||(r=e(this.$menu.find("li")[0])),r.addClass("active")},prev:function(e){var t=this.$menu.find(".active").removeClass("active"),n=t.prev();n.length||(n=this.$menu.find("li").last()),n.addClass("active")},listen:function(){this.$element.on("focus",e.proxy(this.focus,this)).on("blur",e.proxy(this.blur,this)).on("keypress",e.proxy(this.keypress,this)).on("keyup",e.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",e.proxy(this.keydown,this)),this.$menu.on("click",e.proxy(this.click,this)).on("mouseenter","li",e.proxy(this.mouseenter,this)).on("mouseleave","li",e.proxy(this.mouseleave,this))},eventSupported:function(e){var t=e in this.$element;return t||(this.$element.setAttribute(e,"return;"),t=typeof this.$element[e]=="function"),t},move:function(e){if(!this.shown)return;switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()},keydown:function(t){this.suppressKeyPressRepeat=~e.inArray(t.keyCode,[40,38,9,13,27]),this.move(t)},keypress:function(e){if(this.suppressKeyPressRepeat)return;this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},focus:function(e){this.focused=!0},blur:function(e){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(e){e.stopPropagation(),e.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(t){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),e(t.currentTarget).addClass("active")},mouseleave:function(e){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var n=e.fn.typeahead;e.fn.typeahead=function(n){return this.each(function(){var r=e(this),i=r.data("typeahead"),s=typeof n=="object"&&n;i||r.data("typeahead",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>',minLength:1},e.fn.typeahead.Constructor=t,e.fn.typeahead.noConflict=function(){return e.fn.typeahead=n,this},e(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var n=e(this);if(n.data("typeahead"))return;n.typeahead(n.data())})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=e.extend({},e.fn.affix.defaults,n),this.$window=e(window).on("scroll.affix.data-api",e.proxy(this.checkPosition,this)).on("click.affix.data-api",e.proxy(function(){setTimeout(e.proxy(this.checkPosition,this),1)},this)),this.$element=e(t),this.checkPosition()};t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.bottom,o=i.top,u="affix affix-top affix-bottom",a;typeof i!="object"&&(s=o=i),typeof o=="function"&&(o=i.top()),typeof s=="function"&&(s=i.bottom()),a=this.unpin!=null&&n+this.unpin<=r.top?!1:s!=null&&r.top+this.$element.height()>=t-s?"bottom":o!=null&&n<=o?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))};var n=e.fn.affix;e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("affix"),s=typeof n=="object"&&n;i||r.data("affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.defaults={offset:0},e.fn.affix.noConflict=function(){return e.fn.affix=n,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery);
|