roroacms 0.0.6.9 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +20 -20
- data/Gemfile +14 -14
- data/Gemfile.lock +207 -207
- data/MIT-LICENSE +20 -20
- data/README.md +61 -62
- data/Rakefile +19 -19
- data/app/assets/javascripts/roroacms/admin/admin.js +95 -95
- data/app/assets/javascripts/roroacms/admin/application.js +8 -8
- data/app/assets/javascripts/roroacms/admin/menu.js +135 -135
- data/app/assets/javascripts/roroacms/admin/posts/posts.js +69 -69
- data/app/assets/javascripts/roroacms/admin/roroacms-tour.js +48 -48
- data/app/assets/javascripts/roroacms/admin/settings/settings.js +27 -27
- data/app/assets/javascripts/roroacms/admin/site.js +289 -289
- data/app/assets/javascripts/roroacms/application.js +9 -9
- data/app/assets/javascripts/roroacms/vendor/bootstrap/js/bootstrap.min.js +5 -5
- data/app/assets/javascripts/roroacms/vendor/chosen/chosen.jquery.min.js +1211 -1211
- data/app/assets/javascripts/roroacms/vendor/datatables/js/datatables.bootstrap.js +250 -250
- data/app/assets/javascripts/roroacms/vendor/datatables/js/jquery.datatables.js +150 -150
- data/app/assets/javascripts/roroacms/vendor/ghostdown/ghostdown.js +6425 -6425
- data/app/assets/javascripts/roroacms/vendor/ghostdown/jquery.ghostdown.js +88 -88
- data/app/assets/javascripts/roroacms/vendor/hopscotch.js +2409 -2409
- data/app/assets/javascripts/roroacms/vendor/html5shiv.js +8 -8
- data/app/assets/javascripts/roroacms/vendor/icheck/js/icheck.min.js +219 -219
- data/app/assets/javascripts/roroacms/vendor/jquery/jquery-1.10.2.min.js +6 -6
- data/app/assets/javascripts/roroacms/vendor/jquery/jquery-ui-1.10.4.min.js +6 -6
- data/app/assets/javascripts/roroacms/vendor/jquery/modernizr-2.6.2.min.js +4 -4
- data/app/assets/javascripts/roroacms/vendor/respond.min.js +4 -4
- data/app/assets/stylesheets/roroacms/admin/application.css +5 -5
- data/app/assets/stylesheets/roroacms/admin/main.css.scss +3676 -3676
- data/app/assets/stylesheets/roroacms/vendor/animate.css +2724 -2724
- data/app/assets/stylesheets/roroacms/vendor/bootstrap/css/bootstrap.min.css +6 -6
- data/app/assets/stylesheets/roroacms/vendor/chosen/chosen.css.erb +365 -365
- data/app/assets/stylesheets/roroacms/vendor/datatables/css/dataTables.css +226 -226
- data/app/assets/stylesheets/roroacms/vendor/ghostdown.css +584 -584
- data/app/assets/stylesheets/roroacms/vendor/hopscotch.css +464 -464
- data/app/assets/stylesheets/roroacms/vendor/icheck/css/_all.css.erb +559 -559
- data/app/assets/stylesheets/roroacms/vendor/icheck/css/grey.css.erb +55 -55
- data/app/assets/stylesheets/roroacms/vendor/jquery/jquery-ui.css +1177 -1177
- data/app/assets/stylesheets/roroacms/vendor/typeahead.css +182 -182
- data/app/controllers/roroacms/admin/administrators_controller.rb +149 -149
- data/app/controllers/roroacms/admin/articles_controller.rb +169 -169
- data/app/controllers/roroacms/admin/comments_controller.rb +103 -103
- data/app/controllers/roroacms/admin/dashboard_controller.rb +11 -11
- data/app/controllers/roroacms/admin/menus_controller.rb +90 -90
- data/app/controllers/roroacms/admin/pages_controller.rb +137 -137
- data/app/controllers/roroacms/admin/revisions_controller.rb +39 -39
- data/app/controllers/roroacms/admin/settings_controller.rb +72 -72
- data/app/controllers/roroacms/admin/terms_controller.rb +140 -140
- data/app/controllers/roroacms/admin/themes_controller.rb +45 -45
- data/app/controllers/roroacms/admin/trash_controller.rb +56 -56
- data/app/controllers/roroacms/admin_controller.rb +64 -64
- data/app/controllers/roroacms/application_controller.rb +154 -154
- data/app/controllers/roroacms/comments_controller.rb +42 -42
- data/app/controllers/roroacms/pages_controller.rb +55 -55
- data/app/controllers/roroacms/setup_controller.rb +104 -104
- data/app/helpers/roroacms/admin_menu_helper.rb +110 -110
- data/app/helpers/roroacms/admin_roroa_helper.rb +355 -355
- data/app/helpers/roroacms/admin_ui_helper.rb +22 -22
- data/app/helpers/roroacms/admin_view_helper.rb +24 -24
- data/app/helpers/roroacms/application_helper.rb +4 -4
- data/app/helpers/roroacms/comments_helper.rb +39 -39
- data/app/helpers/roroacms/general_helper.rb +144 -144
- data/app/helpers/roroacms/media_helper.rb +44 -44
- data/app/helpers/roroacms/menu_helper.rb +183 -183
- data/app/helpers/roroacms/prepcontent_helper.rb +27 -27
- data/app/helpers/roroacms/routing_helper.rb +392 -392
- data/app/helpers/roroacms/seo_helper.rb +257 -257
- data/app/helpers/roroacms/theme_helper.rb +6 -6
- data/app/helpers/roroacms/view_helper.rb +1229 -1229
- data/app/mailers/roroacms/emailer.rb +31 -31
- data/app/models/roroacms/admin.rb +86 -86
- data/app/models/roroacms/comment.rb +83 -83
- data/app/models/roroacms/menu.rb +18 -18
- data/app/models/roroacms/menu_option.rb +41 -41
- data/app/models/roroacms/post.rb +380 -380
- data/app/models/roroacms/setting.rb +190 -190
- data/app/models/roroacms/term.rb +157 -157
- data/app/models/roroacms/term_anatomy.rb +8 -8
- data/app/models/roroacms/term_relationship.rb +9 -9
- data/app/models/roroacms/trash.rb +67 -67
- data/app/views/devise/confirmations/new.html.erb +11 -11
- data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -5
- data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -8
- data/app/views/devise/mailer/unlock_instructions.html.erb +6 -6
- data/app/views/devise/passwords/edit.html.erb +33 -33
- data/app/views/devise/passwords/new.html.erb +22 -22
- data/app/views/devise/registrations/edit.html.erb +24 -24
- data/app/views/devise/registrations/new.html.erb +17 -17
- data/app/views/devise/sessions/new.html.erb +42 -42
- data/app/views/devise/shared/_links.erb +12 -12
- data/app/views/devise/unlocks/new.html.erb +11 -11
- data/app/views/layouts/roroacms/admin.html.erb +172 -172
- data/app/views/layouts/roroacms/login.html.erb +35 -35
- data/app/views/layouts/roroacms/setup.html.erb +36 -36
- data/app/views/roroacms/admin/administrators/_form.html.erb +135 -135
- data/app/views/roroacms/admin/administrators/edit.html.erb +5 -5
- data/app/views/roroacms/admin/administrators/index.html.erb +59 -59
- data/app/views/roroacms/admin/administrators/new.html.erb +5 -5
- data/app/views/roroacms/admin/articles/edit.html.erb +8 -8
- data/app/views/roroacms/admin/articles/index.html.erb +14 -14
- data/app/views/roroacms/admin/articles/new.html.erb +7 -7
- data/app/views/roroacms/admin/comments/_form.html.erb +89 -89
- data/app/views/roroacms/admin/comments/edit.html.erb +24 -24
- data/app/views/roroacms/admin/comments/index.html.erb +78 -78
- data/app/views/roroacms/admin/dashboard/index.html.erb +144 -144
- data/app/views/roroacms/admin/menus/_menu_form.html.erb +31 -31
- data/app/views/roroacms/admin/menus/_menu_list.html.erb +2 -2
- data/app/views/roroacms/admin/menus/edit.html.erb +29 -29
- data/app/views/roroacms/admin/menus/index.html.erb +42 -42
- data/app/views/roroacms/admin/menus/partials/_menu_content_accordion.html.erb +70 -70
- data/app/views/roroacms/admin/menus/partials/_menu_custom_accordion.html.erb +39 -39
- data/app/views/roroacms/admin/menus/partials/_menu_dropdown.html.erb +49 -49
- data/app/views/roroacms/admin/menus/partials/_menu_list_loop.html.erb +64 -64
- data/app/views/roroacms/admin/menus/partials/_menu_menu_groups.html.erb +18 -18
- data/app/views/roroacms/admin/pages/edit.html.erb +6 -6
- data/app/views/roroacms/admin/pages/index.html.erb +15 -15
- data/app/views/roroacms/admin/pages/new.html.erb +7 -7
- data/app/views/roroacms/admin/partials/_admin_comment.html.erb +18 -18
- data/app/views/roroacms/admin/partials/_append_sidebar_menu.html.erb +51 -51
- data/app/views/roroacms/admin/partials/_articles_table.html.erb +46 -46
- data/app/views/roroacms/admin/partials/_bulk_update_dropdown.html.erb +35 -35
- data/app/views/roroacms/admin/partials/_comment.html.erb +18 -18
- data/app/views/roroacms/admin/partials/_content_form.html.erb +316 -316
- data/app/views/roroacms/admin/partials/_cover_image.html.erb +12 -12
- data/app/views/roroacms/admin/partials/_editor.html.erb +21 -21
- data/app/views/roroacms/admin/partials/_markdown_modal.html.erb +57 -57
- data/app/views/roroacms/admin/partials/_pages_table.html.erb +25 -25
- data/app/views/roroacms/admin/partials/_post_additional_data_view.html.erb +7 -7
- data/app/views/roroacms/admin/partials/_revision_tree.html.erb +78 -78
- data/app/views/roroacms/admin/partials/_submit_bar.html.erb +30 -30
- data/app/views/roroacms/admin/partials/_table_header.html.erb +14 -14
- data/app/views/roroacms/admin/partials/_table_row.html.erb +34 -34
- data/app/views/roroacms/admin/partials/_term_table_row.html.erb +22 -22
- data/app/views/roroacms/admin/partials/_user_group_view.html.erb +19 -19
- data/app/views/roroacms/admin/revisions/_autosave_table.html.erb +36 -36
- data/app/views/roroacms/admin/revisions/edit.html.erb +91 -91
- data/app/views/roroacms/admin/settings/index.html.erb +398 -398
- data/app/views/roroacms/admin/terms/_form.html.erb +50 -50
- data/app/views/roroacms/admin/terms/_table.html.erb +21 -21
- data/app/views/roroacms/admin/terms/edit.html.erb +49 -49
- data/app/views/roroacms/admin/terms/view.html.erb +31 -31
- data/app/views/roroacms/admin/themes/index.html.erb +81 -81
- data/app/views/roroacms/admin/trash/index.html.erb +110 -110
- data/app/views/roroacms/devise/confirmations/new.html.erb +11 -11
- data/app/views/roroacms/devise/mailer/confirmation_instructions.html.erb +5 -5
- data/app/views/roroacms/devise/mailer/reset_password_instructions.html.erb +8 -8
- data/app/views/roroacms/devise/mailer/unlock_instructions.html.erb +6 -6
- data/app/views/roroacms/devise/passwords/edit.html.erb +33 -33
- data/app/views/roroacms/devise/passwords/new.html.erb +22 -22
- data/app/views/roroacms/devise/registrations/edit.html.erb +24 -24
- data/app/views/roroacms/devise/registrations/new.html.erb +17 -17
- data/app/views/roroacms/devise/sessions/new.html.erb +39 -39
- data/app/views/roroacms/devise/shared/_links.erb +12 -12
- data/app/views/roroacms/devise/unlocks/new.html.erb +11 -11
- data/app/views/roroacms/emailer/comment.html.erb +13 -13
- data/app/views/roroacms/emailer/comment.text.erb +12 -12
- data/app/views/roroacms/emailer/profile.html.erb +5 -5
- data/app/views/roroacms/emailer/profile.text.erb +5 -5
- data/app/views/roroacms/setup/_theme.html.erb +61 -61
- data/app/views/roroacms/setup/administrator.html.erb +72 -72
- data/app/views/roroacms/setup/index.html.erb +116 -116
- data/bin/rails +12 -12
- data/config/initializers/devise.rb +258 -258
- data/config/locales/devise.en.yml +115 -115
- data/config/routes.rb +96 -96
- data/db/migrate/20140801203556_add_admins.rb +44 -44
- data/db/migrate/20140802084604_add_roroacms_comments.rb +31 -31
- data/db/migrate/20140802084615_add_roroacms_menu_options.rb +24 -24
- data/db/migrate/20140802084624_add_roroacms_menus.rb +18 -18
- data/db/migrate/20140802084631_add_roroacms_posts.rb +42 -42
- data/db/migrate/20140802084638_add_roroacms_settings.rb +21 -21
- data/db/migrate/20140802084658_add_roroacms_term_anatomies.rb +20 -20
- data/db/migrate/20140802084707_add_roroacms_term_relationships.rb +23 -23
- data/db/migrate/20140802084717_add_roroacms_terms.rb +27 -27
- data/db/seeds.rb +60 -60
- data/lib/ext/string.rb +4 -4
- data/lib/generators/roroacms/install_generator.rb +16 -16
- data/lib/roroacms/engine.rb +83 -84
- data/lib/roroacms/version.rb +3 -3
- data/lib/roroacms.rb +5 -5
- data/lib/tasks/roroacms_tasks.rake +9 -9
- data/spec/controllers/roroacms/admin/administrators_controller_spec.rb +136 -0
- data/spec/controllers/roroacms/admin/articles_controller_spec.rb +135 -0
- data/spec/controllers/roroacms/admin/comments_controller_spec.rb +123 -0
- data/spec/controllers/roroacms/admin/dashboard_controller_spec.rb +24 -0
- data/spec/controllers/roroacms/admin/menus_controller_spec.rb +103 -0
- data/spec/controllers/roroacms/admin/pages_controller_spec.rb +163 -0
- data/spec/controllers/roroacms/admin/revisions_controller_spec.rb +44 -0
- data/spec/controllers/roroacms/admin/settings_controller_spec.rb +75 -0
- data/spec/controllers/roroacms/admin/terms_controller_spec.rb +177 -0
- data/spec/controllers/roroacms/admin/themes_controller_spec.rb +57 -0
- data/spec/controllers/roroacms/admin/trash_controller_spec.rb +62 -0
- data/spec/controllers/roroacms/comments_controller_spec.rb +24 -0
- data/spec/controllers/roroacms/pages_controller_spec.rb +34 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/images/.keep +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +1 -0
- data/spec/dummy/app/assets/stylesheets/application.css +1 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/controllers/concerns/.keep +0 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/helpers/theme_helper.rb +13 -0
- data/spec/dummy/app/mailers/.keep +0 -0
- data/spec/dummy/app/models/.keep +0 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/_sidebar.html.erb +33 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/archive.html.erb +60 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/article.html.erb +38 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/assets/font/glyphicons-halflings-regular.eot +0 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/assets/font/glyphicons-halflings-regular.svg +229 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/assets/font/glyphicons-halflings-regular.ttf +0 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/assets/font/glyphicons-halflings-regular.woff +0 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/assets/javascripts/roroacms-bs3-theme.js +17 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/assets/javascripts/theme.js +4 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/assets/javascripts/vendor/bootstrap.min.js +6 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/assets/stylesheets/roroacms-bs3-theme.css +222 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/assets/stylesheets/theme.css +4 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/assets/stylesheets/vendor/bootstrap.min.css +7 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/category.html.erb +66 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/comments_form.html.erb +43 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/error_404.html.erb +6 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/footer.html.erb +81 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/header.html.erb +129 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/home.html.erb +23 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/layout.html.erb +5 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/page.html.erb +27 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/search.html.erb +33 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/search_form.html.erb +9 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/template-contact.html.erb +81 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/theme.yml +6 -0
- data/spec/dummy/app/views/theme/roroa-bootstrap-3/theme_helper.rb +9 -0
- data/spec/dummy/app/views/theme/roroa1/_sidebar.html.erb +18 -0
- data/spec/dummy/app/views/theme/roroa1/archive.html.erb +33 -0
- data/spec/dummy/app/views/theme/roroa1/article.html.erb +23 -0
- data/spec/dummy/app/views/theme/roroa1/assets/javascripts/roroa-standard.js.coffee +10 -0
- data/spec/dummy/app/views/theme/roroa1/assets/javascripts/theme.js +1 -0
- data/spec/dummy/app/views/theme/roroa1/assets/stylesheets/style.css.scss +884 -0
- data/spec/dummy/app/views/theme/roroa1/assets/stylesheets/theme.css +3 -0
- data/spec/dummy/app/views/theme/roroa1/category.html.erb +37 -0
- data/spec/dummy/app/views/theme/roroa1/comments_form.html.erb +61 -0
- data/spec/dummy/app/views/theme/roroa1/error_404.html.erb +4 -0
- data/spec/dummy/app/views/theme/roroa1/home.html.erb +25 -0
- data/spec/dummy/app/views/theme/roroa1/layout.html.erb +95 -0
- data/spec/dummy/app/views/theme/roroa1/page.html.erb +7 -0
- data/spec/dummy/app/views/theme/roroa1/search.html.erb +31 -0
- data/spec/dummy/app/views/theme/roroa1/search_form.html.erb +6 -0
- data/spec/dummy/app/views/theme/roroa1/template-contact.html.erb +125 -0
- data/spec/dummy/app/views/theme/roroa1/template-news.html.erb +1 -0
- data/spec/dummy/app/views/theme/roroa1/theme.yml +5 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config/application.rb +23 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +8 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +82 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/assets.rb +8 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +149 -0
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/log/.keep +0 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/javascripts/translations.js +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/01b0bb90f5966d00bf38cc2e4c6dc61c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/01c4f566937fc1135c9aac08aaed1d7f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/02ac78c2224882185ca7d2180a010a02 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/02dd9be3b289f56169f00da8d6e8cb63 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/044f18e425557a4db28813e3d413b2ac +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/062c6b6c1fd8cc4dec9482e22b8bf15e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0671a937a155d760eb50f0a4673b361e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/075f916e73522805629055d0ebc0a96f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/07c31f29bd114c516fec34c12e23040b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/07df29267aa56c3d60701d02593b42fe +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/07ed3087294a5538008469d14dad37ec +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0915aabdb5273fb452531154011b1530 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/096998b34babf611dd1fd30affcce1f8 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0a959d1d6d5addc548e6a7d72cda5513 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0aa0cf2c509791fae370e676145661e9 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0b82858a45f9840a67e62c589b49a30b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0c31dca9d5a7fe6fa13975f398bf6755 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0c7ddb3a4e6bd5f58621aafa9d8b268c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0ccfaad24ef387850a25da694a32fdeb +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0d014c14229f4e6af12b9f5214c2c900 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0d2c92577a98a55e84279cf35fa47154 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0f1a8d8cb2d347d2c43e167b6e8dd772 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0f7739cbdf17c178ed8302927ab6f91a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0fd906d894053aa32d20273d272914a6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/108902bac7ebd1b233ad72bff14a3c6e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/117c1540c942b9a30221507b7b545ac7 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/120699e4b9a291742d32cc3f1d54a1c0 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/12823874e85d7f4b0d0f24e75b6a606f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/12d4f50804f6b2e95ae22d6240d5f251 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/14a07aa21f4b662c3a00906bb7fd96a1 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/16246104f8ae735f81f309dff662f6ac +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/170c2bd9dd32f95b5ff94772e3046435 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/175f517f3f99a11bea98f1b106cbad3e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/182f982bc1069c944b0768c5fb8e70e8 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/189afb43eebc6790a343d47e099b5b3b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/18f00a43e59b4caf8cab8002225abb16 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/19cc7d516e9c5c945152a00c520652a7 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1a49195845de370bd0390b666bf63002 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1aabd6297701193c87b371bb28423093 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1ad4574bbfb58c18cf27bde856cfb8e6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1bbda697ecdf1dab2d9857c246167e61 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1c8fd5c201d2c1c04f0dfa7f84406549 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1e13b0d0d3273c81783675257ae416a5 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1ecda2df373750075af958a84e177443 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1ed030685f785031c518b9c084d2c562 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/20a8ce6b001e3f5e000d83b03c39973a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/22a1b56f54d66c951d0414589ae7e592 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/22b316eb2ae844d2aa5b3d56609e7134 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/23979d8c8de077d9c5aca204af6d1cae +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2405f0ab32bb68958749badf5c0c5ab2 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/24507a849b1f6f49e4d80806a2ae8f7f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2611a6793dffe5cf691fc66ef8a1d96f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2649e6f5622aa342a69fa0c56058f50e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/266a1d6eaa1096958f5220dcd72fa818 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/28257287bdb69e9da885553af4d784fd +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/283ae16090ef393308b47b6eac68a78d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2855a662a410acf5b8341d18ea08ad09 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/29027878740c3347a585de84e2468cec +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/29b612a243d57e996aa25e6bd55c3ae0 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2a1ca299203dc52bfd48e9e990234288 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2a3ef4fee1ead82a2e020bd01e0f9492 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2b31fdf797816a4d7eeb501882522245 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2d14fddff832dffcfdc6b7c16543a37a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2d57904662e5b6b51010d683ea36f3aa +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2ed37822c6f252a1bb9a2a4186d51b80 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2ed54505fb85c659a5d40fd42fdb8c82 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2f7814e3b44a611d9cc5ba4838783cec +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2f95938c43835c0d255c4d98c85130a2 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2ffa1a843006a5e108eb823936fc4b8d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/30c74df35467423ca4f594c50ca972cb +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/31de52bfeb25a36a638e82c1d44b6110 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/32189e4bb4be3499e1154394fe5fa5cf +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/3316f6752e709d7a6eb5a3781fced097 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/33177563a7306549dc9684f9348ae6c6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/34fac393d91ac96fad0606d7d210212c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/354bc78e74a0ae625ed0173f96ad5356 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/35ab8dc5331965047a6a48cfebf03234 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/36264cd973b91fad389f3a7e83d358df +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/3633cb5a540f9da590a8be6b659357d9 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/363ec8b1e6c0e4e28147577cd9aa1767 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/36899e053ce425269daeefbc24afde74 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/374a7e699349c3747ad0eb80df319ee5 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/3792de44b7ef5883097d33bd02bb66a7 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/37a02dc6a0d71db376ca89c53f25713b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/385067d2a8c69821fc305178e1abec5d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/389b05cb7df2beb5f9f7f7ae2983276a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/39e74d6deb67d83562723310a49d2343 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/3d7a543a402dfe7a63a4d4dfc2f02e35 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/3dac43d31d5e2baae0882a187f995373 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/3df24cb6966ced6c31468ea144303cba +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/3e9e1f77164027e372eab31e44bd792e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/402809273e09d12a0d961e96277c93ff +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/40dcda7ab7c26916df1b499cf472b036 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/415a7735417367ba5c89a10bda3c3664 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/42875948b15702a8e6423bfcd55eb397 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4361292ee0e8da4ffba6417b67d107d7 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4416c7d372391892156a3ad7e796eea2 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/44aff36650b10dfc65996edc7c5ba786 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/45f19765f78bbeaf456e3e85d8eeaeea +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/460c01975695d2221ebfe45345c66c14 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/474d3d268fe31fa85b9ad6a702106f89 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4818258c6899deb650e9b7a11472a5cb +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/485ba245fdff299bc3993a1dfae69830 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/48f01ff4ef7bc5f6389a2481742a32cc +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/490efd99068b27bb2660dd5f97822f75 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/49bc81ab46512983d6c99fe5ee89c87a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4a0b8c669e9c663a5d7a6fe73bf92961 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4aef0c0538c834078e6d8537889cc2a1 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4af8affa02b9ecd9051258755d4be60a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4b5d082bdfae4f56c090f7c10cb6647d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4b6f1eca9b2c126af3c3790129ba15e6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4beeeb189ce51371e4edc7569eb4a53a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4c86f80454f717e7151747beb022d61d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4cffdc29cdafdcdf76ae764312573579 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4d26f6579d12e4f1d3c79fba613933fb +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4e13d96aef7929980b0c503756cc0c6b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4f5ca293a17dc427299d712706be99d6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4f6e11155789e81497dc94d22a2c9db8 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4f829c2dffc45c149adee4cd1b35f23b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5132d2c56e2db02645975ee877d5ecb9 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/579cf218fbfa8b52dd892d7f9c39c65e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/57a51996827da8be33316d6e513c1856 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/581344a3bce36221a1fc5ee9d507cb78 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/58f64a672004610fe63c125f3cd8fe7d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/596d21a0e4b0e82491dd946147d0b509 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5ac8aaa5bee9489bc446a774e2e646b9 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5b79b1a35f5118fe38011ca429634834 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5c8ebcef7b93c3061021528083a680c6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5cb8219e4c1db70267fb2a88ba7b599f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5d5b525c2315ad3fd4711a7ca14b9cc2 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5d6d4e3b38e87b2de5b9b9b4b2fddf53 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5de859ea92a0f8d5b1cf81233ff541ce +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5df45e879827bae35f9c0af1d89d3484 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5ea7acc2a017fb91990f70b1c94413b5 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5ef3f544813f934df08810f79021eecb +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5f52bb9c53ea90254f76b8d305b70373 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5f58ba12a115846181d5932f8ebe1108 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5f8bf71cbb460285f2151bac01ea7481 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/6095811354e7dc1babcb682c0fdfd69e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/60be3ded1b6e36fb0c87316b38156ae2 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/622cbabaed3da4fff5fab28bbcf32bed +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/6250be42273c14b0aad242da2150d901 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/631f072a6df346c42e13a97388ae3156 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/634081a34eeeb1ff0f78e8a8cabcf12c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/64563ba9a277596542f2bf4558a991e4 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/65c1cea3dc9ac48c3fd086462bb01d43 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/65caafdf3d25c108b8c44d7c616745d1 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/674bfd6d5bf888941166039a3e65eb72 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/675dcab958bbfb0582a7113840bbe35d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/68a9f70d3be10ed9f50de29a1e300d27 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/696323f68df35557d1dc046a9dbf1a81 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/699417eba3487c8f71acd9d596662606 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/699787446bc5facff1e55d8f4b31221f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/69a29b2ad8cdf192be64b3c3f8b77d8c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/69cf4fd612d34478f8065d84838e982c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/6a9320eaa769c69aaae2231ba2f82fb6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/6aab73cf49337b2782e983900ad3a3ab +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/6affc41afde1d2df6ba129053c1babcd +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/6bcfde2d65e4e5d1903a5936de95a86e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/6c927972735d32feb6ed10e7ef1f894e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/6ca2d6d64a82723279eccd56b81e6755 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/6d7dfd8665840288a937f61efa149aed +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/6e01bdf2376fcd0c30a6a79058c1e504 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/6e9c00de1c41fdc6467ef2dadc20c591 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/6f2c9037f8ccf7c2a4bca6a25fb598b9 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7066aee6f2d50aa1675ee592a4c336ba +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7084e05e641b381bfff47c554afec2da +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/71d7f12a2022920f7a2a28dbdff79019 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/723bcf3e6983a0559b9e0be394f10c01 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/724781877ef4c3636943c3610499bf87 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/73a26df4a7d7bdc16b247ccfade6121a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/74340e2a21288361b5df1465dea4cc1f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/74cc560b7e7c5a745659ec08176b13c5 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7507fec5587acab83f4625979da7c58b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/754e347f3d36e2977fd81db154e80602 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/75eb11c26a539bb390644b542a59a231 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/76cd0ec15ae2bbfa35a9f78bef162b83 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7709ff603668ddf82318669448ae5364 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/77190fb71aee455df365832e249ff2bd +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/77e6403a2258ce2966c037bc05d3d35f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/78210e807010563b375b608f20ccefa1 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/78f00a860f4c5ded036af4761397352d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/79a104fd39f788070c7d9add71efa32c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/79b65d2d7b7bab646f6c393bd9703bc3 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/79bab032f54eb5a98a68a8bc06b57822 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7a4c12dd007420226c0bc78951585006 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7aeeee63a3e1037db68405ac86e30a4f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7b2bf6a64d27177512054df06580f092 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7cbd90392269c732b318fc901d004f43 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7cd7c56a479baddf925e01aec7848a4c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7cf77ddd2975dd6830a4880fb1fc1dbe +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7def427cd79eb67621a05b2d5ad64a61 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7e5b5fd06d5df24ebb2221f640358492 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7f7f0e62735d0c01e2e3203eb47c2c3f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7fbff98235e61aaf8d4b230dd31e9c25 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7fdf03e57d42dfff59c41760e67fa65e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/80b092dfcd9313068d17c057182f71bd +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/80c2f11f8bad645b74798a955ca8e89c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/81c527c170a21781457f6cea4e7b27ce +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/81f727984d6b9c602f2b0932f06ebe25 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/81f9c4e9d09403395a2e9d809b10fc1a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/8224aeb6f917522433c9f3d235d83fd1 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/83f5fffe46a2a0b83ef4b6efbe951083 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/84961945b1044869ca1248d1828de33a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/85684bab4511b98c766527cf9f03acd2 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/85b350459ae7cc9bd89e9b8d52a61b75 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/8601c7a96bd24a6af87741abd57e5e94 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/86d499f85b615bdfa95f9f976f8ea3ad +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/8704d0a0e9f0ff5e5a2aa2eea9f14a5f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/87c4b682fff94bf74e6b1438033b7c60 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/88327adbd46a84276cfb290bbdb7dca3 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/88eae1724e3694d2070c7155ea3021cc +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/89becf26df10662c7cab4b1adcdce227 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/8c696e0458f6923f2458d7a44ad21211 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/8f49105e73394ed3b12e18d79f7a4ff6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/9146fcb24656f70dfb5c4d8a0461a473 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/9155c28c949a5bdfe776bf620dbc6dc3 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/91b1792019998f509e7965b8fa75c378 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/91c9b223dfe8a224fb6b451a51eb63dd +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/9232fe8335151d85d1a8aad7c8c0524b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/9304a78db8748cd47489295ed4843152 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/93845737b6f58a77e524653ce5d6926b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/948e894982cb58176b6ee43037ccf460 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/99002a27f7d6702b0ae6da7da7036dc6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/99354d91c97da4d779f609eb9935b8fe +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/9a37f19ccd71116845a63ff439dd5bf4 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/9b38afb533f8d22148e93931754162c5 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/9c358f08b8672c0d2fd6db7a16ed6c2b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/9c3f89f42447b0c2bdc921ec9317fb38 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/9d56b3e3616119ca42b546e0fb96b7c8 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/9e120a10db5fa35fd3c421f933ebd01a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/9f6baf784711e665ea8352685be3676b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/9fe740ce6c837b3418e0972324ffdb7b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a1d664104b57e68ca75daa681364b1e4 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a1e099d69cea07186941a247f24a23e7 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a319221d824e8f5b647c0b5a6203a67d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a3ace8e3eb3d918414cf185e820e5b8d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a3f16a7b18a62765c0c73c95dc786de8 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a56cdc9b1cc0cd1372a15c410ce15f52 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a58a85a704454cee53c7a15541ed5e6a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a5f93f7d4c4dc37755df8de1011556d6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a5fc7fe296e4ee928bf5454edc9c334b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a6902cd66f93fe0640c6d25ba7bbab74 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a751ef0c349119da69b47d3e8a5411e0 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a7d46bacc8876cb9f26574792a4eb602 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a7fda81a77165684dcaf76b8a5c0d98c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a8d295cec937ed4c43b627c1ec2ee3bf +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a9070b0220974335806b38921350ae6f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/aa04111e924cc573b669237eaa1459a7 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ab1955c741364b51eafef10d828fe3c0 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ab25f25883b53de5ea5aa934233b96fd +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ac5eb83633eca54957093b7eacaed98a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/acf6532dc4556d46cbb143a53c1c9d99 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ad3755af68762ce29bc54dc42b36c7d2 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ad644b75f8c65173f38014035baeac41 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/adc76ee6c343c47fd7d666b54465af8a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/aeb4f87af70343155cc847f44080a197 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/af16c115b782a328caa529dc3d7ca063 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/b01d038005ad822401663f5ec72fa6ef +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/b0ec8166abdcc705333dd67e4f4d2e52 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/b22ac2c9e1f1284a84e42681ced6af62 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/b3a92f2154a373b214e1c134c82aa35a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/b522e8257bebed61822f79ef5b631af5 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/b53c3ca1da3cc97ff2d061205c93f09f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/b53f839c1435533b1f9f096792b75ba2 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/b5679ed21250dca0e0afaccbc4dbea96 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/b79572ce5447929b8752d55866019e5d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ba4cdbcfe8d56a527507346ec0b0aaa8 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/bb82cf918d1f9deb18fd513203e12b65 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/bde0358bf67ceb4b32068fa3c9bfb3b6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/be7e82e0b81f8ffb8f906ab45b453305 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/bea40ce674c3fb117ef21e05fade75b1 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/beabf9e96ebd3323d01ae3a39fb6babc +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/bed9255c41c5b2e5ff029fef9cde0f77 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/bfd9eac23f2a5c80c63c2af546c6ccaa +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/bfdabecefcd035cd13ad6dd39628b98c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c07fbd81375ee01b6e5816e938a7c11b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c10616d9f47b2417f5182868178a348e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c1086ef26030d24fa0820807aa477ea9 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c2862a0368fa4de5e2f7d189f2301cf2 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c2d2edeabc3f4e1488bc3d2bc65aeeb5 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c31de5bdd33cb06b2f048832cc17bb33 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c392b9f02046ab5ac544b4b768d6c873 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c3f6d29f592a6debd961bf7090260a63 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c40f5cd3096b72ead5fbc1bbd3fae161 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c60c7de98dc1644323fe3e1042b9b6f7 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c99a79f0817c71898237ba09de527dee +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c9a9d61d59425108b4b277185175e2a8 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c9b91475983f0835ba45ca2fe35d240d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c9e64896be951cc49773ac83696255d1 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ca142e718b036301f24dac4e3275e9b6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/caf60d972f82c0ee76b650f65b8fdcb1 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cbc2f7b8866f0684266e6ad2e7a30352 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cbd483d17ac0184f48a8509c18f979b7 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cc721a188ab3d7e83b31a1f04b713426 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cc914eaa2dce30f7d476190bd890061e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ce6b662fdbe7682b43ddc78b3b9cad70 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ce9ed001e3d4f0735c213877e8a81df2 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ceaf1a9beac2d5eeb6d34f1ec3b4ba18 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cee893d2db4350453a50c4e9ca1d232f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cf6435acb846ab2d7c5fa87f58813ebd +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d065c115c2649e84ceda18a5424c6a19 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d07e71e2ceaa8385c55f2d3b8fbf07b3 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d152ac74ddbbe9d32933a12ddfdde296 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d169f1441cbbc3af7e89e80362df3e76 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d1b84034e0429b81de91ed8fc1aaecaf +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d253accae3b846232602bc6c995368f9 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d3104281c8b0826ddc1ac16ebcabf6d5 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d3f00f999f8970016ac14a517904a010 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d41a28273f01863d778343769f561a15 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d46338cdeab8149426f52310289fce9f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d51f7e1dd8a079a07dca6b54555b0619 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d7168a34b2c50ddfedd98542037fa67e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d72b5c6c396050709ed7a61795624bcf +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d8d0ad6c27cfbaf3dc08f4b89c943aee +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/da00d054a700ca1243a14fe7ed80f957 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/db5a3f247b11ff272a640ca13b7e4282 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/dbe16788dcd2defa93482f68099b0d93 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/dce3bb78b49b624e0ef121de61c90eb5 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/dcf33d27a8bc879ea6dc1460a6896572 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/dd4661c809be283f24af745cd471fef2 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ddd024b41556433726d54ab75efc4cf6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/de76378a179dbe23a8b6938fecaeaead +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/dec6c0affea84dfd7c9509d3b82cb67a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/df9f17599b8555c7e5f33f3096d0908d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e0b8689ae5bba59b9f14acd1f9f2e2e1 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e1b60cab102fc77a9250c3cec9005f2f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e20b05c5de673581bbaa330f6f5a8e26 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e2bf8a1dcf48c25b3c508c348b77d073 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e33f8e486061b22bb4e64bbda4fd264e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e395be2c63ec3c4d214bbaf44fb03973 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e5357bc5a31b7a2fb6e078aaaa4d913b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e5c14e1961152bd7edd7743b7d623416 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e6433186bf62e32f40d2aa957885e12b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e647b5d9467ba8f6bea35247e2c08f38 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e7a0f449e890f16fe0114f946c3c2e23 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e9512b851cc002cb6564586e198bff22 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ea53643fc53873e31950c304a2dd81bf +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ea7dd58d64f762e53736715fbef1379d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/eaad17bfad25bffeaa285383f55b6683 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/eb6ce605b7a9878f16ce34a3d47043a3 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/eb757c948334f75d17bbf23e8c48ef43 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ebea8f383de1fdfd76ff7f1095ab95ec +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ec65ed1571852474143593894f051fda +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ee379911da706e69963a52263eab4755 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f0c46205ec11714608a5716a6b6867df +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f1161e3366336f110844aee9ed699af6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f12044c9db79b466f15257e01c41932b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f13ba0b59341c6ffd42d680c6d6a57af +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f3c8f45ef41694b747be31b658829a4a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f3dd8a99ff713f718a8a2b197d5dd469 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f471c0922a75832dec078946cb0a1086 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f54740d21191b3939d47b6e87b5d6ef2 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f566a6d534c7e8e6f4cd1e5ca907df2c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f5f4f0999132979f9f325a78e0a6fd47 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f61dc0dc55f73dca2c580f5914074a9a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f6dc9afc56ceced12c16a1f7022d6623 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f702a7d63bc9bbaa4b9da177d4220dfb +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f7f67c6fdf257bb9b675445ad3ca2aca +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/fb942ec0bc8d87080136d1eb2abcfa33 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/fbb623d8d4700f3e7eccae88700e5e73 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/fbee64fb1d31d4687a8068c38ff0889e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/fbfcf6fdc335e01d8f7f0c7a26e9a9fb +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/fc33f62b017026ea2cb55de4fe0786c5 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/fd5afb63c8690c4e0df71ff9498d049f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/fdb60665342a3a54a59aa9b7b77a135b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/fdc31d89f3b051d66029a28b59cc7e63 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/fe0dc53c09ac52e5b9255086e0ffb328 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/fe1e7428179101b62bdf21409049badd +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/fee99bdbec260ac672198e956afd0698 +0 -0
- data/spec/dummy/tmp/cache/i18n-js.yml +36 -0
- data/spec/models/roroacms/admin_spec.rb +67 -0
- data/spec/models/roroacms/comment_spec.rb +76 -0
- data/spec/models/roroacms/menu_spec.rb +17 -0
- data/spec/models/roroacms/post_spec.rb +121 -0
- data/spec/models/roroacms/setting_spec.rb +66 -0
- data/spec/models/roroacms/term_spec.rb +67 -0
- data/spec/models/roroacms/trash_spec.rb +31 -0
- data/spec/requests/roroacms/admin/administration_spec.rb +71 -0
- data/spec/requests/roroacms/admin/article_spec.rb +113 -0
- data/spec/requests/roroacms/admin/comment_spec.rb +85 -0
- data/spec/requests/roroacms/admin/dashboard_spec.rb +55 -0
- data/spec/requests/roroacms/admin/menu_spec.rb +67 -0
- data/spec/requests/roroacms/admin/page_spec.rb +102 -0
- data/spec/requests/roroacms/admin/revision_spec.rb +41 -0
- data/spec/requests/roroacms/admin/setting_spec.rb +113 -0
- data/spec/requests/roroacms/admin/term_spec.rb +194 -0
- data/spec/requests/roroacms/admin/theme_spec.rb +33 -0
- data/spec/requests/roroacms/admin/trash_spec.rb +70 -0
- data/spec/requests/roroacms/pages_spec.rb +28 -0
- data/spec/spec_helper.rb +36 -0
- data/spec/support/devise.rb +3 -0
- data/spec/support/factories.rb +79 -0
- data/spec/support/selectors.rb +5 -0
- data/spec/support/utilities.rb +6 -0
- metadata +1027 -301
@@ -1,1211 +1,1211 @@
|
|
1
|
-
/*!
|
2
|
-
Chosen, a Select Box Enhancer for jQuery and Prototype
|
3
|
-
by Patrick Filler for Harvest, http://getharvest.com
|
4
|
-
|
5
|
-
Version 1.1.0
|
6
|
-
Full source at https://github.com/harvesthq/chosen
|
7
|
-
Copyright (c) 2011 Harvest http://getharvest.com
|
8
|
-
|
9
|
-
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
|
10
|
-
This file is generated by `grunt build`, do not edit it by hand.
|
11
|
-
*/
|
12
|
-
|
13
|
-
(function() {
|
14
|
-
var $, AbstractChosen, Chosen, SelectParser, _ref,
|
15
|
-
__hasProp = {}.hasOwnProperty,
|
16
|
-
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
17
|
-
|
18
|
-
SelectParser = (function() {
|
19
|
-
function SelectParser() {
|
20
|
-
this.options_index = 0;
|
21
|
-
this.parsed = [];
|
22
|
-
}
|
23
|
-
|
24
|
-
SelectParser.prototype.add_node = function(child) {
|
25
|
-
if (child.nodeName.toUpperCase() === "OPTGROUP") {
|
26
|
-
return this.add_group(child);
|
27
|
-
} else {
|
28
|
-
return this.add_option(child);
|
29
|
-
}
|
30
|
-
};
|
31
|
-
|
32
|
-
SelectParser.prototype.add_group = function(group) {
|
33
|
-
var group_position, option, _i, _len, _ref, _results;
|
34
|
-
group_position = this.parsed.length;
|
35
|
-
this.parsed.push({
|
36
|
-
array_index: group_position,
|
37
|
-
group: true,
|
38
|
-
label: this.escapeExpression(group.label),
|
39
|
-
children: 0,
|
40
|
-
disabled: group.disabled
|
41
|
-
});
|
42
|
-
_ref = group.childNodes;
|
43
|
-
_results = [];
|
44
|
-
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
45
|
-
option = _ref[_i];
|
46
|
-
_results.push(this.add_option(option, group_position, group.disabled));
|
47
|
-
}
|
48
|
-
return _results;
|
49
|
-
};
|
50
|
-
|
51
|
-
SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
|
52
|
-
if (option.nodeName.toUpperCase() === "OPTION") {
|
53
|
-
if (option.text !== "") {
|
54
|
-
if (group_position != null) {
|
55
|
-
this.parsed[group_position].children += 1;
|
56
|
-
}
|
57
|
-
this.parsed.push({
|
58
|
-
array_index: this.parsed.length,
|
59
|
-
options_index: this.options_index,
|
60
|
-
value: option.value,
|
61
|
-
text: option.text,
|
62
|
-
html: option.innerHTML,
|
63
|
-
selected: option.selected,
|
64
|
-
disabled: group_disabled === true ? group_disabled : option.disabled,
|
65
|
-
group_array_index: group_position,
|
66
|
-
classes: option.className,
|
67
|
-
style: option.style.cssText
|
68
|
-
});
|
69
|
-
} else {
|
70
|
-
this.parsed.push({
|
71
|
-
array_index: this.parsed.length,
|
72
|
-
options_index: this.options_index,
|
73
|
-
empty: true
|
74
|
-
});
|
75
|
-
}
|
76
|
-
return this.options_index += 1;
|
77
|
-
}
|
78
|
-
};
|
79
|
-
|
80
|
-
SelectParser.prototype.escapeExpression = function(text) {
|
81
|
-
var map, unsafe_chars;
|
82
|
-
if ((text == null) || text === false) {
|
83
|
-
return "";
|
84
|
-
}
|
85
|
-
if (!/[\&\<\>\"\'\`]/.test(text)) {
|
86
|
-
return text;
|
87
|
-
}
|
88
|
-
map = {
|
89
|
-
"<": "<",
|
90
|
-
">": ">",
|
91
|
-
'"': """,
|
92
|
-
"'": "'",
|
93
|
-
"`": "`"
|
94
|
-
};
|
95
|
-
unsafe_chars = /&(?!\w+;)|[\<\>\"\'\`]/g;
|
96
|
-
return text.replace(unsafe_chars, function(chr) {
|
97
|
-
return map[chr] || "&";
|
98
|
-
});
|
99
|
-
};
|
100
|
-
|
101
|
-
return SelectParser;
|
102
|
-
|
103
|
-
})();
|
104
|
-
|
105
|
-
SelectParser.select_to_array = function(select) {
|
106
|
-
var child, parser, _i, _len, _ref;
|
107
|
-
parser = new SelectParser();
|
108
|
-
_ref = select.childNodes;
|
109
|
-
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
110
|
-
child = _ref[_i];
|
111
|
-
parser.add_node(child);
|
112
|
-
}
|
113
|
-
return parser.parsed;
|
114
|
-
};
|
115
|
-
|
116
|
-
AbstractChosen = (function() {
|
117
|
-
function AbstractChosen(form_field, options) {
|
118
|
-
this.form_field = form_field;
|
119
|
-
this.options = options != null ? options : {};
|
120
|
-
if (!AbstractChosen.browser_is_supported()) {
|
121
|
-
return;
|
122
|
-
}
|
123
|
-
this.is_multiple = this.form_field.multiple;
|
124
|
-
this.set_default_text();
|
125
|
-
this.set_default_values();
|
126
|
-
this.setup();
|
127
|
-
this.set_up_html();
|
128
|
-
this.register_observers();
|
129
|
-
}
|
130
|
-
|
131
|
-
AbstractChosen.prototype.set_default_values = function() {
|
132
|
-
var _this = this;
|
133
|
-
this.click_test_action = function(evt) {
|
134
|
-
return _this.test_active_click(evt);
|
135
|
-
};
|
136
|
-
this.activate_action = function(evt) {
|
137
|
-
return _this.activate_field(evt);
|
138
|
-
};
|
139
|
-
this.active_field = false;
|
140
|
-
this.mouse_on_container = false;
|
141
|
-
this.results_showing = false;
|
142
|
-
this.result_highlighted = null;
|
143
|
-
this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
|
144
|
-
this.disable_search_threshold = this.options.disable_search_threshold || 0;
|
145
|
-
this.disable_search = this.options.disable_search || false;
|
146
|
-
this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
|
147
|
-
this.group_search = this.options.group_search != null ? this.options.group_search : true;
|
148
|
-
this.search_contains = this.options.search_contains || false;
|
149
|
-
this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true;
|
150
|
-
this.max_selected_options = this.options.max_selected_options || Infinity;
|
151
|
-
this.inherit_select_classes = this.options.inherit_select_classes || false;
|
152
|
-
this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
|
153
|
-
return this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
|
154
|
-
};
|
155
|
-
|
156
|
-
AbstractChosen.prototype.set_default_text = function() {
|
157
|
-
if (this.form_field.getAttribute("data-placeholder")) {
|
158
|
-
this.default_text = this.form_field.getAttribute("data-placeholder");
|
159
|
-
} else if (this.is_multiple) {
|
160
|
-
this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text;
|
161
|
-
} else {
|
162
|
-
this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;
|
163
|
-
}
|
164
|
-
return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text;
|
165
|
-
};
|
166
|
-
|
167
|
-
AbstractChosen.prototype.mouse_enter = function() {
|
168
|
-
return this.mouse_on_container = true;
|
169
|
-
};
|
170
|
-
|
171
|
-
AbstractChosen.prototype.mouse_leave = function() {
|
172
|
-
return this.mouse_on_container = false;
|
173
|
-
};
|
174
|
-
|
175
|
-
AbstractChosen.prototype.input_focus = function(evt) {
|
176
|
-
var _this = this;
|
177
|
-
if (this.is_multiple) {
|
178
|
-
if (!this.active_field) {
|
179
|
-
return setTimeout((function() {
|
180
|
-
return _this.container_mousedown();
|
181
|
-
}), 50);
|
182
|
-
}
|
183
|
-
} else {
|
184
|
-
if (!this.active_field) {
|
185
|
-
return this.activate_field();
|
186
|
-
}
|
187
|
-
}
|
188
|
-
};
|
189
|
-
|
190
|
-
AbstractChosen.prototype.input_blur = function(evt) {
|
191
|
-
var _this = this;
|
192
|
-
if (!this.mouse_on_container) {
|
193
|
-
this.active_field = false;
|
194
|
-
return setTimeout((function() {
|
195
|
-
return _this.blur_test();
|
196
|
-
}), 100);
|
197
|
-
}
|
198
|
-
};
|
199
|
-
|
200
|
-
AbstractChosen.prototype.results_option_build = function(options) {
|
201
|
-
var content, data, _i, _len, _ref;
|
202
|
-
content = '';
|
203
|
-
_ref = this.results_data;
|
204
|
-
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
205
|
-
data = _ref[_i];
|
206
|
-
if (data.group) {
|
207
|
-
content += this.result_add_group(data);
|
208
|
-
} else {
|
209
|
-
content += this.result_add_option(data);
|
210
|
-
}
|
211
|
-
if (options != null ? options.first : void 0) {
|
212
|
-
if (data.selected && this.is_multiple) {
|
213
|
-
this.choice_build(data);
|
214
|
-
} else if (data.selected && !this.is_multiple) {
|
215
|
-
this.single_set_selected_text(data.text);
|
216
|
-
}
|
217
|
-
}
|
218
|
-
}
|
219
|
-
return content;
|
220
|
-
};
|
221
|
-
|
222
|
-
AbstractChosen.prototype.result_add_option = function(option) {
|
223
|
-
var classes, option_el;
|
224
|
-
if (!option.search_match) {
|
225
|
-
return '';
|
226
|
-
}
|
227
|
-
if (!this.include_option_in_results(option)) {
|
228
|
-
return '';
|
229
|
-
}
|
230
|
-
classes = [];
|
231
|
-
if (!option.disabled && !(option.selected && this.is_multiple)) {
|
232
|
-
classes.push("active-result");
|
233
|
-
}
|
234
|
-
if (option.disabled && !(option.selected && this.is_multiple)) {
|
235
|
-
classes.push("disabled-result");
|
236
|
-
}
|
237
|
-
if (option.selected) {
|
238
|
-
classes.push("result-selected");
|
239
|
-
}
|
240
|
-
if (option.group_array_index != null) {
|
241
|
-
classes.push("group-option");
|
242
|
-
}
|
243
|
-
if (option.classes !== "") {
|
244
|
-
classes.push(option.classes);
|
245
|
-
}
|
246
|
-
option_el = document.createElement("li");
|
247
|
-
option_el.className = classes.join(" ");
|
248
|
-
option_el.style.cssText = option.style;
|
249
|
-
option_el.setAttribute("data-option-array-index", option.array_index);
|
250
|
-
option_el.innerHTML = option.search_text;
|
251
|
-
return this.outerHTML(option_el);
|
252
|
-
};
|
253
|
-
|
254
|
-
AbstractChosen.prototype.result_add_group = function(group) {
|
255
|
-
var group_el;
|
256
|
-
if (!(group.search_match || group.group_match)) {
|
257
|
-
return '';
|
258
|
-
}
|
259
|
-
if (!(group.active_options > 0)) {
|
260
|
-
return '';
|
261
|
-
}
|
262
|
-
group_el = document.createElement("li");
|
263
|
-
group_el.className = "group-result";
|
264
|
-
group_el.innerHTML = group.search_text;
|
265
|
-
return this.outerHTML(group_el);
|
266
|
-
};
|
267
|
-
|
268
|
-
AbstractChosen.prototype.results_update_field = function() {
|
269
|
-
this.set_default_text();
|
270
|
-
if (!this.is_multiple) {
|
271
|
-
this.results_reset_cleanup();
|
272
|
-
}
|
273
|
-
this.result_clear_highlight();
|
274
|
-
this.results_build();
|
275
|
-
if (this.results_showing) {
|
276
|
-
return this.winnow_results();
|
277
|
-
}
|
278
|
-
};
|
279
|
-
|
280
|
-
AbstractChosen.prototype.reset_single_select_options = function() {
|
281
|
-
var result, _i, _len, _ref, _results;
|
282
|
-
_ref = this.results_data;
|
283
|
-
_results = [];
|
284
|
-
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
285
|
-
result = _ref[_i];
|
286
|
-
if (result.selected) {
|
287
|
-
_results.push(result.selected = false);
|
288
|
-
} else {
|
289
|
-
_results.push(void 0);
|
290
|
-
}
|
291
|
-
}
|
292
|
-
return _results;
|
293
|
-
};
|
294
|
-
|
295
|
-
AbstractChosen.prototype.results_toggle = function() {
|
296
|
-
if (this.results_showing) {
|
297
|
-
return this.results_hide();
|
298
|
-
} else {
|
299
|
-
return this.results_show();
|
300
|
-
}
|
301
|
-
};
|
302
|
-
|
303
|
-
AbstractChosen.prototype.results_search = function(evt) {
|
304
|
-
if (this.results_showing) {
|
305
|
-
return this.winnow_results();
|
306
|
-
} else {
|
307
|
-
return this.results_show();
|
308
|
-
}
|
309
|
-
};
|
310
|
-
|
311
|
-
AbstractChosen.prototype.winnow_results = function() {
|
312
|
-
var escapedSearchText, option, regex, regexAnchor, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref;
|
313
|
-
this.no_results_clear();
|
314
|
-
results = 0;
|
315
|
-
searchText = this.get_search_text();
|
316
|
-
escapedSearchText = searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
317
|
-
regexAnchor = this.search_contains ? "" : "^";
|
318
|
-
regex = new RegExp(regexAnchor + escapedSearchText, 'i');
|
319
|
-
zregex = new RegExp(escapedSearchText, 'i');
|
320
|
-
_ref = this.results_data;
|
321
|
-
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
322
|
-
option = _ref[_i];
|
323
|
-
option.search_match = false;
|
324
|
-
results_group = null;
|
325
|
-
if (this.include_option_in_results(option)) {
|
326
|
-
if (option.group) {
|
327
|
-
option.group_match = false;
|
328
|
-
option.active_options = 0;
|
329
|
-
}
|
330
|
-
if ((option.group_array_index != null) && this.results_data[option.group_array_index]) {
|
331
|
-
results_group = this.results_data[option.group_array_index];
|
332
|
-
if (results_group.active_options === 0 && results_group.search_match) {
|
333
|
-
results += 1;
|
334
|
-
}
|
335
|
-
results_group.active_options += 1;
|
336
|
-
}
|
337
|
-
if (!(option.group && !this.group_search)) {
|
338
|
-
option.search_text = option.group ? option.label : option.html;
|
339
|
-
option.search_match = this.search_string_match(option.search_text, regex);
|
340
|
-
if (option.search_match && !option.group) {
|
341
|
-
results += 1;
|
342
|
-
}
|
343
|
-
if (option.search_match) {
|
344
|
-
if (searchText.length) {
|
345
|
-
startpos = option.search_text.search(zregex);
|
346
|
-
text = option.search_text.substr(0, startpos + searchText.length) + '</em>' + option.search_text.substr(startpos + searchText.length);
|
347
|
-
option.search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
|
348
|
-
}
|
349
|
-
if (results_group != null) {
|
350
|
-
results_group.group_match = true;
|
351
|
-
}
|
352
|
-
} else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
|
353
|
-
option.search_match = true;
|
354
|
-
}
|
355
|
-
}
|
356
|
-
}
|
357
|
-
}
|
358
|
-
this.result_clear_highlight();
|
359
|
-
if (results < 1 && searchText.length) {
|
360
|
-
this.update_results_content("");
|
361
|
-
return this.no_results(searchText);
|
362
|
-
} else {
|
363
|
-
this.update_results_content(this.results_option_build());
|
364
|
-
return this.winnow_results_set_highlight();
|
365
|
-
}
|
366
|
-
};
|
367
|
-
|
368
|
-
AbstractChosen.prototype.search_string_match = function(search_string, regex) {
|
369
|
-
var part, parts, _i, _len;
|
370
|
-
if (regex.test(search_string)) {
|
371
|
-
return true;
|
372
|
-
} else if (this.enable_split_word_search && (search_string.indexOf(" ") >= 0 || search_string.indexOf("[") === 0)) {
|
373
|
-
parts = search_string.replace(/\[|\]/g, "").split(" ");
|
374
|
-
if (parts.length) {
|
375
|
-
for (_i = 0, _len = parts.length; _i < _len; _i++) {
|
376
|
-
part = parts[_i];
|
377
|
-
if (regex.test(part)) {
|
378
|
-
return true;
|
379
|
-
}
|
380
|
-
}
|
381
|
-
}
|
382
|
-
}
|
383
|
-
};
|
384
|
-
|
385
|
-
AbstractChosen.prototype.choices_count = function() {
|
386
|
-
var option, _i, _len, _ref;
|
387
|
-
if (this.selected_option_count != null) {
|
388
|
-
return this.selected_option_count;
|
389
|
-
}
|
390
|
-
this.selected_option_count = 0;
|
391
|
-
_ref = this.form_field.options;
|
392
|
-
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
393
|
-
option = _ref[_i];
|
394
|
-
if (option.selected) {
|
395
|
-
this.selected_option_count += 1;
|
396
|
-
}
|
397
|
-
}
|
398
|
-
return this.selected_option_count;
|
399
|
-
};
|
400
|
-
|
401
|
-
AbstractChosen.prototype.choices_click = function(evt) {
|
402
|
-
evt.preventDefault();
|
403
|
-
if (!(this.results_showing || this.is_disabled)) {
|
404
|
-
return this.results_show();
|
405
|
-
}
|
406
|
-
};
|
407
|
-
|
408
|
-
AbstractChosen.prototype.keyup_checker = function(evt) {
|
409
|
-
var stroke, _ref;
|
410
|
-
stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
|
411
|
-
this.search_field_scale();
|
412
|
-
switch (stroke) {
|
413
|
-
case 8:
|
414
|
-
if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
|
415
|
-
return this.keydown_backstroke();
|
416
|
-
} else if (!this.pending_backstroke) {
|
417
|
-
this.result_clear_highlight();
|
418
|
-
return this.results_search();
|
419
|
-
}
|
420
|
-
break;
|
421
|
-
case 13:
|
422
|
-
evt.preventDefault();
|
423
|
-
if (this.results_showing) {
|
424
|
-
return this.result_select(evt);
|
425
|
-
}
|
426
|
-
break;
|
427
|
-
case 27:
|
428
|
-
if (this.results_showing) {
|
429
|
-
this.results_hide();
|
430
|
-
}
|
431
|
-
return true;
|
432
|
-
case 9:
|
433
|
-
case 38:
|
434
|
-
case 40:
|
435
|
-
case 16:
|
436
|
-
case 91:
|
437
|
-
case 17:
|
438
|
-
break;
|
439
|
-
default:
|
440
|
-
return this.results_search();
|
441
|
-
}
|
442
|
-
};
|
443
|
-
|
444
|
-
AbstractChosen.prototype.clipboard_event_checker = function(evt) {
|
445
|
-
var _this = this;
|
446
|
-
return setTimeout((function() {
|
447
|
-
return _this.results_search();
|
448
|
-
}), 50);
|
449
|
-
};
|
450
|
-
|
451
|
-
AbstractChosen.prototype.container_width = function() {
|
452
|
-
if (this.options.width != null) {
|
453
|
-
return this.options.width;
|
454
|
-
} else {
|
455
|
-
return "" + this.form_field.offsetWidth + "px";
|
456
|
-
}
|
457
|
-
};
|
458
|
-
|
459
|
-
AbstractChosen.prototype.include_option_in_results = function(option) {
|
460
|
-
if (this.is_multiple && (!this.display_selected_options && option.selected)) {
|
461
|
-
return false;
|
462
|
-
}
|
463
|
-
if (!this.display_disabled_options && option.disabled) {
|
464
|
-
return false;
|
465
|
-
}
|
466
|
-
if (option.empty) {
|
467
|
-
return false;
|
468
|
-
}
|
469
|
-
return true;
|
470
|
-
};
|
471
|
-
|
472
|
-
AbstractChosen.prototype.search_results_touchstart = function(evt) {
|
473
|
-
this.touch_started = true;
|
474
|
-
return this.search_results_mouseover(evt);
|
475
|
-
};
|
476
|
-
|
477
|
-
AbstractChosen.prototype.search_results_touchmove = function(evt) {
|
478
|
-
this.touch_started = false;
|
479
|
-
return this.search_results_mouseout(evt);
|
480
|
-
};
|
481
|
-
|
482
|
-
AbstractChosen.prototype.search_results_touchend = function(evt) {
|
483
|
-
if (this.touch_started) {
|
484
|
-
return this.search_results_mouseup(evt);
|
485
|
-
}
|
486
|
-
};
|
487
|
-
|
488
|
-
AbstractChosen.prototype.outerHTML = function(element) {
|
489
|
-
var tmp;
|
490
|
-
if (element.outerHTML) {
|
491
|
-
return element.outerHTML;
|
492
|
-
}
|
493
|
-
tmp = document.createElement("div");
|
494
|
-
tmp.appendChild(element);
|
495
|
-
return tmp.innerHTML;
|
496
|
-
};
|
497
|
-
|
498
|
-
AbstractChosen.browser_is_supported = function() {
|
499
|
-
if (window.navigator.appName === "Microsoft Internet Explorer") {
|
500
|
-
return document.documentMode >= 8;
|
501
|
-
}
|
502
|
-
if (/iP(od|hone)/i.test(window.navigator.userAgent)) {
|
503
|
-
return false;
|
504
|
-
}
|
505
|
-
if (/Android/i.test(window.navigator.userAgent)) {
|
506
|
-
if (/Mobile/i.test(window.navigator.userAgent)) {
|
507
|
-
return false;
|
508
|
-
}
|
509
|
-
}
|
510
|
-
return true;
|
511
|
-
};
|
512
|
-
|
513
|
-
AbstractChosen.default_multiple_text = "Select Some Options";
|
514
|
-
|
515
|
-
AbstractChosen.default_single_text = "Select an Option";
|
516
|
-
|
517
|
-
AbstractChosen.default_no_result_text = "No results match";
|
518
|
-
|
519
|
-
return AbstractChosen;
|
520
|
-
|
521
|
-
})();
|
522
|
-
|
523
|
-
$ = jQuery;
|
524
|
-
|
525
|
-
$.fn.extend({
|
526
|
-
chosen: function(options) {
|
527
|
-
if (!AbstractChosen.browser_is_supported()) {
|
528
|
-
return this;
|
529
|
-
}
|
530
|
-
return this.each(function(input_field) {
|
531
|
-
var $this, chosen;
|
532
|
-
$this = $(this);
|
533
|
-
chosen = $this.data('chosen');
|
534
|
-
if (options === 'destroy' && chosen) {
|
535
|
-
chosen.destroy();
|
536
|
-
} else if (!chosen) {
|
537
|
-
$this.data('chosen', new Chosen(this, options));
|
538
|
-
}
|
539
|
-
});
|
540
|
-
}
|
541
|
-
});
|
542
|
-
|
543
|
-
Chosen = (function(_super) {
|
544
|
-
__extends(Chosen, _super);
|
545
|
-
|
546
|
-
function Chosen() {
|
547
|
-
_ref = Chosen.__super__.constructor.apply(this, arguments);
|
548
|
-
return _ref;
|
549
|
-
}
|
550
|
-
|
551
|
-
Chosen.prototype.setup = function() {
|
552
|
-
this.form_field_jq = $(this.form_field);
|
553
|
-
this.current_selectedIndex = this.form_field.selectedIndex;
|
554
|
-
return this.is_rtl = this.form_field_jq.hasClass("chosen-rtl");
|
555
|
-
};
|
556
|
-
|
557
|
-
Chosen.prototype.set_up_html = function() {
|
558
|
-
var container_classes, container_props;
|
559
|
-
container_classes = ["chosen-container"];
|
560
|
-
container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
|
561
|
-
if (this.inherit_select_classes && this.form_field.className) {
|
562
|
-
container_classes.push(this.form_field.className);
|
563
|
-
}
|
564
|
-
if (this.is_rtl) {
|
565
|
-
container_classes.push("chosen-rtl");
|
566
|
-
}
|
567
|
-
container_props = {
|
568
|
-
'class': container_classes.join(' '),
|
569
|
-
'style': "width: " + (this.container_width()) + ";",
|
570
|
-
'title': this.form_field.title
|
571
|
-
};
|
572
|
-
if (this.form_field.id.length) {
|
573
|
-
container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
|
574
|
-
}
|
575
|
-
this.container = $("<div />", container_props);
|
576
|
-
if (this.is_multiple) {
|
577
|
-
this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>');
|
578
|
-
} else {
|
579
|
-
this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>');
|
580
|
-
}
|
581
|
-
this.form_field_jq.hide().after(this.container);
|
582
|
-
this.dropdown = this.container.find('div.chosen-drop').first();
|
583
|
-
this.search_field = this.container.find('input').first();
|
584
|
-
this.search_results = this.container.find('ul.chosen-results').first();
|
585
|
-
this.search_field_scale();
|
586
|
-
this.search_no_results = this.container.find('li.no-results').first();
|
587
|
-
if (this.is_multiple) {
|
588
|
-
this.search_choices = this.container.find('ul.chosen-choices').first();
|
589
|
-
this.search_container = this.container.find('li.search-field').first();
|
590
|
-
} else {
|
591
|
-
this.search_container = this.container.find('div.chosen-search').first();
|
592
|
-
this.selected_item = this.container.find('.chosen-single').first();
|
593
|
-
}
|
594
|
-
this.results_build();
|
595
|
-
this.set_tab_index();
|
596
|
-
this.set_label_behavior();
|
597
|
-
return this.form_field_jq.trigger("chosen:ready", {
|
598
|
-
chosen: this
|
599
|
-
});
|
600
|
-
};
|
601
|
-
|
602
|
-
Chosen.prototype.register_observers = function() {
|
603
|
-
var _this = this;
|
604
|
-
this.container.bind('mousedown.chosen', function(evt) {
|
605
|
-
_this.container_mousedown(evt);
|
606
|
-
});
|
607
|
-
this.container.bind('mouseup.chosen', function(evt) {
|
608
|
-
_this.container_mouseup(evt);
|
609
|
-
});
|
610
|
-
this.container.bind('mouseenter.chosen', function(evt) {
|
611
|
-
_this.mouse_enter(evt);
|
612
|
-
});
|
613
|
-
this.container.bind('mouseleave.chosen', function(evt) {
|
614
|
-
_this.mouse_leave(evt);
|
615
|
-
});
|
616
|
-
this.search_results.bind('mouseup.chosen', function(evt) {
|
617
|
-
_this.search_results_mouseup(evt);
|
618
|
-
});
|
619
|
-
this.search_results.bind('mouseover.chosen', function(evt) {
|
620
|
-
_this.search_results_mouseover(evt);
|
621
|
-
});
|
622
|
-
this.search_results.bind('mouseout.chosen', function(evt) {
|
623
|
-
_this.search_results_mouseout(evt);
|
624
|
-
});
|
625
|
-
this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen', function(evt) {
|
626
|
-
_this.search_results_mousewheel(evt);
|
627
|
-
});
|
628
|
-
this.search_results.bind('touchstart.chosen', function(evt) {
|
629
|
-
_this.search_results_touchstart(evt);
|
630
|
-
});
|
631
|
-
this.search_results.bind('touchmove.chosen', function(evt) {
|
632
|
-
_this.search_results_touchmove(evt);
|
633
|
-
});
|
634
|
-
this.search_results.bind('touchend.chosen', function(evt) {
|
635
|
-
_this.search_results_touchend(evt);
|
636
|
-
});
|
637
|
-
this.form_field_jq.bind("chosen:updated.chosen", function(evt) {
|
638
|
-
_this.results_update_field(evt);
|
639
|
-
});
|
640
|
-
this.form_field_jq.bind("chosen:activate.chosen", function(evt) {
|
641
|
-
_this.activate_field(evt);
|
642
|
-
});
|
643
|
-
this.form_field_jq.bind("chosen:open.chosen", function(evt) {
|
644
|
-
_this.container_mousedown(evt);
|
645
|
-
});
|
646
|
-
this.form_field_jq.bind("chosen:close.chosen", function(evt) {
|
647
|
-
_this.input_blur(evt);
|
648
|
-
});
|
649
|
-
this.search_field.bind('blur.chosen', function(evt) {
|
650
|
-
_this.input_blur(evt);
|
651
|
-
});
|
652
|
-
this.search_field.bind('keyup.chosen', function(evt) {
|
653
|
-
_this.keyup_checker(evt);
|
654
|
-
});
|
655
|
-
this.search_field.bind('keydown.chosen', function(evt) {
|
656
|
-
_this.keydown_checker(evt);
|
657
|
-
});
|
658
|
-
this.search_field.bind('focus.chosen', function(evt) {
|
659
|
-
_this.input_focus(evt);
|
660
|
-
});
|
661
|
-
this.search_field.bind('cut.chosen', function(evt) {
|
662
|
-
_this.clipboard_event_checker(evt);
|
663
|
-
});
|
664
|
-
this.search_field.bind('paste.chosen', function(evt) {
|
665
|
-
_this.clipboard_event_checker(evt);
|
666
|
-
});
|
667
|
-
if (this.is_multiple) {
|
668
|
-
return this.search_choices.bind('click.chosen', function(evt) {
|
669
|
-
_this.choices_click(evt);
|
670
|
-
});
|
671
|
-
} else {
|
672
|
-
return this.container.bind('click.chosen', function(evt) {
|
673
|
-
evt.preventDefault();
|
674
|
-
});
|
675
|
-
}
|
676
|
-
};
|
677
|
-
|
678
|
-
Chosen.prototype.destroy = function() {
|
679
|
-
$(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
|
680
|
-
if (this.search_field[0].tabIndex) {
|
681
|
-
this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex;
|
682
|
-
}
|
683
|
-
this.container.remove();
|
684
|
-
this.form_field_jq.removeData('chosen');
|
685
|
-
return this.form_field_jq.show();
|
686
|
-
};
|
687
|
-
|
688
|
-
Chosen.prototype.search_field_disabled = function() {
|
689
|
-
this.is_disabled = this.form_field_jq[0].disabled;
|
690
|
-
if (this.is_disabled) {
|
691
|
-
this.container.addClass('chosen-disabled');
|
692
|
-
this.search_field[0].disabled = true;
|
693
|
-
if (!this.is_multiple) {
|
694
|
-
this.selected_item.unbind("focus.chosen", this.activate_action);
|
695
|
-
}
|
696
|
-
return this.close_field();
|
697
|
-
} else {
|
698
|
-
this.container.removeClass('chosen-disabled');
|
699
|
-
this.search_field[0].disabled = false;
|
700
|
-
if (!this.is_multiple) {
|
701
|
-
return this.selected_item.bind("focus.chosen", this.activate_action);
|
702
|
-
}
|
703
|
-
}
|
704
|
-
};
|
705
|
-
|
706
|
-
Chosen.prototype.container_mousedown = function(evt) {
|
707
|
-
if (!this.is_disabled) {
|
708
|
-
if (evt && evt.type === "mousedown" && !this.results_showing) {
|
709
|
-
evt.preventDefault();
|
710
|
-
}
|
711
|
-
if (!((evt != null) && ($(evt.target)).hasClass("search-choice-close"))) {
|
712
|
-
if (!this.active_field) {
|
713
|
-
if (this.is_multiple) {
|
714
|
-
this.search_field.val("");
|
715
|
-
}
|
716
|
-
$(this.container[0].ownerDocument).bind('click.chosen', this.click_test_action);
|
717
|
-
this.results_show();
|
718
|
-
} else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chosen-single").length)) {
|
719
|
-
evt.preventDefault();
|
720
|
-
this.results_toggle();
|
721
|
-
}
|
722
|
-
return this.activate_field();
|
723
|
-
}
|
724
|
-
}
|
725
|
-
};
|
726
|
-
|
727
|
-
Chosen.prototype.container_mouseup = function(evt) {
|
728
|
-
if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
|
729
|
-
return this.results_reset(evt);
|
730
|
-
}
|
731
|
-
};
|
732
|
-
|
733
|
-
Chosen.prototype.search_results_mousewheel = function(evt) {
|
734
|
-
var delta;
|
735
|
-
if (evt.originalEvent) {
|
736
|
-
delta = -evt.originalEvent.wheelDelta || evt.originalEvent.detail;
|
737
|
-
}
|
738
|
-
if (delta != null) {
|
739
|
-
evt.preventDefault();
|
740
|
-
if (evt.type === 'DOMMouseScroll') {
|
741
|
-
delta = delta * 40;
|
742
|
-
}
|
743
|
-
return this.search_results.scrollTop(delta + this.search_results.scrollTop());
|
744
|
-
}
|
745
|
-
};
|
746
|
-
|
747
|
-
Chosen.prototype.blur_test = function(evt) {
|
748
|
-
if (!this.active_field && this.container.hasClass("chosen-container-active")) {
|
749
|
-
return this.close_field();
|
750
|
-
}
|
751
|
-
};
|
752
|
-
|
753
|
-
Chosen.prototype.close_field = function() {
|
754
|
-
$(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
|
755
|
-
this.active_field = false;
|
756
|
-
this.results_hide();
|
757
|
-
this.container.removeClass("chosen-container-active");
|
758
|
-
this.clear_backstroke();
|
759
|
-
this.show_search_field_default();
|
760
|
-
return this.search_field_scale();
|
761
|
-
};
|
762
|
-
|
763
|
-
Chosen.prototype.activate_field = function() {
|
764
|
-
this.container.addClass("chosen-container-active");
|
765
|
-
this.active_field = true;
|
766
|
-
this.search_field.val(this.search_field.val());
|
767
|
-
return this.search_field.focus();
|
768
|
-
};
|
769
|
-
|
770
|
-
Chosen.prototype.test_active_click = function(evt) {
|
771
|
-
var active_container;
|
772
|
-
active_container = $(evt.target).closest('.chosen-container');
|
773
|
-
if (active_container.length && this.container[0] === active_container[0]) {
|
774
|
-
return this.active_field = true;
|
775
|
-
} else {
|
776
|
-
return this.close_field();
|
777
|
-
}
|
778
|
-
};
|
779
|
-
|
780
|
-
Chosen.prototype.results_build = function() {
|
781
|
-
this.parsing = true;
|
782
|
-
this.selected_option_count = null;
|
783
|
-
this.results_data = SelectParser.select_to_array(this.form_field);
|
784
|
-
if (this.is_multiple) {
|
785
|
-
this.search_choices.find("li.search-choice").remove();
|
786
|
-
} else if (!this.is_multiple) {
|
787
|
-
this.single_set_selected_text();
|
788
|
-
if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
|
789
|
-
this.search_field[0].readOnly = true;
|
790
|
-
this.container.addClass("chosen-container-single-nosearch");
|
791
|
-
} else {
|
792
|
-
this.search_field[0].readOnly = false;
|
793
|
-
this.container.removeClass("chosen-container-single-nosearch");
|
794
|
-
}
|
795
|
-
}
|
796
|
-
this.update_results_content(this.results_option_build({
|
797
|
-
first: true
|
798
|
-
}));
|
799
|
-
this.search_field_disabled();
|
800
|
-
this.show_search_field_default();
|
801
|
-
this.search_field_scale();
|
802
|
-
return this.parsing = false;
|
803
|
-
};
|
804
|
-
|
805
|
-
Chosen.prototype.result_do_highlight = function(el) {
|
806
|
-
var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
|
807
|
-
if (el.length) {
|
808
|
-
this.result_clear_highlight();
|
809
|
-
this.result_highlight = el;
|
810
|
-
this.result_highlight.addClass("highlighted");
|
811
|
-
maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
|
812
|
-
visible_top = this.search_results.scrollTop();
|
813
|
-
visible_bottom = maxHeight + visible_top;
|
814
|
-
high_top = this.result_highlight.position().top + this.search_results.scrollTop();
|
815
|
-
high_bottom = high_top + this.result_highlight.outerHeight();
|
816
|
-
if (high_bottom >= visible_bottom) {
|
817
|
-
return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
|
818
|
-
} else if (high_top < visible_top) {
|
819
|
-
return this.search_results.scrollTop(high_top);
|
820
|
-
}
|
821
|
-
}
|
822
|
-
};
|
823
|
-
|
824
|
-
Chosen.prototype.result_clear_highlight = function() {
|
825
|
-
if (this.result_highlight) {
|
826
|
-
this.result_highlight.removeClass("highlighted");
|
827
|
-
}
|
828
|
-
return this.result_highlight = null;
|
829
|
-
};
|
830
|
-
|
831
|
-
Chosen.prototype.results_show = function() {
|
832
|
-
if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
|
833
|
-
this.form_field_jq.trigger("chosen:maxselected", {
|
834
|
-
chosen: this
|
835
|
-
});
|
836
|
-
return false;
|
837
|
-
}
|
838
|
-
this.container.addClass("chosen-with-drop");
|
839
|
-
this.results_showing = true;
|
840
|
-
this.search_field.focus();
|
841
|
-
this.search_field.val(this.search_field.val());
|
842
|
-
this.winnow_results();
|
843
|
-
return this.form_field_jq.trigger("chosen:showing_dropdown", {
|
844
|
-
chosen: this
|
845
|
-
});
|
846
|
-
};
|
847
|
-
|
848
|
-
Chosen.prototype.update_results_content = function(content) {
|
849
|
-
return this.search_results.html(content);
|
850
|
-
};
|
851
|
-
|
852
|
-
Chosen.prototype.results_hide = function() {
|
853
|
-
if (this.results_showing) {
|
854
|
-
this.result_clear_highlight();
|
855
|
-
this.container.removeClass("chosen-with-drop");
|
856
|
-
this.form_field_jq.trigger("chosen:hiding_dropdown", {
|
857
|
-
chosen: this
|
858
|
-
});
|
859
|
-
}
|
860
|
-
return this.results_showing = false;
|
861
|
-
};
|
862
|
-
|
863
|
-
Chosen.prototype.set_tab_index = function(el) {
|
864
|
-
var ti;
|
865
|
-
if (this.form_field.tabIndex) {
|
866
|
-
ti = this.form_field.tabIndex;
|
867
|
-
this.form_field.tabIndex = -1;
|
868
|
-
return this.search_field[0].tabIndex = ti;
|
869
|
-
}
|
870
|
-
};
|
871
|
-
|
872
|
-
Chosen.prototype.set_label_behavior = function() {
|
873
|
-
var _this = this;
|
874
|
-
this.form_field_label = this.form_field_jq.parents("label");
|
875
|
-
if (!this.form_field_label.length && this.form_field.id.length) {
|
876
|
-
this.form_field_label = $("label[for='" + this.form_field.id + "']");
|
877
|
-
}
|
878
|
-
if (this.form_field_label.length > 0) {
|
879
|
-
return this.form_field_label.bind('click.chosen', function(evt) {
|
880
|
-
if (_this.is_multiple) {
|
881
|
-
return _this.container_mousedown(evt);
|
882
|
-
} else {
|
883
|
-
return _this.activate_field();
|
884
|
-
}
|
885
|
-
});
|
886
|
-
}
|
887
|
-
};
|
888
|
-
|
889
|
-
Chosen.prototype.show_search_field_default = function() {
|
890
|
-
if (this.is_multiple && this.choices_count() < 1 && !this.active_field) {
|
891
|
-
this.search_field.val(this.default_text);
|
892
|
-
return this.search_field.addClass("default");
|
893
|
-
} else {
|
894
|
-
this.search_field.val("");
|
895
|
-
return this.search_field.removeClass("default");
|
896
|
-
}
|
897
|
-
};
|
898
|
-
|
899
|
-
Chosen.prototype.search_results_mouseup = function(evt) {
|
900
|
-
var target;
|
901
|
-
target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
|
902
|
-
if (target.length) {
|
903
|
-
this.result_highlight = target;
|
904
|
-
this.result_select(evt);
|
905
|
-
return this.search_field.focus();
|
906
|
-
}
|
907
|
-
};
|
908
|
-
|
909
|
-
Chosen.prototype.search_results_mouseover = function(evt) {
|
910
|
-
var target;
|
911
|
-
target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
|
912
|
-
if (target) {
|
913
|
-
return this.result_do_highlight(target);
|
914
|
-
}
|
915
|
-
};
|
916
|
-
|
917
|
-
Chosen.prototype.search_results_mouseout = function(evt) {
|
918
|
-
if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
|
919
|
-
return this.result_clear_highlight();
|
920
|
-
}
|
921
|
-
};
|
922
|
-
|
923
|
-
Chosen.prototype.choice_build = function(item) {
|
924
|
-
var choice, close_link,
|
925
|
-
_this = this;
|
926
|
-
choice = $('<li />', {
|
927
|
-
"class": "search-choice"
|
928
|
-
}).html("<span>" + item.html + "</span>");
|
929
|
-
if (item.disabled) {
|
930
|
-
choice.addClass('search-choice-disabled');
|
931
|
-
} else {
|
932
|
-
close_link = $('<a />', {
|
933
|
-
"class": 'search-choice-close',
|
934
|
-
'data-option-array-index': item.array_index
|
935
|
-
});
|
936
|
-
close_link.bind('click.chosen', function(evt) {
|
937
|
-
return _this.choice_destroy_link_click(evt);
|
938
|
-
});
|
939
|
-
choice.append(close_link);
|
940
|
-
}
|
941
|
-
return this.search_container.before(choice);
|
942
|
-
};
|
943
|
-
|
944
|
-
Chosen.prototype.choice_destroy_link_click = function(evt) {
|
945
|
-
evt.preventDefault();
|
946
|
-
evt.stopPropagation();
|
947
|
-
if (!this.is_disabled) {
|
948
|
-
return this.choice_destroy($(evt.target));
|
949
|
-
}
|
950
|
-
};
|
951
|
-
|
952
|
-
Chosen.prototype.choice_destroy = function(link) {
|
953
|
-
if (this.result_deselect(link[0].getAttribute("data-option-array-index"))) {
|
954
|
-
this.show_search_field_default();
|
955
|
-
if (this.is_multiple && this.choices_count() > 0 && this.search_field.val().length < 1) {
|
956
|
-
this.results_hide();
|
957
|
-
}
|
958
|
-
link.parents('li').first().remove();
|
959
|
-
return this.search_field_scale();
|
960
|
-
}
|
961
|
-
};
|
962
|
-
|
963
|
-
Chosen.prototype.results_reset = function() {
|
964
|
-
this.reset_single_select_options();
|
965
|
-
this.form_field.options[0].selected = true;
|
966
|
-
this.single_set_selected_text();
|
967
|
-
this.show_search_field_default();
|
968
|
-
this.results_reset_cleanup();
|
969
|
-
this.form_field_jq.trigger("change");
|
970
|
-
if (this.active_field) {
|
971
|
-
return this.results_hide();
|
972
|
-
}
|
973
|
-
};
|
974
|
-
|
975
|
-
Chosen.prototype.results_reset_cleanup = function() {
|
976
|
-
this.current_selectedIndex = this.form_field.selectedIndex;
|
977
|
-
return this.selected_item.find("abbr").remove();
|
978
|
-
};
|
979
|
-
|
980
|
-
Chosen.prototype.result_select = function(evt) {
|
981
|
-
var high, item;
|
982
|
-
if (this.result_highlight) {
|
983
|
-
high = this.result_highlight;
|
984
|
-
this.result_clear_highlight();
|
985
|
-
if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
|
986
|
-
this.form_field_jq.trigger("chosen:maxselected", {
|
987
|
-
chosen: this
|
988
|
-
});
|
989
|
-
return false;
|
990
|
-
}
|
991
|
-
if (this.is_multiple) {
|
992
|
-
high.removeClass("active-result");
|
993
|
-
} else {
|
994
|
-
this.reset_single_select_options();
|
995
|
-
}
|
996
|
-
item = this.results_data[high[0].getAttribute("data-option-array-index")];
|
997
|
-
item.selected = true;
|
998
|
-
this.form_field.options[item.options_index].selected = true;
|
999
|
-
this.selected_option_count = null;
|
1000
|
-
if (this.is_multiple) {
|
1001
|
-
this.choice_build(item);
|
1002
|
-
} else {
|
1003
|
-
this.single_set_selected_text(item.text);
|
1004
|
-
}
|
1005
|
-
if (!((evt.metaKey || evt.ctrlKey) && this.is_multiple)) {
|
1006
|
-
this.results_hide();
|
1007
|
-
}
|
1008
|
-
this.search_field.val("");
|
1009
|
-
if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {
|
1010
|
-
this.form_field_jq.trigger("change", {
|
1011
|
-
'selected': this.form_field.options[item.options_index].value
|
1012
|
-
});
|
1013
|
-
}
|
1014
|
-
this.current_selectedIndex = this.form_field.selectedIndex;
|
1015
|
-
return this.search_field_scale();
|
1016
|
-
}
|
1017
|
-
};
|
1018
|
-
|
1019
|
-
Chosen.prototype.single_set_selected_text = function(text) {
|
1020
|
-
if (text == null) {
|
1021
|
-
text = this.default_text;
|
1022
|
-
}
|
1023
|
-
if (text === this.default_text) {
|
1024
|
-
this.selected_item.addClass("chosen-default");
|
1025
|
-
} else {
|
1026
|
-
this.single_deselect_control_build();
|
1027
|
-
this.selected_item.removeClass("chosen-default");
|
1028
|
-
}
|
1029
|
-
return this.selected_item.find("span").text(text);
|
1030
|
-
};
|
1031
|
-
|
1032
|
-
Chosen.prototype.result_deselect = function(pos) {
|
1033
|
-
var result_data;
|
1034
|
-
result_data = this.results_data[pos];
|
1035
|
-
if (!this.form_field.options[result_data.options_index].disabled) {
|
1036
|
-
result_data.selected = false;
|
1037
|
-
this.form_field.options[result_data.options_index].selected = false;
|
1038
|
-
this.selected_option_count = null;
|
1039
|
-
this.result_clear_highlight();
|
1040
|
-
if (this.results_showing) {
|
1041
|
-
this.winnow_results();
|
1042
|
-
}
|
1043
|
-
this.form_field_jq.trigger("change", {
|
1044
|
-
deselected: this.form_field.options[result_data.options_index].value
|
1045
|
-
});
|
1046
|
-
this.search_field_scale();
|
1047
|
-
return true;
|
1048
|
-
} else {
|
1049
|
-
return false;
|
1050
|
-
}
|
1051
|
-
};
|
1052
|
-
|
1053
|
-
Chosen.prototype.single_deselect_control_build = function() {
|
1054
|
-
if (!this.allow_single_deselect) {
|
1055
|
-
return;
|
1056
|
-
}
|
1057
|
-
if (!this.selected_item.find("abbr").length) {
|
1058
|
-
this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
|
1059
|
-
}
|
1060
|
-
return this.selected_item.addClass("chosen-single-with-deselect");
|
1061
|
-
};
|
1062
|
-
|
1063
|
-
Chosen.prototype.get_search_text = function() {
|
1064
|
-
if (this.search_field.val() === this.default_text) {
|
1065
|
-
return "";
|
1066
|
-
} else {
|
1067
|
-
return $('<div/>').text($.trim(this.search_field.val())).html();
|
1068
|
-
}
|
1069
|
-
};
|
1070
|
-
|
1071
|
-
Chosen.prototype.winnow_results_set_highlight = function() {
|
1072
|
-
var do_high, selected_results;
|
1073
|
-
selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
|
1074
|
-
do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
|
1075
|
-
if (do_high != null) {
|
1076
|
-
return this.result_do_highlight(do_high);
|
1077
|
-
}
|
1078
|
-
};
|
1079
|
-
|
1080
|
-
Chosen.prototype.no_results = function(terms) {
|
1081
|
-
var no_results_html;
|
1082
|
-
no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
|
1083
|
-
no_results_html.find("span").first().html(terms);
|
1084
|
-
this.search_results.append(no_results_html);
|
1085
|
-
return this.form_field_jq.trigger("chosen:no_results", {
|
1086
|
-
chosen: this
|
1087
|
-
});
|
1088
|
-
};
|
1089
|
-
|
1090
|
-
Chosen.prototype.no_results_clear = function() {
|
1091
|
-
return this.search_results.find(".no-results").remove();
|
1092
|
-
};
|
1093
|
-
|
1094
|
-
Chosen.prototype.keydown_arrow = function() {
|
1095
|
-
var next_sib;
|
1096
|
-
if (this.results_showing && this.result_highlight) {
|
1097
|
-
next_sib = this.result_highlight.nextAll("li.active-result").first();
|
1098
|
-
if (next_sib) {
|
1099
|
-
return this.result_do_highlight(next_sib);
|
1100
|
-
}
|
1101
|
-
} else {
|
1102
|
-
return this.results_show();
|
1103
|
-
}
|
1104
|
-
};
|
1105
|
-
|
1106
|
-
Chosen.prototype.keyup_arrow = function() {
|
1107
|
-
var prev_sibs;
|
1108
|
-
if (!this.results_showing && !this.is_multiple) {
|
1109
|
-
return this.results_show();
|
1110
|
-
} else if (this.result_highlight) {
|
1111
|
-
prev_sibs = this.result_highlight.prevAll("li.active-result");
|
1112
|
-
if (prev_sibs.length) {
|
1113
|
-
return this.result_do_highlight(prev_sibs.first());
|
1114
|
-
} else {
|
1115
|
-
if (this.choices_count() > 0) {
|
1116
|
-
this.results_hide();
|
1117
|
-
}
|
1118
|
-
return this.result_clear_highlight();
|
1119
|
-
}
|
1120
|
-
}
|
1121
|
-
};
|
1122
|
-
|
1123
|
-
Chosen.prototype.keydown_backstroke = function() {
|
1124
|
-
var next_available_destroy;
|
1125
|
-
if (this.pending_backstroke) {
|
1126
|
-
this.choice_destroy(this.pending_backstroke.find("a").first());
|
1127
|
-
return this.clear_backstroke();
|
1128
|
-
} else {
|
1129
|
-
next_available_destroy = this.search_container.siblings("li.search-choice").last();
|
1130
|
-
if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
|
1131
|
-
this.pending_backstroke = next_available_destroy;
|
1132
|
-
if (this.single_backstroke_delete) {
|
1133
|
-
return this.keydown_backstroke();
|
1134
|
-
} else {
|
1135
|
-
return this.pending_backstroke.addClass("search-choice-focus");
|
1136
|
-
}
|
1137
|
-
}
|
1138
|
-
}
|
1139
|
-
};
|
1140
|
-
|
1141
|
-
Chosen.prototype.clear_backstroke = function() {
|
1142
|
-
if (this.pending_backstroke) {
|
1143
|
-
this.pending_backstroke.removeClass("search-choice-focus");
|
1144
|
-
}
|
1145
|
-
return this.pending_backstroke = null;
|
1146
|
-
};
|
1147
|
-
|
1148
|
-
Chosen.prototype.keydown_checker = function(evt) {
|
1149
|
-
var stroke, _ref1;
|
1150
|
-
stroke = (_ref1 = evt.which) != null ? _ref1 : evt.keyCode;
|
1151
|
-
this.search_field_scale();
|
1152
|
-
if (stroke !== 8 && this.pending_backstroke) {
|
1153
|
-
this.clear_backstroke();
|
1154
|
-
}
|
1155
|
-
switch (stroke) {
|
1156
|
-
case 8:
|
1157
|
-
this.backstroke_length = this.search_field.val().length;
|
1158
|
-
break;
|
1159
|
-
case 9:
|
1160
|
-
if (this.results_showing && !this.is_multiple) {
|
1161
|
-
this.result_select(evt);
|
1162
|
-
}
|
1163
|
-
this.mouse_on_container = false;
|
1164
|
-
break;
|
1165
|
-
case 13:
|
1166
|
-
evt.preventDefault();
|
1167
|
-
break;
|
1168
|
-
case 38:
|
1169
|
-
evt.preventDefault();
|
1170
|
-
this.keyup_arrow();
|
1171
|
-
break;
|
1172
|
-
case 40:
|
1173
|
-
evt.preventDefault();
|
1174
|
-
this.keydown_arrow();
|
1175
|
-
break;
|
1176
|
-
}
|
1177
|
-
};
|
1178
|
-
|
1179
|
-
Chosen.prototype.search_field_scale = function() {
|
1180
|
-
var div, f_width, h, style, style_block, styles, w, _i, _len;
|
1181
|
-
if (this.is_multiple) {
|
1182
|
-
h = 0;
|
1183
|
-
w = 0;
|
1184
|
-
style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
|
1185
|
-
styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
|
1186
|
-
for (_i = 0, _len = styles.length; _i < _len; _i++) {
|
1187
|
-
style = styles[_i];
|
1188
|
-
style_block += style + ":" + this.search_field.css(style) + ";";
|
1189
|
-
}
|
1190
|
-
div = $('<div />', {
|
1191
|
-
'style': style_block
|
1192
|
-
});
|
1193
|
-
div.text(this.search_field.val());
|
1194
|
-
$('body').append(div);
|
1195
|
-
w = div.width() + 25;
|
1196
|
-
div.remove();
|
1197
|
-
f_width = this.container.outerWidth();
|
1198
|
-
if (w > f_width - 10) {
|
1199
|
-
w = f_width - 10;
|
1200
|
-
}
|
1201
|
-
return this.search_field.css({
|
1202
|
-
'width': w + 'px'
|
1203
|
-
});
|
1204
|
-
}
|
1205
|
-
};
|
1206
|
-
|
1207
|
-
return Chosen;
|
1208
|
-
|
1209
|
-
})(AbstractChosen);
|
1210
|
-
|
1211
|
-
}).call(this);
|
1
|
+
/*!
|
2
|
+
Chosen, a Select Box Enhancer for jQuery and Prototype
|
3
|
+
by Patrick Filler for Harvest, http://getharvest.com
|
4
|
+
|
5
|
+
Version 1.1.0
|
6
|
+
Full source at https://github.com/harvesthq/chosen
|
7
|
+
Copyright (c) 2011 Harvest http://getharvest.com
|
8
|
+
|
9
|
+
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
|
10
|
+
This file is generated by `grunt build`, do not edit it by hand.
|
11
|
+
*/
|
12
|
+
|
13
|
+
(function() {
|
14
|
+
var $, AbstractChosen, Chosen, SelectParser, _ref,
|
15
|
+
__hasProp = {}.hasOwnProperty,
|
16
|
+
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
17
|
+
|
18
|
+
SelectParser = (function() {
|
19
|
+
function SelectParser() {
|
20
|
+
this.options_index = 0;
|
21
|
+
this.parsed = [];
|
22
|
+
}
|
23
|
+
|
24
|
+
SelectParser.prototype.add_node = function(child) {
|
25
|
+
if (child.nodeName.toUpperCase() === "OPTGROUP") {
|
26
|
+
return this.add_group(child);
|
27
|
+
} else {
|
28
|
+
return this.add_option(child);
|
29
|
+
}
|
30
|
+
};
|
31
|
+
|
32
|
+
SelectParser.prototype.add_group = function(group) {
|
33
|
+
var group_position, option, _i, _len, _ref, _results;
|
34
|
+
group_position = this.parsed.length;
|
35
|
+
this.parsed.push({
|
36
|
+
array_index: group_position,
|
37
|
+
group: true,
|
38
|
+
label: this.escapeExpression(group.label),
|
39
|
+
children: 0,
|
40
|
+
disabled: group.disabled
|
41
|
+
});
|
42
|
+
_ref = group.childNodes;
|
43
|
+
_results = [];
|
44
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
45
|
+
option = _ref[_i];
|
46
|
+
_results.push(this.add_option(option, group_position, group.disabled));
|
47
|
+
}
|
48
|
+
return _results;
|
49
|
+
};
|
50
|
+
|
51
|
+
SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
|
52
|
+
if (option.nodeName.toUpperCase() === "OPTION") {
|
53
|
+
if (option.text !== "") {
|
54
|
+
if (group_position != null) {
|
55
|
+
this.parsed[group_position].children += 1;
|
56
|
+
}
|
57
|
+
this.parsed.push({
|
58
|
+
array_index: this.parsed.length,
|
59
|
+
options_index: this.options_index,
|
60
|
+
value: option.value,
|
61
|
+
text: option.text,
|
62
|
+
html: option.innerHTML,
|
63
|
+
selected: option.selected,
|
64
|
+
disabled: group_disabled === true ? group_disabled : option.disabled,
|
65
|
+
group_array_index: group_position,
|
66
|
+
classes: option.className,
|
67
|
+
style: option.style.cssText
|
68
|
+
});
|
69
|
+
} else {
|
70
|
+
this.parsed.push({
|
71
|
+
array_index: this.parsed.length,
|
72
|
+
options_index: this.options_index,
|
73
|
+
empty: true
|
74
|
+
});
|
75
|
+
}
|
76
|
+
return this.options_index += 1;
|
77
|
+
}
|
78
|
+
};
|
79
|
+
|
80
|
+
SelectParser.prototype.escapeExpression = function(text) {
|
81
|
+
var map, unsafe_chars;
|
82
|
+
if ((text == null) || text === false) {
|
83
|
+
return "";
|
84
|
+
}
|
85
|
+
if (!/[\&\<\>\"\'\`]/.test(text)) {
|
86
|
+
return text;
|
87
|
+
}
|
88
|
+
map = {
|
89
|
+
"<": "<",
|
90
|
+
">": ">",
|
91
|
+
'"': """,
|
92
|
+
"'": "'",
|
93
|
+
"`": "`"
|
94
|
+
};
|
95
|
+
unsafe_chars = /&(?!\w+;)|[\<\>\"\'\`]/g;
|
96
|
+
return text.replace(unsafe_chars, function(chr) {
|
97
|
+
return map[chr] || "&";
|
98
|
+
});
|
99
|
+
};
|
100
|
+
|
101
|
+
return SelectParser;
|
102
|
+
|
103
|
+
})();
|
104
|
+
|
105
|
+
SelectParser.select_to_array = function(select) {
|
106
|
+
var child, parser, _i, _len, _ref;
|
107
|
+
parser = new SelectParser();
|
108
|
+
_ref = select.childNodes;
|
109
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
110
|
+
child = _ref[_i];
|
111
|
+
parser.add_node(child);
|
112
|
+
}
|
113
|
+
return parser.parsed;
|
114
|
+
};
|
115
|
+
|
116
|
+
AbstractChosen = (function() {
|
117
|
+
function AbstractChosen(form_field, options) {
|
118
|
+
this.form_field = form_field;
|
119
|
+
this.options = options != null ? options : {};
|
120
|
+
if (!AbstractChosen.browser_is_supported()) {
|
121
|
+
return;
|
122
|
+
}
|
123
|
+
this.is_multiple = this.form_field.multiple;
|
124
|
+
this.set_default_text();
|
125
|
+
this.set_default_values();
|
126
|
+
this.setup();
|
127
|
+
this.set_up_html();
|
128
|
+
this.register_observers();
|
129
|
+
}
|
130
|
+
|
131
|
+
AbstractChosen.prototype.set_default_values = function() {
|
132
|
+
var _this = this;
|
133
|
+
this.click_test_action = function(evt) {
|
134
|
+
return _this.test_active_click(evt);
|
135
|
+
};
|
136
|
+
this.activate_action = function(evt) {
|
137
|
+
return _this.activate_field(evt);
|
138
|
+
};
|
139
|
+
this.active_field = false;
|
140
|
+
this.mouse_on_container = false;
|
141
|
+
this.results_showing = false;
|
142
|
+
this.result_highlighted = null;
|
143
|
+
this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
|
144
|
+
this.disable_search_threshold = this.options.disable_search_threshold || 0;
|
145
|
+
this.disable_search = this.options.disable_search || false;
|
146
|
+
this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
|
147
|
+
this.group_search = this.options.group_search != null ? this.options.group_search : true;
|
148
|
+
this.search_contains = this.options.search_contains || false;
|
149
|
+
this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true;
|
150
|
+
this.max_selected_options = this.options.max_selected_options || Infinity;
|
151
|
+
this.inherit_select_classes = this.options.inherit_select_classes || false;
|
152
|
+
this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
|
153
|
+
return this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
|
154
|
+
};
|
155
|
+
|
156
|
+
AbstractChosen.prototype.set_default_text = function() {
|
157
|
+
if (this.form_field.getAttribute("data-placeholder")) {
|
158
|
+
this.default_text = this.form_field.getAttribute("data-placeholder");
|
159
|
+
} else if (this.is_multiple) {
|
160
|
+
this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text;
|
161
|
+
} else {
|
162
|
+
this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;
|
163
|
+
}
|
164
|
+
return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text;
|
165
|
+
};
|
166
|
+
|
167
|
+
AbstractChosen.prototype.mouse_enter = function() {
|
168
|
+
return this.mouse_on_container = true;
|
169
|
+
};
|
170
|
+
|
171
|
+
AbstractChosen.prototype.mouse_leave = function() {
|
172
|
+
return this.mouse_on_container = false;
|
173
|
+
};
|
174
|
+
|
175
|
+
AbstractChosen.prototype.input_focus = function(evt) {
|
176
|
+
var _this = this;
|
177
|
+
if (this.is_multiple) {
|
178
|
+
if (!this.active_field) {
|
179
|
+
return setTimeout((function() {
|
180
|
+
return _this.container_mousedown();
|
181
|
+
}), 50);
|
182
|
+
}
|
183
|
+
} else {
|
184
|
+
if (!this.active_field) {
|
185
|
+
return this.activate_field();
|
186
|
+
}
|
187
|
+
}
|
188
|
+
};
|
189
|
+
|
190
|
+
AbstractChosen.prototype.input_blur = function(evt) {
|
191
|
+
var _this = this;
|
192
|
+
if (!this.mouse_on_container) {
|
193
|
+
this.active_field = false;
|
194
|
+
return setTimeout((function() {
|
195
|
+
return _this.blur_test();
|
196
|
+
}), 100);
|
197
|
+
}
|
198
|
+
};
|
199
|
+
|
200
|
+
AbstractChosen.prototype.results_option_build = function(options) {
|
201
|
+
var content, data, _i, _len, _ref;
|
202
|
+
content = '';
|
203
|
+
_ref = this.results_data;
|
204
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
205
|
+
data = _ref[_i];
|
206
|
+
if (data.group) {
|
207
|
+
content += this.result_add_group(data);
|
208
|
+
} else {
|
209
|
+
content += this.result_add_option(data);
|
210
|
+
}
|
211
|
+
if (options != null ? options.first : void 0) {
|
212
|
+
if (data.selected && this.is_multiple) {
|
213
|
+
this.choice_build(data);
|
214
|
+
} else if (data.selected && !this.is_multiple) {
|
215
|
+
this.single_set_selected_text(data.text);
|
216
|
+
}
|
217
|
+
}
|
218
|
+
}
|
219
|
+
return content;
|
220
|
+
};
|
221
|
+
|
222
|
+
AbstractChosen.prototype.result_add_option = function(option) {
|
223
|
+
var classes, option_el;
|
224
|
+
if (!option.search_match) {
|
225
|
+
return '';
|
226
|
+
}
|
227
|
+
if (!this.include_option_in_results(option)) {
|
228
|
+
return '';
|
229
|
+
}
|
230
|
+
classes = [];
|
231
|
+
if (!option.disabled && !(option.selected && this.is_multiple)) {
|
232
|
+
classes.push("active-result");
|
233
|
+
}
|
234
|
+
if (option.disabled && !(option.selected && this.is_multiple)) {
|
235
|
+
classes.push("disabled-result");
|
236
|
+
}
|
237
|
+
if (option.selected) {
|
238
|
+
classes.push("result-selected");
|
239
|
+
}
|
240
|
+
if (option.group_array_index != null) {
|
241
|
+
classes.push("group-option");
|
242
|
+
}
|
243
|
+
if (option.classes !== "") {
|
244
|
+
classes.push(option.classes);
|
245
|
+
}
|
246
|
+
option_el = document.createElement("li");
|
247
|
+
option_el.className = classes.join(" ");
|
248
|
+
option_el.style.cssText = option.style;
|
249
|
+
option_el.setAttribute("data-option-array-index", option.array_index);
|
250
|
+
option_el.innerHTML = option.search_text;
|
251
|
+
return this.outerHTML(option_el);
|
252
|
+
};
|
253
|
+
|
254
|
+
AbstractChosen.prototype.result_add_group = function(group) {
|
255
|
+
var group_el;
|
256
|
+
if (!(group.search_match || group.group_match)) {
|
257
|
+
return '';
|
258
|
+
}
|
259
|
+
if (!(group.active_options > 0)) {
|
260
|
+
return '';
|
261
|
+
}
|
262
|
+
group_el = document.createElement("li");
|
263
|
+
group_el.className = "group-result";
|
264
|
+
group_el.innerHTML = group.search_text;
|
265
|
+
return this.outerHTML(group_el);
|
266
|
+
};
|
267
|
+
|
268
|
+
AbstractChosen.prototype.results_update_field = function() {
|
269
|
+
this.set_default_text();
|
270
|
+
if (!this.is_multiple) {
|
271
|
+
this.results_reset_cleanup();
|
272
|
+
}
|
273
|
+
this.result_clear_highlight();
|
274
|
+
this.results_build();
|
275
|
+
if (this.results_showing) {
|
276
|
+
return this.winnow_results();
|
277
|
+
}
|
278
|
+
};
|
279
|
+
|
280
|
+
AbstractChosen.prototype.reset_single_select_options = function() {
|
281
|
+
var result, _i, _len, _ref, _results;
|
282
|
+
_ref = this.results_data;
|
283
|
+
_results = [];
|
284
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
285
|
+
result = _ref[_i];
|
286
|
+
if (result.selected) {
|
287
|
+
_results.push(result.selected = false);
|
288
|
+
} else {
|
289
|
+
_results.push(void 0);
|
290
|
+
}
|
291
|
+
}
|
292
|
+
return _results;
|
293
|
+
};
|
294
|
+
|
295
|
+
AbstractChosen.prototype.results_toggle = function() {
|
296
|
+
if (this.results_showing) {
|
297
|
+
return this.results_hide();
|
298
|
+
} else {
|
299
|
+
return this.results_show();
|
300
|
+
}
|
301
|
+
};
|
302
|
+
|
303
|
+
AbstractChosen.prototype.results_search = function(evt) {
|
304
|
+
if (this.results_showing) {
|
305
|
+
return this.winnow_results();
|
306
|
+
} else {
|
307
|
+
return this.results_show();
|
308
|
+
}
|
309
|
+
};
|
310
|
+
|
311
|
+
AbstractChosen.prototype.winnow_results = function() {
|
312
|
+
var escapedSearchText, option, regex, regexAnchor, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref;
|
313
|
+
this.no_results_clear();
|
314
|
+
results = 0;
|
315
|
+
searchText = this.get_search_text();
|
316
|
+
escapedSearchText = searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
317
|
+
regexAnchor = this.search_contains ? "" : "^";
|
318
|
+
regex = new RegExp(regexAnchor + escapedSearchText, 'i');
|
319
|
+
zregex = new RegExp(escapedSearchText, 'i');
|
320
|
+
_ref = this.results_data;
|
321
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
322
|
+
option = _ref[_i];
|
323
|
+
option.search_match = false;
|
324
|
+
results_group = null;
|
325
|
+
if (this.include_option_in_results(option)) {
|
326
|
+
if (option.group) {
|
327
|
+
option.group_match = false;
|
328
|
+
option.active_options = 0;
|
329
|
+
}
|
330
|
+
if ((option.group_array_index != null) && this.results_data[option.group_array_index]) {
|
331
|
+
results_group = this.results_data[option.group_array_index];
|
332
|
+
if (results_group.active_options === 0 && results_group.search_match) {
|
333
|
+
results += 1;
|
334
|
+
}
|
335
|
+
results_group.active_options += 1;
|
336
|
+
}
|
337
|
+
if (!(option.group && !this.group_search)) {
|
338
|
+
option.search_text = option.group ? option.label : option.html;
|
339
|
+
option.search_match = this.search_string_match(option.search_text, regex);
|
340
|
+
if (option.search_match && !option.group) {
|
341
|
+
results += 1;
|
342
|
+
}
|
343
|
+
if (option.search_match) {
|
344
|
+
if (searchText.length) {
|
345
|
+
startpos = option.search_text.search(zregex);
|
346
|
+
text = option.search_text.substr(0, startpos + searchText.length) + '</em>' + option.search_text.substr(startpos + searchText.length);
|
347
|
+
option.search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
|
348
|
+
}
|
349
|
+
if (results_group != null) {
|
350
|
+
results_group.group_match = true;
|
351
|
+
}
|
352
|
+
} else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
|
353
|
+
option.search_match = true;
|
354
|
+
}
|
355
|
+
}
|
356
|
+
}
|
357
|
+
}
|
358
|
+
this.result_clear_highlight();
|
359
|
+
if (results < 1 && searchText.length) {
|
360
|
+
this.update_results_content("");
|
361
|
+
return this.no_results(searchText);
|
362
|
+
} else {
|
363
|
+
this.update_results_content(this.results_option_build());
|
364
|
+
return this.winnow_results_set_highlight();
|
365
|
+
}
|
366
|
+
};
|
367
|
+
|
368
|
+
AbstractChosen.prototype.search_string_match = function(search_string, regex) {
|
369
|
+
var part, parts, _i, _len;
|
370
|
+
if (regex.test(search_string)) {
|
371
|
+
return true;
|
372
|
+
} else if (this.enable_split_word_search && (search_string.indexOf(" ") >= 0 || search_string.indexOf("[") === 0)) {
|
373
|
+
parts = search_string.replace(/\[|\]/g, "").split(" ");
|
374
|
+
if (parts.length) {
|
375
|
+
for (_i = 0, _len = parts.length; _i < _len; _i++) {
|
376
|
+
part = parts[_i];
|
377
|
+
if (regex.test(part)) {
|
378
|
+
return true;
|
379
|
+
}
|
380
|
+
}
|
381
|
+
}
|
382
|
+
}
|
383
|
+
};
|
384
|
+
|
385
|
+
AbstractChosen.prototype.choices_count = function() {
|
386
|
+
var option, _i, _len, _ref;
|
387
|
+
if (this.selected_option_count != null) {
|
388
|
+
return this.selected_option_count;
|
389
|
+
}
|
390
|
+
this.selected_option_count = 0;
|
391
|
+
_ref = this.form_field.options;
|
392
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
393
|
+
option = _ref[_i];
|
394
|
+
if (option.selected) {
|
395
|
+
this.selected_option_count += 1;
|
396
|
+
}
|
397
|
+
}
|
398
|
+
return this.selected_option_count;
|
399
|
+
};
|
400
|
+
|
401
|
+
AbstractChosen.prototype.choices_click = function(evt) {
|
402
|
+
evt.preventDefault();
|
403
|
+
if (!(this.results_showing || this.is_disabled)) {
|
404
|
+
return this.results_show();
|
405
|
+
}
|
406
|
+
};
|
407
|
+
|
408
|
+
AbstractChosen.prototype.keyup_checker = function(evt) {
|
409
|
+
var stroke, _ref;
|
410
|
+
stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
|
411
|
+
this.search_field_scale();
|
412
|
+
switch (stroke) {
|
413
|
+
case 8:
|
414
|
+
if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
|
415
|
+
return this.keydown_backstroke();
|
416
|
+
} else if (!this.pending_backstroke) {
|
417
|
+
this.result_clear_highlight();
|
418
|
+
return this.results_search();
|
419
|
+
}
|
420
|
+
break;
|
421
|
+
case 13:
|
422
|
+
evt.preventDefault();
|
423
|
+
if (this.results_showing) {
|
424
|
+
return this.result_select(evt);
|
425
|
+
}
|
426
|
+
break;
|
427
|
+
case 27:
|
428
|
+
if (this.results_showing) {
|
429
|
+
this.results_hide();
|
430
|
+
}
|
431
|
+
return true;
|
432
|
+
case 9:
|
433
|
+
case 38:
|
434
|
+
case 40:
|
435
|
+
case 16:
|
436
|
+
case 91:
|
437
|
+
case 17:
|
438
|
+
break;
|
439
|
+
default:
|
440
|
+
return this.results_search();
|
441
|
+
}
|
442
|
+
};
|
443
|
+
|
444
|
+
AbstractChosen.prototype.clipboard_event_checker = function(evt) {
|
445
|
+
var _this = this;
|
446
|
+
return setTimeout((function() {
|
447
|
+
return _this.results_search();
|
448
|
+
}), 50);
|
449
|
+
};
|
450
|
+
|
451
|
+
AbstractChosen.prototype.container_width = function() {
|
452
|
+
if (this.options.width != null) {
|
453
|
+
return this.options.width;
|
454
|
+
} else {
|
455
|
+
return "" + this.form_field.offsetWidth + "px";
|
456
|
+
}
|
457
|
+
};
|
458
|
+
|
459
|
+
AbstractChosen.prototype.include_option_in_results = function(option) {
|
460
|
+
if (this.is_multiple && (!this.display_selected_options && option.selected)) {
|
461
|
+
return false;
|
462
|
+
}
|
463
|
+
if (!this.display_disabled_options && option.disabled) {
|
464
|
+
return false;
|
465
|
+
}
|
466
|
+
if (option.empty) {
|
467
|
+
return false;
|
468
|
+
}
|
469
|
+
return true;
|
470
|
+
};
|
471
|
+
|
472
|
+
AbstractChosen.prototype.search_results_touchstart = function(evt) {
|
473
|
+
this.touch_started = true;
|
474
|
+
return this.search_results_mouseover(evt);
|
475
|
+
};
|
476
|
+
|
477
|
+
AbstractChosen.prototype.search_results_touchmove = function(evt) {
|
478
|
+
this.touch_started = false;
|
479
|
+
return this.search_results_mouseout(evt);
|
480
|
+
};
|
481
|
+
|
482
|
+
AbstractChosen.prototype.search_results_touchend = function(evt) {
|
483
|
+
if (this.touch_started) {
|
484
|
+
return this.search_results_mouseup(evt);
|
485
|
+
}
|
486
|
+
};
|
487
|
+
|
488
|
+
AbstractChosen.prototype.outerHTML = function(element) {
|
489
|
+
var tmp;
|
490
|
+
if (element.outerHTML) {
|
491
|
+
return element.outerHTML;
|
492
|
+
}
|
493
|
+
tmp = document.createElement("div");
|
494
|
+
tmp.appendChild(element);
|
495
|
+
return tmp.innerHTML;
|
496
|
+
};
|
497
|
+
|
498
|
+
AbstractChosen.browser_is_supported = function() {
|
499
|
+
if (window.navigator.appName === "Microsoft Internet Explorer") {
|
500
|
+
return document.documentMode >= 8;
|
501
|
+
}
|
502
|
+
if (/iP(od|hone)/i.test(window.navigator.userAgent)) {
|
503
|
+
return false;
|
504
|
+
}
|
505
|
+
if (/Android/i.test(window.navigator.userAgent)) {
|
506
|
+
if (/Mobile/i.test(window.navigator.userAgent)) {
|
507
|
+
return false;
|
508
|
+
}
|
509
|
+
}
|
510
|
+
return true;
|
511
|
+
};
|
512
|
+
|
513
|
+
AbstractChosen.default_multiple_text = "Select Some Options";
|
514
|
+
|
515
|
+
AbstractChosen.default_single_text = "Select an Option";
|
516
|
+
|
517
|
+
AbstractChosen.default_no_result_text = "No results match";
|
518
|
+
|
519
|
+
return AbstractChosen;
|
520
|
+
|
521
|
+
})();
|
522
|
+
|
523
|
+
$ = jQuery;
|
524
|
+
|
525
|
+
$.fn.extend({
|
526
|
+
chosen: function(options) {
|
527
|
+
if (!AbstractChosen.browser_is_supported()) {
|
528
|
+
return this;
|
529
|
+
}
|
530
|
+
return this.each(function(input_field) {
|
531
|
+
var $this, chosen;
|
532
|
+
$this = $(this);
|
533
|
+
chosen = $this.data('chosen');
|
534
|
+
if (options === 'destroy' && chosen) {
|
535
|
+
chosen.destroy();
|
536
|
+
} else if (!chosen) {
|
537
|
+
$this.data('chosen', new Chosen(this, options));
|
538
|
+
}
|
539
|
+
});
|
540
|
+
}
|
541
|
+
});
|
542
|
+
|
543
|
+
Chosen = (function(_super) {
|
544
|
+
__extends(Chosen, _super);
|
545
|
+
|
546
|
+
function Chosen() {
|
547
|
+
_ref = Chosen.__super__.constructor.apply(this, arguments);
|
548
|
+
return _ref;
|
549
|
+
}
|
550
|
+
|
551
|
+
Chosen.prototype.setup = function() {
|
552
|
+
this.form_field_jq = $(this.form_field);
|
553
|
+
this.current_selectedIndex = this.form_field.selectedIndex;
|
554
|
+
return this.is_rtl = this.form_field_jq.hasClass("chosen-rtl");
|
555
|
+
};
|
556
|
+
|
557
|
+
Chosen.prototype.set_up_html = function() {
|
558
|
+
var container_classes, container_props;
|
559
|
+
container_classes = ["chosen-container"];
|
560
|
+
container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
|
561
|
+
if (this.inherit_select_classes && this.form_field.className) {
|
562
|
+
container_classes.push(this.form_field.className);
|
563
|
+
}
|
564
|
+
if (this.is_rtl) {
|
565
|
+
container_classes.push("chosen-rtl");
|
566
|
+
}
|
567
|
+
container_props = {
|
568
|
+
'class': container_classes.join(' '),
|
569
|
+
'style': "width: " + (this.container_width()) + ";",
|
570
|
+
'title': this.form_field.title
|
571
|
+
};
|
572
|
+
if (this.form_field.id.length) {
|
573
|
+
container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
|
574
|
+
}
|
575
|
+
this.container = $("<div />", container_props);
|
576
|
+
if (this.is_multiple) {
|
577
|
+
this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>');
|
578
|
+
} else {
|
579
|
+
this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>');
|
580
|
+
}
|
581
|
+
this.form_field_jq.hide().after(this.container);
|
582
|
+
this.dropdown = this.container.find('div.chosen-drop').first();
|
583
|
+
this.search_field = this.container.find('input').first();
|
584
|
+
this.search_results = this.container.find('ul.chosen-results').first();
|
585
|
+
this.search_field_scale();
|
586
|
+
this.search_no_results = this.container.find('li.no-results').first();
|
587
|
+
if (this.is_multiple) {
|
588
|
+
this.search_choices = this.container.find('ul.chosen-choices').first();
|
589
|
+
this.search_container = this.container.find('li.search-field').first();
|
590
|
+
} else {
|
591
|
+
this.search_container = this.container.find('div.chosen-search').first();
|
592
|
+
this.selected_item = this.container.find('.chosen-single').first();
|
593
|
+
}
|
594
|
+
this.results_build();
|
595
|
+
this.set_tab_index();
|
596
|
+
this.set_label_behavior();
|
597
|
+
return this.form_field_jq.trigger("chosen:ready", {
|
598
|
+
chosen: this
|
599
|
+
});
|
600
|
+
};
|
601
|
+
|
602
|
+
Chosen.prototype.register_observers = function() {
|
603
|
+
var _this = this;
|
604
|
+
this.container.bind('mousedown.chosen', function(evt) {
|
605
|
+
_this.container_mousedown(evt);
|
606
|
+
});
|
607
|
+
this.container.bind('mouseup.chosen', function(evt) {
|
608
|
+
_this.container_mouseup(evt);
|
609
|
+
});
|
610
|
+
this.container.bind('mouseenter.chosen', function(evt) {
|
611
|
+
_this.mouse_enter(evt);
|
612
|
+
});
|
613
|
+
this.container.bind('mouseleave.chosen', function(evt) {
|
614
|
+
_this.mouse_leave(evt);
|
615
|
+
});
|
616
|
+
this.search_results.bind('mouseup.chosen', function(evt) {
|
617
|
+
_this.search_results_mouseup(evt);
|
618
|
+
});
|
619
|
+
this.search_results.bind('mouseover.chosen', function(evt) {
|
620
|
+
_this.search_results_mouseover(evt);
|
621
|
+
});
|
622
|
+
this.search_results.bind('mouseout.chosen', function(evt) {
|
623
|
+
_this.search_results_mouseout(evt);
|
624
|
+
});
|
625
|
+
this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen', function(evt) {
|
626
|
+
_this.search_results_mousewheel(evt);
|
627
|
+
});
|
628
|
+
this.search_results.bind('touchstart.chosen', function(evt) {
|
629
|
+
_this.search_results_touchstart(evt);
|
630
|
+
});
|
631
|
+
this.search_results.bind('touchmove.chosen', function(evt) {
|
632
|
+
_this.search_results_touchmove(evt);
|
633
|
+
});
|
634
|
+
this.search_results.bind('touchend.chosen', function(evt) {
|
635
|
+
_this.search_results_touchend(evt);
|
636
|
+
});
|
637
|
+
this.form_field_jq.bind("chosen:updated.chosen", function(evt) {
|
638
|
+
_this.results_update_field(evt);
|
639
|
+
});
|
640
|
+
this.form_field_jq.bind("chosen:activate.chosen", function(evt) {
|
641
|
+
_this.activate_field(evt);
|
642
|
+
});
|
643
|
+
this.form_field_jq.bind("chosen:open.chosen", function(evt) {
|
644
|
+
_this.container_mousedown(evt);
|
645
|
+
});
|
646
|
+
this.form_field_jq.bind("chosen:close.chosen", function(evt) {
|
647
|
+
_this.input_blur(evt);
|
648
|
+
});
|
649
|
+
this.search_field.bind('blur.chosen', function(evt) {
|
650
|
+
_this.input_blur(evt);
|
651
|
+
});
|
652
|
+
this.search_field.bind('keyup.chosen', function(evt) {
|
653
|
+
_this.keyup_checker(evt);
|
654
|
+
});
|
655
|
+
this.search_field.bind('keydown.chosen', function(evt) {
|
656
|
+
_this.keydown_checker(evt);
|
657
|
+
});
|
658
|
+
this.search_field.bind('focus.chosen', function(evt) {
|
659
|
+
_this.input_focus(evt);
|
660
|
+
});
|
661
|
+
this.search_field.bind('cut.chosen', function(evt) {
|
662
|
+
_this.clipboard_event_checker(evt);
|
663
|
+
});
|
664
|
+
this.search_field.bind('paste.chosen', function(evt) {
|
665
|
+
_this.clipboard_event_checker(evt);
|
666
|
+
});
|
667
|
+
if (this.is_multiple) {
|
668
|
+
return this.search_choices.bind('click.chosen', function(evt) {
|
669
|
+
_this.choices_click(evt);
|
670
|
+
});
|
671
|
+
} else {
|
672
|
+
return this.container.bind('click.chosen', function(evt) {
|
673
|
+
evt.preventDefault();
|
674
|
+
});
|
675
|
+
}
|
676
|
+
};
|
677
|
+
|
678
|
+
Chosen.prototype.destroy = function() {
|
679
|
+
$(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
|
680
|
+
if (this.search_field[0].tabIndex) {
|
681
|
+
this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex;
|
682
|
+
}
|
683
|
+
this.container.remove();
|
684
|
+
this.form_field_jq.removeData('chosen');
|
685
|
+
return this.form_field_jq.show();
|
686
|
+
};
|
687
|
+
|
688
|
+
Chosen.prototype.search_field_disabled = function() {
|
689
|
+
this.is_disabled = this.form_field_jq[0].disabled;
|
690
|
+
if (this.is_disabled) {
|
691
|
+
this.container.addClass('chosen-disabled');
|
692
|
+
this.search_field[0].disabled = true;
|
693
|
+
if (!this.is_multiple) {
|
694
|
+
this.selected_item.unbind("focus.chosen", this.activate_action);
|
695
|
+
}
|
696
|
+
return this.close_field();
|
697
|
+
} else {
|
698
|
+
this.container.removeClass('chosen-disabled');
|
699
|
+
this.search_field[0].disabled = false;
|
700
|
+
if (!this.is_multiple) {
|
701
|
+
return this.selected_item.bind("focus.chosen", this.activate_action);
|
702
|
+
}
|
703
|
+
}
|
704
|
+
};
|
705
|
+
|
706
|
+
Chosen.prototype.container_mousedown = function(evt) {
|
707
|
+
if (!this.is_disabled) {
|
708
|
+
if (evt && evt.type === "mousedown" && !this.results_showing) {
|
709
|
+
evt.preventDefault();
|
710
|
+
}
|
711
|
+
if (!((evt != null) && ($(evt.target)).hasClass("search-choice-close"))) {
|
712
|
+
if (!this.active_field) {
|
713
|
+
if (this.is_multiple) {
|
714
|
+
this.search_field.val("");
|
715
|
+
}
|
716
|
+
$(this.container[0].ownerDocument).bind('click.chosen', this.click_test_action);
|
717
|
+
this.results_show();
|
718
|
+
} else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chosen-single").length)) {
|
719
|
+
evt.preventDefault();
|
720
|
+
this.results_toggle();
|
721
|
+
}
|
722
|
+
return this.activate_field();
|
723
|
+
}
|
724
|
+
}
|
725
|
+
};
|
726
|
+
|
727
|
+
Chosen.prototype.container_mouseup = function(evt) {
|
728
|
+
if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
|
729
|
+
return this.results_reset(evt);
|
730
|
+
}
|
731
|
+
};
|
732
|
+
|
733
|
+
Chosen.prototype.search_results_mousewheel = function(evt) {
|
734
|
+
var delta;
|
735
|
+
if (evt.originalEvent) {
|
736
|
+
delta = -evt.originalEvent.wheelDelta || evt.originalEvent.detail;
|
737
|
+
}
|
738
|
+
if (delta != null) {
|
739
|
+
evt.preventDefault();
|
740
|
+
if (evt.type === 'DOMMouseScroll') {
|
741
|
+
delta = delta * 40;
|
742
|
+
}
|
743
|
+
return this.search_results.scrollTop(delta + this.search_results.scrollTop());
|
744
|
+
}
|
745
|
+
};
|
746
|
+
|
747
|
+
Chosen.prototype.blur_test = function(evt) {
|
748
|
+
if (!this.active_field && this.container.hasClass("chosen-container-active")) {
|
749
|
+
return this.close_field();
|
750
|
+
}
|
751
|
+
};
|
752
|
+
|
753
|
+
Chosen.prototype.close_field = function() {
|
754
|
+
$(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
|
755
|
+
this.active_field = false;
|
756
|
+
this.results_hide();
|
757
|
+
this.container.removeClass("chosen-container-active");
|
758
|
+
this.clear_backstroke();
|
759
|
+
this.show_search_field_default();
|
760
|
+
return this.search_field_scale();
|
761
|
+
};
|
762
|
+
|
763
|
+
Chosen.prototype.activate_field = function() {
|
764
|
+
this.container.addClass("chosen-container-active");
|
765
|
+
this.active_field = true;
|
766
|
+
this.search_field.val(this.search_field.val());
|
767
|
+
return this.search_field.focus();
|
768
|
+
};
|
769
|
+
|
770
|
+
Chosen.prototype.test_active_click = function(evt) {
|
771
|
+
var active_container;
|
772
|
+
active_container = $(evt.target).closest('.chosen-container');
|
773
|
+
if (active_container.length && this.container[0] === active_container[0]) {
|
774
|
+
return this.active_field = true;
|
775
|
+
} else {
|
776
|
+
return this.close_field();
|
777
|
+
}
|
778
|
+
};
|
779
|
+
|
780
|
+
Chosen.prototype.results_build = function() {
|
781
|
+
this.parsing = true;
|
782
|
+
this.selected_option_count = null;
|
783
|
+
this.results_data = SelectParser.select_to_array(this.form_field);
|
784
|
+
if (this.is_multiple) {
|
785
|
+
this.search_choices.find("li.search-choice").remove();
|
786
|
+
} else if (!this.is_multiple) {
|
787
|
+
this.single_set_selected_text();
|
788
|
+
if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
|
789
|
+
this.search_field[0].readOnly = true;
|
790
|
+
this.container.addClass("chosen-container-single-nosearch");
|
791
|
+
} else {
|
792
|
+
this.search_field[0].readOnly = false;
|
793
|
+
this.container.removeClass("chosen-container-single-nosearch");
|
794
|
+
}
|
795
|
+
}
|
796
|
+
this.update_results_content(this.results_option_build({
|
797
|
+
first: true
|
798
|
+
}));
|
799
|
+
this.search_field_disabled();
|
800
|
+
this.show_search_field_default();
|
801
|
+
this.search_field_scale();
|
802
|
+
return this.parsing = false;
|
803
|
+
};
|
804
|
+
|
805
|
+
Chosen.prototype.result_do_highlight = function(el) {
|
806
|
+
var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
|
807
|
+
if (el.length) {
|
808
|
+
this.result_clear_highlight();
|
809
|
+
this.result_highlight = el;
|
810
|
+
this.result_highlight.addClass("highlighted");
|
811
|
+
maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
|
812
|
+
visible_top = this.search_results.scrollTop();
|
813
|
+
visible_bottom = maxHeight + visible_top;
|
814
|
+
high_top = this.result_highlight.position().top + this.search_results.scrollTop();
|
815
|
+
high_bottom = high_top + this.result_highlight.outerHeight();
|
816
|
+
if (high_bottom >= visible_bottom) {
|
817
|
+
return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
|
818
|
+
} else if (high_top < visible_top) {
|
819
|
+
return this.search_results.scrollTop(high_top);
|
820
|
+
}
|
821
|
+
}
|
822
|
+
};
|
823
|
+
|
824
|
+
Chosen.prototype.result_clear_highlight = function() {
|
825
|
+
if (this.result_highlight) {
|
826
|
+
this.result_highlight.removeClass("highlighted");
|
827
|
+
}
|
828
|
+
return this.result_highlight = null;
|
829
|
+
};
|
830
|
+
|
831
|
+
Chosen.prototype.results_show = function() {
|
832
|
+
if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
|
833
|
+
this.form_field_jq.trigger("chosen:maxselected", {
|
834
|
+
chosen: this
|
835
|
+
});
|
836
|
+
return false;
|
837
|
+
}
|
838
|
+
this.container.addClass("chosen-with-drop");
|
839
|
+
this.results_showing = true;
|
840
|
+
this.search_field.focus();
|
841
|
+
this.search_field.val(this.search_field.val());
|
842
|
+
this.winnow_results();
|
843
|
+
return this.form_field_jq.trigger("chosen:showing_dropdown", {
|
844
|
+
chosen: this
|
845
|
+
});
|
846
|
+
};
|
847
|
+
|
848
|
+
Chosen.prototype.update_results_content = function(content) {
|
849
|
+
return this.search_results.html(content);
|
850
|
+
};
|
851
|
+
|
852
|
+
Chosen.prototype.results_hide = function() {
|
853
|
+
if (this.results_showing) {
|
854
|
+
this.result_clear_highlight();
|
855
|
+
this.container.removeClass("chosen-with-drop");
|
856
|
+
this.form_field_jq.trigger("chosen:hiding_dropdown", {
|
857
|
+
chosen: this
|
858
|
+
});
|
859
|
+
}
|
860
|
+
return this.results_showing = false;
|
861
|
+
};
|
862
|
+
|
863
|
+
Chosen.prototype.set_tab_index = function(el) {
|
864
|
+
var ti;
|
865
|
+
if (this.form_field.tabIndex) {
|
866
|
+
ti = this.form_field.tabIndex;
|
867
|
+
this.form_field.tabIndex = -1;
|
868
|
+
return this.search_field[0].tabIndex = ti;
|
869
|
+
}
|
870
|
+
};
|
871
|
+
|
872
|
+
Chosen.prototype.set_label_behavior = function() {
|
873
|
+
var _this = this;
|
874
|
+
this.form_field_label = this.form_field_jq.parents("label");
|
875
|
+
if (!this.form_field_label.length && this.form_field.id.length) {
|
876
|
+
this.form_field_label = $("label[for='" + this.form_field.id + "']");
|
877
|
+
}
|
878
|
+
if (this.form_field_label.length > 0) {
|
879
|
+
return this.form_field_label.bind('click.chosen', function(evt) {
|
880
|
+
if (_this.is_multiple) {
|
881
|
+
return _this.container_mousedown(evt);
|
882
|
+
} else {
|
883
|
+
return _this.activate_field();
|
884
|
+
}
|
885
|
+
});
|
886
|
+
}
|
887
|
+
};
|
888
|
+
|
889
|
+
Chosen.prototype.show_search_field_default = function() {
|
890
|
+
if (this.is_multiple && this.choices_count() < 1 && !this.active_field) {
|
891
|
+
this.search_field.val(this.default_text);
|
892
|
+
return this.search_field.addClass("default");
|
893
|
+
} else {
|
894
|
+
this.search_field.val("");
|
895
|
+
return this.search_field.removeClass("default");
|
896
|
+
}
|
897
|
+
};
|
898
|
+
|
899
|
+
Chosen.prototype.search_results_mouseup = function(evt) {
|
900
|
+
var target;
|
901
|
+
target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
|
902
|
+
if (target.length) {
|
903
|
+
this.result_highlight = target;
|
904
|
+
this.result_select(evt);
|
905
|
+
return this.search_field.focus();
|
906
|
+
}
|
907
|
+
};
|
908
|
+
|
909
|
+
Chosen.prototype.search_results_mouseover = function(evt) {
|
910
|
+
var target;
|
911
|
+
target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
|
912
|
+
if (target) {
|
913
|
+
return this.result_do_highlight(target);
|
914
|
+
}
|
915
|
+
};
|
916
|
+
|
917
|
+
Chosen.prototype.search_results_mouseout = function(evt) {
|
918
|
+
if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
|
919
|
+
return this.result_clear_highlight();
|
920
|
+
}
|
921
|
+
};
|
922
|
+
|
923
|
+
Chosen.prototype.choice_build = function(item) {
|
924
|
+
var choice, close_link,
|
925
|
+
_this = this;
|
926
|
+
choice = $('<li />', {
|
927
|
+
"class": "search-choice"
|
928
|
+
}).html("<span>" + item.html + "</span>");
|
929
|
+
if (item.disabled) {
|
930
|
+
choice.addClass('search-choice-disabled');
|
931
|
+
} else {
|
932
|
+
close_link = $('<a />', {
|
933
|
+
"class": 'search-choice-close',
|
934
|
+
'data-option-array-index': item.array_index
|
935
|
+
});
|
936
|
+
close_link.bind('click.chosen', function(evt) {
|
937
|
+
return _this.choice_destroy_link_click(evt);
|
938
|
+
});
|
939
|
+
choice.append(close_link);
|
940
|
+
}
|
941
|
+
return this.search_container.before(choice);
|
942
|
+
};
|
943
|
+
|
944
|
+
Chosen.prototype.choice_destroy_link_click = function(evt) {
|
945
|
+
evt.preventDefault();
|
946
|
+
evt.stopPropagation();
|
947
|
+
if (!this.is_disabled) {
|
948
|
+
return this.choice_destroy($(evt.target));
|
949
|
+
}
|
950
|
+
};
|
951
|
+
|
952
|
+
Chosen.prototype.choice_destroy = function(link) {
|
953
|
+
if (this.result_deselect(link[0].getAttribute("data-option-array-index"))) {
|
954
|
+
this.show_search_field_default();
|
955
|
+
if (this.is_multiple && this.choices_count() > 0 && this.search_field.val().length < 1) {
|
956
|
+
this.results_hide();
|
957
|
+
}
|
958
|
+
link.parents('li').first().remove();
|
959
|
+
return this.search_field_scale();
|
960
|
+
}
|
961
|
+
};
|
962
|
+
|
963
|
+
Chosen.prototype.results_reset = function() {
|
964
|
+
this.reset_single_select_options();
|
965
|
+
this.form_field.options[0].selected = true;
|
966
|
+
this.single_set_selected_text();
|
967
|
+
this.show_search_field_default();
|
968
|
+
this.results_reset_cleanup();
|
969
|
+
this.form_field_jq.trigger("change");
|
970
|
+
if (this.active_field) {
|
971
|
+
return this.results_hide();
|
972
|
+
}
|
973
|
+
};
|
974
|
+
|
975
|
+
Chosen.prototype.results_reset_cleanup = function() {
|
976
|
+
this.current_selectedIndex = this.form_field.selectedIndex;
|
977
|
+
return this.selected_item.find("abbr").remove();
|
978
|
+
};
|
979
|
+
|
980
|
+
Chosen.prototype.result_select = function(evt) {
|
981
|
+
var high, item;
|
982
|
+
if (this.result_highlight) {
|
983
|
+
high = this.result_highlight;
|
984
|
+
this.result_clear_highlight();
|
985
|
+
if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
|
986
|
+
this.form_field_jq.trigger("chosen:maxselected", {
|
987
|
+
chosen: this
|
988
|
+
});
|
989
|
+
return false;
|
990
|
+
}
|
991
|
+
if (this.is_multiple) {
|
992
|
+
high.removeClass("active-result");
|
993
|
+
} else {
|
994
|
+
this.reset_single_select_options();
|
995
|
+
}
|
996
|
+
item = this.results_data[high[0].getAttribute("data-option-array-index")];
|
997
|
+
item.selected = true;
|
998
|
+
this.form_field.options[item.options_index].selected = true;
|
999
|
+
this.selected_option_count = null;
|
1000
|
+
if (this.is_multiple) {
|
1001
|
+
this.choice_build(item);
|
1002
|
+
} else {
|
1003
|
+
this.single_set_selected_text(item.text);
|
1004
|
+
}
|
1005
|
+
if (!((evt.metaKey || evt.ctrlKey) && this.is_multiple)) {
|
1006
|
+
this.results_hide();
|
1007
|
+
}
|
1008
|
+
this.search_field.val("");
|
1009
|
+
if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {
|
1010
|
+
this.form_field_jq.trigger("change", {
|
1011
|
+
'selected': this.form_field.options[item.options_index].value
|
1012
|
+
});
|
1013
|
+
}
|
1014
|
+
this.current_selectedIndex = this.form_field.selectedIndex;
|
1015
|
+
return this.search_field_scale();
|
1016
|
+
}
|
1017
|
+
};
|
1018
|
+
|
1019
|
+
Chosen.prototype.single_set_selected_text = function(text) {
|
1020
|
+
if (text == null) {
|
1021
|
+
text = this.default_text;
|
1022
|
+
}
|
1023
|
+
if (text === this.default_text) {
|
1024
|
+
this.selected_item.addClass("chosen-default");
|
1025
|
+
} else {
|
1026
|
+
this.single_deselect_control_build();
|
1027
|
+
this.selected_item.removeClass("chosen-default");
|
1028
|
+
}
|
1029
|
+
return this.selected_item.find("span").text(text);
|
1030
|
+
};
|
1031
|
+
|
1032
|
+
Chosen.prototype.result_deselect = function(pos) {
|
1033
|
+
var result_data;
|
1034
|
+
result_data = this.results_data[pos];
|
1035
|
+
if (!this.form_field.options[result_data.options_index].disabled) {
|
1036
|
+
result_data.selected = false;
|
1037
|
+
this.form_field.options[result_data.options_index].selected = false;
|
1038
|
+
this.selected_option_count = null;
|
1039
|
+
this.result_clear_highlight();
|
1040
|
+
if (this.results_showing) {
|
1041
|
+
this.winnow_results();
|
1042
|
+
}
|
1043
|
+
this.form_field_jq.trigger("change", {
|
1044
|
+
deselected: this.form_field.options[result_data.options_index].value
|
1045
|
+
});
|
1046
|
+
this.search_field_scale();
|
1047
|
+
return true;
|
1048
|
+
} else {
|
1049
|
+
return false;
|
1050
|
+
}
|
1051
|
+
};
|
1052
|
+
|
1053
|
+
Chosen.prototype.single_deselect_control_build = function() {
|
1054
|
+
if (!this.allow_single_deselect) {
|
1055
|
+
return;
|
1056
|
+
}
|
1057
|
+
if (!this.selected_item.find("abbr").length) {
|
1058
|
+
this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
|
1059
|
+
}
|
1060
|
+
return this.selected_item.addClass("chosen-single-with-deselect");
|
1061
|
+
};
|
1062
|
+
|
1063
|
+
Chosen.prototype.get_search_text = function() {
|
1064
|
+
if (this.search_field.val() === this.default_text) {
|
1065
|
+
return "";
|
1066
|
+
} else {
|
1067
|
+
return $('<div/>').text($.trim(this.search_field.val())).html();
|
1068
|
+
}
|
1069
|
+
};
|
1070
|
+
|
1071
|
+
Chosen.prototype.winnow_results_set_highlight = function() {
|
1072
|
+
var do_high, selected_results;
|
1073
|
+
selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
|
1074
|
+
do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
|
1075
|
+
if (do_high != null) {
|
1076
|
+
return this.result_do_highlight(do_high);
|
1077
|
+
}
|
1078
|
+
};
|
1079
|
+
|
1080
|
+
Chosen.prototype.no_results = function(terms) {
|
1081
|
+
var no_results_html;
|
1082
|
+
no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
|
1083
|
+
no_results_html.find("span").first().html(terms);
|
1084
|
+
this.search_results.append(no_results_html);
|
1085
|
+
return this.form_field_jq.trigger("chosen:no_results", {
|
1086
|
+
chosen: this
|
1087
|
+
});
|
1088
|
+
};
|
1089
|
+
|
1090
|
+
Chosen.prototype.no_results_clear = function() {
|
1091
|
+
return this.search_results.find(".no-results").remove();
|
1092
|
+
};
|
1093
|
+
|
1094
|
+
Chosen.prototype.keydown_arrow = function() {
|
1095
|
+
var next_sib;
|
1096
|
+
if (this.results_showing && this.result_highlight) {
|
1097
|
+
next_sib = this.result_highlight.nextAll("li.active-result").first();
|
1098
|
+
if (next_sib) {
|
1099
|
+
return this.result_do_highlight(next_sib);
|
1100
|
+
}
|
1101
|
+
} else {
|
1102
|
+
return this.results_show();
|
1103
|
+
}
|
1104
|
+
};
|
1105
|
+
|
1106
|
+
Chosen.prototype.keyup_arrow = function() {
|
1107
|
+
var prev_sibs;
|
1108
|
+
if (!this.results_showing && !this.is_multiple) {
|
1109
|
+
return this.results_show();
|
1110
|
+
} else if (this.result_highlight) {
|
1111
|
+
prev_sibs = this.result_highlight.prevAll("li.active-result");
|
1112
|
+
if (prev_sibs.length) {
|
1113
|
+
return this.result_do_highlight(prev_sibs.first());
|
1114
|
+
} else {
|
1115
|
+
if (this.choices_count() > 0) {
|
1116
|
+
this.results_hide();
|
1117
|
+
}
|
1118
|
+
return this.result_clear_highlight();
|
1119
|
+
}
|
1120
|
+
}
|
1121
|
+
};
|
1122
|
+
|
1123
|
+
Chosen.prototype.keydown_backstroke = function() {
|
1124
|
+
var next_available_destroy;
|
1125
|
+
if (this.pending_backstroke) {
|
1126
|
+
this.choice_destroy(this.pending_backstroke.find("a").first());
|
1127
|
+
return this.clear_backstroke();
|
1128
|
+
} else {
|
1129
|
+
next_available_destroy = this.search_container.siblings("li.search-choice").last();
|
1130
|
+
if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
|
1131
|
+
this.pending_backstroke = next_available_destroy;
|
1132
|
+
if (this.single_backstroke_delete) {
|
1133
|
+
return this.keydown_backstroke();
|
1134
|
+
} else {
|
1135
|
+
return this.pending_backstroke.addClass("search-choice-focus");
|
1136
|
+
}
|
1137
|
+
}
|
1138
|
+
}
|
1139
|
+
};
|
1140
|
+
|
1141
|
+
Chosen.prototype.clear_backstroke = function() {
|
1142
|
+
if (this.pending_backstroke) {
|
1143
|
+
this.pending_backstroke.removeClass("search-choice-focus");
|
1144
|
+
}
|
1145
|
+
return this.pending_backstroke = null;
|
1146
|
+
};
|
1147
|
+
|
1148
|
+
Chosen.prototype.keydown_checker = function(evt) {
|
1149
|
+
var stroke, _ref1;
|
1150
|
+
stroke = (_ref1 = evt.which) != null ? _ref1 : evt.keyCode;
|
1151
|
+
this.search_field_scale();
|
1152
|
+
if (stroke !== 8 && this.pending_backstroke) {
|
1153
|
+
this.clear_backstroke();
|
1154
|
+
}
|
1155
|
+
switch (stroke) {
|
1156
|
+
case 8:
|
1157
|
+
this.backstroke_length = this.search_field.val().length;
|
1158
|
+
break;
|
1159
|
+
case 9:
|
1160
|
+
if (this.results_showing && !this.is_multiple) {
|
1161
|
+
this.result_select(evt);
|
1162
|
+
}
|
1163
|
+
this.mouse_on_container = false;
|
1164
|
+
break;
|
1165
|
+
case 13:
|
1166
|
+
evt.preventDefault();
|
1167
|
+
break;
|
1168
|
+
case 38:
|
1169
|
+
evt.preventDefault();
|
1170
|
+
this.keyup_arrow();
|
1171
|
+
break;
|
1172
|
+
case 40:
|
1173
|
+
evt.preventDefault();
|
1174
|
+
this.keydown_arrow();
|
1175
|
+
break;
|
1176
|
+
}
|
1177
|
+
};
|
1178
|
+
|
1179
|
+
Chosen.prototype.search_field_scale = function() {
|
1180
|
+
var div, f_width, h, style, style_block, styles, w, _i, _len;
|
1181
|
+
if (this.is_multiple) {
|
1182
|
+
h = 0;
|
1183
|
+
w = 0;
|
1184
|
+
style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
|
1185
|
+
styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
|
1186
|
+
for (_i = 0, _len = styles.length; _i < _len; _i++) {
|
1187
|
+
style = styles[_i];
|
1188
|
+
style_block += style + ":" + this.search_field.css(style) + ";";
|
1189
|
+
}
|
1190
|
+
div = $('<div />', {
|
1191
|
+
'style': style_block
|
1192
|
+
});
|
1193
|
+
div.text(this.search_field.val());
|
1194
|
+
$('body').append(div);
|
1195
|
+
w = div.width() + 25;
|
1196
|
+
div.remove();
|
1197
|
+
f_width = this.container.outerWidth();
|
1198
|
+
if (w > f_width - 10) {
|
1199
|
+
w = f_width - 10;
|
1200
|
+
}
|
1201
|
+
return this.search_field.css({
|
1202
|
+
'width': w + 'px'
|
1203
|
+
});
|
1204
|
+
}
|
1205
|
+
};
|
1206
|
+
|
1207
|
+
return Chosen;
|
1208
|
+
|
1209
|
+
})(AbstractChosen);
|
1210
|
+
|
1211
|
+
}).call(this);
|