blacklight-spotlight 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +13 -0
- data/app/models/spotlight/blacklight_configuration.rb +4 -0
- data/lib/spotlight/version.rb +1 -1
- data/spec/internal/Gemfile.lock +3 -3
- data/spec/internal/config/initializers/blacklight_initializer.rb +1 -1
- data/spec/internal/config/initializers/devise.rb +2 -2
- data/spec/internal/config/secrets.yml +2 -2
- data/spec/internal/db/development.sqlite3 +0 -0
- data/spec/internal/db/migrate/{20150302231312_devise_create_users.rb → 20150303163352_devise_create_users.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231315_add_devise_guests_to_users.rb → 20150303163354_add_devise_guests_to_users.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231317_create_searches.blacklight.rb → 20150303163356_create_searches.blacklight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231318_create_bookmarks.blacklight.rb → 20150303163357_create_bookmarks.blacklight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231319_add_polymorphic_type_to_bookmarks.blacklight.rb → 20150303163358_add_polymorphic_type_to_bookmarks.blacklight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231320_create_spotlight_pages.spotlight.rb → 20150303163359_create_spotlight_pages.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231321_create_spotlight_attachments.spotlight.rb → 20150303163360_create_spotlight_attachments.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231322_create_exhibits.spotlight.rb → 20150303163361_create_exhibits.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231323_create_roles.spotlight.rb → 20150303163362_create_roles.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231324_create_spotlight_searches.spotlight.rb → 20150303163363_create_spotlight_searches.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231325_create_spotlight_blacklight_configurations.spotlight.rb → 20150303163364_create_spotlight_blacklight_configurations.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231326_acts_as_taggable_on_migration.spotlight.rb → 20150303163365_acts_as_taggable_on_migration.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231327_add_missing_unique_indices.spotlight.rb → 20150303163366_add_missing_unique_indices.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231328_create_spotlight_custom_fields.spotlight.rb → 20150303163367_create_spotlight_custom_fields.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231329_create_spotlight_solr_document_sidecars.spotlight.rb → 20150303163368_create_spotlight_solr_document_sidecars.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231330_create_contacts.spotlight.rb → 20150303163369_create_contacts.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231331_create_contact_emails.spotlight.rb → 20150303163370_create_contact_emails.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231332_create_resources.spotlight.rb → 20150303163371_create_resources.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231333_change_featured_image_to_featured_image_id.spotlight.rb → 20150303163372_change_featured_image_to_featured_image_id.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231334_create_spotlight_main_navigations.spotlight.rb → 20150303163373_create_spotlight_main_navigations.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231335_create_locks.spotlight.rb → 20150303163374_create_locks.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231336_change_contact_details.spotlight.rb → 20150303163375_change_contact_details.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231337_add_avatar_to_contacts.spotlight.rb → 20150303163376_add_avatar_to_contacts.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231338_add_layout_options_to_exhibit.spotlight.rb → 20150303163377_add_layout_options_to_exhibit.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231339_add_published_to_exhibit.spotlight.rb → 20150303163378_add_published_to_exhibit.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231340_add_featured_image_to_exhibit.spotlight.rb → 20150303163379_add_featured_image_to_exhibit.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231341_add_polymorphic_document_to_sidecars.spotlight.rb → 20150303163380_add_polymorphic_document_to_sidecars.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231342_add_spotlight_mastheads.spotlight.rb → 20150303163381_add_spotlight_mastheads.spotlight.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231343_create_friendly_id_slugs.rb → 20150303163407_create_friendly_id_slugs.rb} +0 -0
- data/spec/internal/db/migrate/{20150302231344_create_versions.rb → 20150303163409_create_versions.rb} +0 -0
- data/spec/internal/db/schema.rb +1 -1
- data/spec/internal/db/test.sqlite3 +0 -0
- data/spec/internal/log/development.log +3586 -2027
- data/spec/internal/tmp/cache/assets/development/sass/{007bfad038ba59a89adccfee876c3a437a06e89b → 1625e311b3e574e60af442d0ee5b9d9d62b6c904}/_gallery.scssc +0 -0
- data/spec/internal/tmp/cache/assets/development/sass/1625e311b3e574e60af442d0ee5b9d9d62b6c904/_masonry.scssc +0 -0
- data/spec/internal/tmp/cache/assets/development/sass/{007bfad038ba59a89adccfee876c3a437a06e89b → 1625e311b3e574e60af442d0ee5b9d9d62b6c904}/_osd_viewer.scssc +0 -0
- data/spec/internal/tmp/cache/assets/development/sass/{007bfad038ba59a89adccfee876c3a437a06e89b → 1625e311b3e574e60af442d0ee5b9d9d62b6c904}/_slideshow.scssc +0 -0
- data/spec/internal/tmp/cache/assets/development/sass/1625e311b3e574e60af442d0ee5b9d9d62b6c904/default.scssc +0 -0
- data/spec/internal/tmp/cache/assets/development/sass/6ed822959e676d3d5757149889716c9b4de6ad94/_header.scssc +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/0962b612819d514f3eccdcbe6583c525 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/0fc0dc453efeacf2f9c3eb2c2acbc842 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/1dd662795508e53ee8c729e1db43f549 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/{0a6996ef3dfd1037cbce95226dbe77b2 → 21dec311633007a565871064ff20b46d} +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/26d7989e05275d611cddd16311b9a914 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/27e2ddfb2da21c713e09de9a69bd693a +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/2a75ccd35c2326a91542c9700e60593f +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/2c8ba32cbbfe03bd9a12cdb5e9155b7f +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/2e74f2f097a9d0ce88e4a7645002a771 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/3b43407a69b12db10b185055b6674784 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/{082b8f454f3b3b9b43119dc95b481bcc → 48972c9f4330661254578c59c93c2198} +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/49c105a8be35fc4290d59be5a1433911 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/{00ea4281dfb032bfa9a4846fc03eb5f0 → 4f503262ac95ce046d09307dd5e3b3dc} +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/58007042423d4d00d64b4783d4eb298f +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/585ae9ce2c7aaeaef517e31fb5f5deab +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/58d7eb11ce5bdb9feb18bcec0c40967e +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/59074a780ceb9cddb029bbd0bbc87be5 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/{9b012237694b7c582f730b0c5c1896a3 → 62ca5a083548f524d4e1687b7093ba29} +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/63982c992f5278c4b623231ef9ab0eef +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/66f8fc3b5bbf1829a95239083e9abdb9 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/6750b2dde04e8e3fe6b9bee3b65b61e0 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/{e0e248fc5ddfa19adca682cfabcd2e28 → 69cbb2e4b0d50d0c1c37c8236b9d8a19} +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/{878997c85a72d912f5a037dca7b3f87c → 7046e45683f590170d97ca6746f51ac0} +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/{3d50c3b49d6402f6412754f3b8f68dd2 → 71a8f988cdccf1c0f3b7a7e0adb4f5fb} +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/72f1e4baf7acc7c7cdb19af990491436 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/7534f6b512681a563a114c9f019fae93 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/79bea20297d19c854fd89bec41627417 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/{d680afa442c4247864f833541a432304 → 7c0e1c70a7a7dd0afe1798eebc623088} +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/82ffbbf5dc7c1019b55a196789747bcf +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/872b2a01f03690d0f86481b1e1a12d4f +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/88ac23cb21a6625ef98c905ebf3bae36 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/9198f9e8e7b927f5a839343eb223627b +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/91b396b480293aaeec2ff599af929465 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/{e5baf2ffca671001462c50d3785429ed → 9268d5e57c7585cf335c837ad37c1da3} +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/93aaa9231a32901266b05632f3d35ecd +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/{38f6972672b52d51c3ca51d2c04ee5b9 → 9787661b38895f00797936e29f5e165b} +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/9a9d607bd282c86761f4c0522e98459c +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/a0c35895c526b4a7bec46d5e2f5e90f9 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/{ae7a3375e7492516ea717101bf30e70e → a87fd6eb2a5fdf63faa8cf3967fc22a0} +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/{e17abe9c3aad2f81de9aa1f1d70d0ad6 → a9266e16972058d0b24becb493e46e2c} +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/ac7bd3e5d0a800cf2d4c8a16ab3353b6 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/ad4a54c43c2a4c3874bfde1c9f08c248 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/ad8670c368f9bd03ee30e10c08c3c515 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/b89461ef450cbd9ee6c695fecb44fcc8 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/bbe56b1188e940f75968817b6ee5f328 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/c1bb841270448425a11db861d5808ed5 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/c51554e0c757cdcb9749b20480c2c49d +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/cc9b1242f0b2bd5d696f6a2f2349ae8a +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/d0358a6b91806c2bda2ec9cbd39355d3 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/d26c008d41750ad1d89b6064cf840e53 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/d27a487fde53c12475c487dfda522219 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/d39f4d7318c8582cc6be7aee47e4afad +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/d9c357f3a9839adc19baa7a2ed38f10b +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/dbd348e834265fd900d1ad87ac526e0b +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/dfe09e37adb766551a29201928e85416 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/{6c0202b6f4ed910f48406a2c59b96910 → e319bba5826aee94ff4471b80a50f52d} +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/e4b98bbf98e5ced801ffafe2f11ab631 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/e7e24f9e9a94109161ca736960a76698 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/ea7de405fbbd8e79e27ebce6a7460634 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/f0e73327cfc345e14534746797a5fd1f +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/f1a626976e6c492bdb0d1af05ccebae1 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/f5bd213bb96dfd950c8a8669fdd2fee1 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/fed43bc1912cdb19dfa4ab32cf796814 +0 -0
- data/spec/models/spotlight/blacklight_configuration_spec.rb +11 -0
- data/vendor/assets/javascripts/bootstrap-tagsinput.js +530 -0
- data/vendor/assets/javascripts/handlebars-v1.3.0.js +2746 -0
- data/vendor/assets/javascripts/jquery.waitforimages.min.js +2 -0
- data/vendor/assets/javascripts/nestable.js +645 -0
- data/vendor/assets/javascripts/sir-trevor.js +11947 -0
- data/vendor/assets/javascripts/typeahead.bundle.min.js +7 -0
- data/vendor/assets/stylesheets/bootstrap-tagsinput.css +46 -0
- data/vendor/assets/stylesheets/sir-trevor-icons.css +6 -0
- data/vendor/assets/stylesheets/sir-trevor.css +505 -0
- metadata +147 -233
- data/spec/internal/tmp/cache/assets/development/sass/007bfad038ba59a89adccfee876c3a437a06e89b/default.scssc +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/0ac603422eb301f66a676ece9e09237b +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/0b52c9779134a8e4aca07942b257d769 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/0e530b813de8cf2d475c85ca053f6494 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/1482ad001b55da17d2376fced762405c +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/197ae4d993e7086d2eb6c9c1534c1338 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/1ab69aa2d1b843568bf369f7754427b3 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/23d9c45a0d2bd8aa81371a6d9699d47f +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/285bb215c08989a64c7b04c3d0b9416f +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/29552ff7de6f7cf31a4ad3b487ed83b1 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/2a1b90837d7deaa28cb0cd8fd48d46cd +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/3d5cf5c06bd13366e1529e29b9c9aab2 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/3f6512eecb81fc5109f8525b86ff0c39 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/4b78632f035b14c02c08dabe96c5719f +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/4ccbdd87f2c58d06e759b0170bd032c6 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/4e97c05116c6c88e4155778dc782a728 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/50b1062798389cc230e12d74dac8abfb +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/569ea9e25342e930132882b8a33acb90 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/56c4f2c8b0f33093a14aa209e7096cae +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/598f37b6258fe8342c6ff6ef4cae3610 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/5ac87ac38c1a33107476cbf7536b6c4e +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/5fce11d1861c4531209e84917b299da1 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/63c5aeb60881a6944e88aadffc888610 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/6affba8d045789379abbca581552721e +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/6c4d1cfcea8ceb31e05fef0d21a676d1 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/710cac84acbc3fbcdc31a9d72a20cbc5 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/718f92def8fdbd038b8ad41d90c0a03c +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/730b1ab7ef91eceb501f8b5a2e16ceea +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/76b43bd6a99fa243324f7ab1745d0dad +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/783095ea9d7ae156a7fe4296d215c389 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/78ec12dea3f6814541f1714f12a50cbe +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/79453e286d34eec57491e2689f152576 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/7f9d183de3e3aaba2fb91a253c82e8ff +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/8122b30c241cada8d0fd1ffe8ba5df97 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/855c7b53a2dbd3ca20fd13d68d61083b +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/85b92289cf2d32ab46f22e2e9e594180 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/8617a93f3627883914dd46896988d872 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/8e0e1643243abb723143aa82d2e01b14 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/912439ae82f977056111749fb5685544 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/9170af56c04f9ea63ea7c43ec943884d +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/9637356c49c94756bd869040094d2819 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/9ffd880bbb95946077cee20975a45334 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/a6c43ee47213bd2e8ecf079f20213e99 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/a7d54f82dd80700f3415d29c0317eac3 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/a9c6519419b33989eb895c3ec1c46b8c +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/ad57e4dc2125299b0bf78368c3affe2d +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/b170d80fcd8f2f6b71c72b185bda8144 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/b5572ee76709f2b4b75d8bd788fee83a +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/b68ee86b3c392a0bc54dc07890df5aaf +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/b7cabb4f68d7eff8eab5cc65fe9f372f +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/bb9265f79a0c7e1d30eb7149227ae545 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/bfec4861bd590b7777783931014ec6c4 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/c106381e2f65fe22c7eb958a714eea00 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/c43f4b3870e7fde6355f1224bac27f57 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/cdf781a877c0d80e6aa980d590c9ea0e +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/cf60af83c803e52d6c06f0d562cdc238 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/d026a365a4229145fc07e10338ab6c34 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/d0d3aa8d8965189e0dd63de196811274 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/d14672da1eb95bcb002940db40d8af2f +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/d7169f94145735839c5997e916f770b3 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/d83d0b54ff07dec55904095f97c91923 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/dd1f54630bfc96a78c8d74354eaf5626 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/ecce95752935de663567612e362bb5af +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/ee234c06a113124f3a40908d0b8a9529 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/ef34d43e05495673836bdd6e70514aa6 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/f2a30a183248e8448b375637c4495617 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/f39a11a2a5f3f365b8a6ba53a74eca62 +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/fc691d7c0204f44b96ebb16cf7e1b7cf +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/ff59f2db79507800737f7d65923b20fb +0 -0
- data/spec/internal/tmp/cache/assets/development/sprockets/ff79224e9955773ad292fb8bf1bd8c6d +0 -0
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -89,6 +89,11 @@ describe Spotlight::BlacklightConfiguration, :type => :model do
|
|
89
89
|
expect(subject.blacklight_config.index_fields['c'].list).to be_truthy
|
90
90
|
end
|
91
91
|
|
92
|
+
it "should filter upstream fields that are always disabled" do
|
93
|
+
blacklight_config.add_index_field 'a', if: false
|
94
|
+
expect(subject.blacklight_config.index_fields).not_to have_key 'a'
|
95
|
+
end
|
96
|
+
|
92
97
|
it "should filter blank values" do
|
93
98
|
subject.index_fields['title'] = { something: "" }
|
94
99
|
subject.valid?
|
@@ -118,6 +123,12 @@ describe Spotlight::BlacklightConfiguration, :type => :model do
|
|
118
123
|
expect(subject.blacklight_config.index_fields['a'].show).to be_truthy
|
119
124
|
expect(subject.blacklight_config.index_fields['a'].list).to be_falsey
|
120
125
|
end
|
126
|
+
|
127
|
+
it "should filter show fields that are always disabled" do
|
128
|
+
blacklight_config.add_show_field 'a', if: false
|
129
|
+
expect(subject.blacklight_config.index_fields).not_to have_key 'a'
|
130
|
+
end
|
131
|
+
|
121
132
|
|
122
133
|
context "custom fields" do
|
123
134
|
it "should include any custom fields" do
|
@@ -0,0 +1,530 @@
|
|
1
|
+
/* From https://github.com/TimSchlechter/bootstrap-tagsinput/blob/2661784c2c281d3a69b93897ff3f39e4ffa5cbd1/dist/bootstrap-tagsinput.js */
|
2
|
+
|
3
|
+
/* The MIT License (MIT)
|
4
|
+
|
5
|
+
Copyright (c) 2013 Tim Schlechter
|
6
|
+
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
8
|
+
this software and associated documentation files (the "Software"), to deal in
|
9
|
+
the Software without restriction, including without limitation the rights to
|
10
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
11
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
12
|
+
subject to the following conditions:
|
13
|
+
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
15
|
+
copies or substantial portions of the Software.
|
16
|
+
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
19
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
20
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
21
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
22
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
*/
|
24
|
+
|
25
|
+
/* Retrieved 12 February 2014 */
|
26
|
+
|
27
|
+
(function ($) {
|
28
|
+
"use strict";
|
29
|
+
|
30
|
+
var defaultOptions = {
|
31
|
+
tagClass: function(item) {
|
32
|
+
return 'label label-info';
|
33
|
+
},
|
34
|
+
itemValue: function(item) {
|
35
|
+
return item ? item.toString() : item;
|
36
|
+
},
|
37
|
+
itemText: function(item) {
|
38
|
+
return this.itemValue(item);
|
39
|
+
},
|
40
|
+
freeInput: true,
|
41
|
+
maxTags: undefined,
|
42
|
+
confirmKeys: [13],
|
43
|
+
onTagExists: function(item, $tag) {
|
44
|
+
$tag.hide().fadeIn();
|
45
|
+
}
|
46
|
+
};
|
47
|
+
|
48
|
+
/**
|
49
|
+
* Constructor function
|
50
|
+
*/
|
51
|
+
function TagsInput(element, options) {
|
52
|
+
this.itemsArray = [];
|
53
|
+
|
54
|
+
this.$element = $(element);
|
55
|
+
this.$element.hide();
|
56
|
+
|
57
|
+
this.isSelect = (element.tagName === 'SELECT');
|
58
|
+
this.multiple = (this.isSelect && element.hasAttribute('multiple'));
|
59
|
+
this.objectItems = options && options.itemValue;
|
60
|
+
this.placeholderText = element.hasAttribute('placeholder') ? this.$element.attr('placeholder') : '';
|
61
|
+
this.inputSize = Math.max(1, this.placeholderText.length);
|
62
|
+
|
63
|
+
this.$container = $('<div class="bootstrap-tagsinput"></div>');
|
64
|
+
this.$input = $('<input size="' + this.inputSize + '" type="text" placeholder="' + this.placeholderText + '"/>').appendTo(this.$container);
|
65
|
+
|
66
|
+
this.$element.after(this.$container);
|
67
|
+
|
68
|
+
this.build(options);
|
69
|
+
}
|
70
|
+
|
71
|
+
TagsInput.prototype = {
|
72
|
+
constructor: TagsInput,
|
73
|
+
|
74
|
+
/**
|
75
|
+
* Adds the given item as a new tag. Pass true to dontPushVal to prevent
|
76
|
+
* updating the elements val()
|
77
|
+
*/
|
78
|
+
add: function(item, dontPushVal) {
|
79
|
+
var self = this;
|
80
|
+
|
81
|
+
if (self.options.maxTags && self.itemsArray.length >= self.options.maxTags)
|
82
|
+
return;
|
83
|
+
|
84
|
+
// Ignore falsey values, except false
|
85
|
+
if (item !== false && !item)
|
86
|
+
return;
|
87
|
+
|
88
|
+
// Throw an error when trying to add an object while the itemValue option was not set
|
89
|
+
if (typeof item === "object" && !self.objectItems)
|
90
|
+
throw("Can't add objects when itemValue option is not set");
|
91
|
+
|
92
|
+
// Ignore strings only containg whitespace
|
93
|
+
if (item.toString().match(/^\s*$/))
|
94
|
+
return;
|
95
|
+
|
96
|
+
// If SELECT but not multiple, remove current tag
|
97
|
+
if (self.isSelect && !self.multiple && self.itemsArray.length > 0)
|
98
|
+
self.remove(self.itemsArray[0]);
|
99
|
+
|
100
|
+
if (typeof item === "string" && this.$element[0].tagName === 'INPUT') {
|
101
|
+
var items = item.split(',');
|
102
|
+
if (items.length > 1) {
|
103
|
+
for (var i = 0; i < items.length; i++) {
|
104
|
+
this.add(items[i], true);
|
105
|
+
}
|
106
|
+
|
107
|
+
if (!dontPushVal)
|
108
|
+
self.pushVal();
|
109
|
+
return;
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
var itemValue = self.options.itemValue(item),
|
114
|
+
itemText = self.options.itemText(item),
|
115
|
+
tagClass = self.options.tagClass(item);
|
116
|
+
|
117
|
+
// Ignore items allready added
|
118
|
+
var existing = $.grep(self.itemsArray, function(item) { return self.options.itemValue(item) === itemValue; } )[0];
|
119
|
+
if (existing) {
|
120
|
+
// Invoke onTagExists
|
121
|
+
if (self.options.onTagExists) {
|
122
|
+
var $existingTag = $(".tag", self.$container).filter(function() { return $(this).data("item") === existing; });
|
123
|
+
self.options.onTagExists(item, $existingTag);
|
124
|
+
}
|
125
|
+
return;
|
126
|
+
}
|
127
|
+
|
128
|
+
// register item in internal array and map
|
129
|
+
self.itemsArray.push(item);
|
130
|
+
|
131
|
+
// add a tag element
|
132
|
+
var $tag = $('<span class="tag ' + htmlEncode(tagClass) + '">' + htmlEncode(itemText) + '<span data-role="remove"></span></span>');
|
133
|
+
$tag.data('item', item);
|
134
|
+
self.findInputWrapper().before($tag);
|
135
|
+
$tag.after(' ');
|
136
|
+
|
137
|
+
// add <option /> if item represents a value not present in one of the <select />'s options
|
138
|
+
if (self.isSelect && !$('option[value="' + escape(itemValue) + '"]',self.$element)[0]) {
|
139
|
+
var $option = $('<option selected>' + htmlEncode(itemText) + '</option>');
|
140
|
+
$option.data('item', item);
|
141
|
+
$option.attr('value', itemValue);
|
142
|
+
self.$element.append($option);
|
143
|
+
}
|
144
|
+
|
145
|
+
if (!dontPushVal)
|
146
|
+
self.pushVal();
|
147
|
+
|
148
|
+
// Add class when reached maxTags
|
149
|
+
if (self.options.maxTags === self.itemsArray.length)
|
150
|
+
self.$container.addClass('bootstrap-tagsinput-max');
|
151
|
+
|
152
|
+
self.$element.trigger($.Event('itemAdded', { item: item }));
|
153
|
+
},
|
154
|
+
|
155
|
+
/**
|
156
|
+
* Removes the given item. Pass true to dontPushVal to prevent updating the
|
157
|
+
* elements val()
|
158
|
+
*/
|
159
|
+
remove: function(item, dontPushVal) {
|
160
|
+
var self = this;
|
161
|
+
|
162
|
+
if (self.objectItems) {
|
163
|
+
if (typeof item === "object")
|
164
|
+
item = $.grep(self.itemsArray, function(other) { return self.options.itemValue(other) == self.options.itemValue(item); } )[0];
|
165
|
+
else
|
166
|
+
item = $.grep(self.itemsArray, function(other) { return self.options.itemValue(other) == item; } )[0];
|
167
|
+
}
|
168
|
+
|
169
|
+
if (item) {
|
170
|
+
$('.tag', self.$container).filter(function() { return $(this).data('item') === item; }).remove();
|
171
|
+
$('option', self.$element).filter(function() { return $(this).data('item') === item; }).remove();
|
172
|
+
self.itemsArray.splice($.inArray(item, self.itemsArray), 1);
|
173
|
+
}
|
174
|
+
|
175
|
+
if (!dontPushVal)
|
176
|
+
self.pushVal();
|
177
|
+
|
178
|
+
// Remove class when reached maxTags
|
179
|
+
if (self.options.maxTags > self.itemsArray.length)
|
180
|
+
self.$container.removeClass('bootstrap-tagsinput-max');
|
181
|
+
|
182
|
+
self.$element.trigger($.Event('itemRemoved', { item: item }));
|
183
|
+
},
|
184
|
+
|
185
|
+
/**
|
186
|
+
* Removes all items
|
187
|
+
*/
|
188
|
+
removeAll: function() {
|
189
|
+
var self = this;
|
190
|
+
|
191
|
+
$('.tag', self.$container).remove();
|
192
|
+
$('option', self.$element).remove();
|
193
|
+
|
194
|
+
while(self.itemsArray.length > 0)
|
195
|
+
self.itemsArray.pop();
|
196
|
+
|
197
|
+
self.pushVal();
|
198
|
+
|
199
|
+
if (self.options.maxTags && !this.isEnabled())
|
200
|
+
this.enable();
|
201
|
+
},
|
202
|
+
|
203
|
+
/**
|
204
|
+
* Refreshes the tags so they match the text/value of their corresponding
|
205
|
+
* item.
|
206
|
+
*/
|
207
|
+
refresh: function() {
|
208
|
+
var self = this;
|
209
|
+
$('.tag', self.$container).each(function() {
|
210
|
+
var $tag = $(this),
|
211
|
+
item = $tag.data('item'),
|
212
|
+
itemValue = self.options.itemValue(item),
|
213
|
+
itemText = self.options.itemText(item),
|
214
|
+
tagClass = self.options.tagClass(item);
|
215
|
+
|
216
|
+
// Update tag's class and inner text
|
217
|
+
$tag.attr('class', null);
|
218
|
+
$tag.addClass('tag ' + htmlEncode(tagClass));
|
219
|
+
$tag.contents().filter(function() {
|
220
|
+
return this.nodeType == 3;
|
221
|
+
})[0].nodeValue = htmlEncode(itemText);
|
222
|
+
|
223
|
+
if (self.isSelect) {
|
224
|
+
var option = $('option', self.$element).filter(function() { return $(this).data('item') === item; });
|
225
|
+
option.attr('value', itemValue);
|
226
|
+
}
|
227
|
+
});
|
228
|
+
},
|
229
|
+
|
230
|
+
/**
|
231
|
+
* Returns the items added as tags
|
232
|
+
*/
|
233
|
+
items: function() {
|
234
|
+
return this.itemsArray;
|
235
|
+
},
|
236
|
+
|
237
|
+
/**
|
238
|
+
* Assembly value by retrieving the value of each item, and set it on the
|
239
|
+
* element.
|
240
|
+
*/
|
241
|
+
pushVal: function() {
|
242
|
+
var self = this,
|
243
|
+
val = $.map(self.items(), function(item) {
|
244
|
+
return self.options.itemValue(item).toString();
|
245
|
+
});
|
246
|
+
|
247
|
+
self.$element.val(val, true).trigger('change');
|
248
|
+
},
|
249
|
+
|
250
|
+
/**
|
251
|
+
* Initializes the tags input behaviour on the element
|
252
|
+
*/
|
253
|
+
build: function(options) {
|
254
|
+
var self = this;
|
255
|
+
|
256
|
+
self.options = $.extend({}, defaultOptions, options);
|
257
|
+
var typeahead = self.options.typeahead || {};
|
258
|
+
|
259
|
+
// When itemValue is set, freeInput should always be false
|
260
|
+
if (self.objectItems)
|
261
|
+
self.options.freeInput = false;
|
262
|
+
|
263
|
+
makeOptionItemFunction(self.options, 'itemValue');
|
264
|
+
makeOptionItemFunction(self.options, 'itemText');
|
265
|
+
makeOptionItemFunction(self.options, 'tagClass');
|
266
|
+
|
267
|
+
// for backwards compatibility, self.options.source is deprecated
|
268
|
+
if (self.options.source)
|
269
|
+
typeahead.source = self.options.source;
|
270
|
+
|
271
|
+
if (typeahead.source && $.fn.typeahead) {
|
272
|
+
makeOptionFunction(typeahead, 'source');
|
273
|
+
|
274
|
+
self.$input.typeahead({
|
275
|
+
source: function (query, process) {
|
276
|
+
function processItems(items) {
|
277
|
+
var texts = [];
|
278
|
+
|
279
|
+
for (var i = 0; i < items.length; i++) {
|
280
|
+
var text = self.options.itemText(items[i]);
|
281
|
+
map[text] = items[i];
|
282
|
+
texts.push(text);
|
283
|
+
}
|
284
|
+
process(texts);
|
285
|
+
}
|
286
|
+
|
287
|
+
this.map = {};
|
288
|
+
var map = this.map,
|
289
|
+
data = typeahead.source(query);
|
290
|
+
|
291
|
+
if ($.isFunction(data.success)) {
|
292
|
+
// support for Angular promises
|
293
|
+
data.success(processItems);
|
294
|
+
} else {
|
295
|
+
// support for functions and jquery promises
|
296
|
+
$.when(data)
|
297
|
+
.then(processItems);
|
298
|
+
}
|
299
|
+
},
|
300
|
+
updater: function (text) {
|
301
|
+
self.add(this.map[text]);
|
302
|
+
},
|
303
|
+
matcher: function (text) {
|
304
|
+
return (text.toLowerCase().indexOf(this.query.trim().toLowerCase()) !== -1);
|
305
|
+
},
|
306
|
+
sorter: function (texts) {
|
307
|
+
return texts.sort();
|
308
|
+
},
|
309
|
+
highlighter: function (text) {
|
310
|
+
var regex = new RegExp( '(' + this.query + ')', 'gi' );
|
311
|
+
return text.replace( regex, "<strong>$1</strong>" );
|
312
|
+
}
|
313
|
+
});
|
314
|
+
}
|
315
|
+
|
316
|
+
self.$container.on('click', $.proxy(function(event) {
|
317
|
+
self.$input.focus();
|
318
|
+
}, self));
|
319
|
+
|
320
|
+
self.$container.on('keydown', 'input', $.proxy(function(event) {
|
321
|
+
var $input = $(event.target),
|
322
|
+
$inputWrapper = self.findInputWrapper();
|
323
|
+
|
324
|
+
switch (event.which) {
|
325
|
+
// BACKSPACE
|
326
|
+
case 8:
|
327
|
+
if (doGetCaretPosition($input[0]) === 0) {
|
328
|
+
var prev = $inputWrapper.prev();
|
329
|
+
if (prev) {
|
330
|
+
self.remove(prev.data('item'));
|
331
|
+
}
|
332
|
+
}
|
333
|
+
break;
|
334
|
+
|
335
|
+
// DELETE
|
336
|
+
case 46:
|
337
|
+
if (doGetCaretPosition($input[0]) === 0) {
|
338
|
+
var next = $inputWrapper.next();
|
339
|
+
if (next) {
|
340
|
+
self.remove(next.data('item'));
|
341
|
+
}
|
342
|
+
}
|
343
|
+
break;
|
344
|
+
|
345
|
+
// LEFT ARROW
|
346
|
+
case 37:
|
347
|
+
// Try to move the input before the previous tag
|
348
|
+
var $prevTag = $inputWrapper.prev();
|
349
|
+
if ($input.val().length === 0 && $prevTag[0]) {
|
350
|
+
$prevTag.before($inputWrapper);
|
351
|
+
$input.focus();
|
352
|
+
}
|
353
|
+
break;
|
354
|
+
// RIGHT ARROW
|
355
|
+
case 39:
|
356
|
+
// Try to move the input after the next tag
|
357
|
+
var $nextTag = $inputWrapper.next();
|
358
|
+
if ($input.val().length === 0 && $nextTag[0]) {
|
359
|
+
$nextTag.after($inputWrapper);
|
360
|
+
$input.focus();
|
361
|
+
}
|
362
|
+
break;
|
363
|
+
default:
|
364
|
+
// When key corresponds one of the confirmKeys, add current input
|
365
|
+
// as a new tag
|
366
|
+
if (self.options.freeInput && $.inArray(event.which, self.options.confirmKeys) >= 0) {
|
367
|
+
self.add($input.val());
|
368
|
+
$input.val('');
|
369
|
+
event.preventDefault();
|
370
|
+
}
|
371
|
+
}
|
372
|
+
|
373
|
+
// Reset internal input's size
|
374
|
+
$input.attr('size', Math.max(this.inputSize, $input.val().length));
|
375
|
+
}, self));
|
376
|
+
|
377
|
+
// Remove icon clicked
|
378
|
+
self.$container.on('click', '[data-role=remove]', $.proxy(function(event) {
|
379
|
+
self.remove($(event.target).closest('.tag').data('item'));
|
380
|
+
}, self));
|
381
|
+
|
382
|
+
// Only add existing value as tags when using strings as tags
|
383
|
+
if (self.options.itemValue === defaultOptions.itemValue) {
|
384
|
+
if (self.$element[0].tagName === 'INPUT') {
|
385
|
+
self.add(self.$element.val());
|
386
|
+
} else {
|
387
|
+
$('option', self.$element).each(function() {
|
388
|
+
self.add($(this).attr('value'), true);
|
389
|
+
});
|
390
|
+
}
|
391
|
+
}
|
392
|
+
},
|
393
|
+
|
394
|
+
/**
|
395
|
+
* Removes all tagsinput behaviour and unregsiter all event handlers
|
396
|
+
*/
|
397
|
+
destroy: function() {
|
398
|
+
var self = this;
|
399
|
+
|
400
|
+
// Unbind events
|
401
|
+
self.$container.off('keypress', 'input');
|
402
|
+
self.$container.off('click', '[role=remove]');
|
403
|
+
|
404
|
+
self.$container.remove();
|
405
|
+
self.$element.removeData('tagsinput');
|
406
|
+
self.$element.show();
|
407
|
+
},
|
408
|
+
|
409
|
+
/**
|
410
|
+
* Sets focus on the tagsinput
|
411
|
+
*/
|
412
|
+
focus: function() {
|
413
|
+
this.$input.focus();
|
414
|
+
},
|
415
|
+
|
416
|
+
/**
|
417
|
+
* Returns the internal input element
|
418
|
+
*/
|
419
|
+
input: function() {
|
420
|
+
return this.$input;
|
421
|
+
},
|
422
|
+
|
423
|
+
/**
|
424
|
+
* Returns the element which is wrapped around the internal input. This
|
425
|
+
* is normally the $container, but typeahead.js moves the $input element.
|
426
|
+
*/
|
427
|
+
findInputWrapper: function() {
|
428
|
+
var elt = this.$input[0],
|
429
|
+
container = this.$container[0];
|
430
|
+
while(elt && elt.parentNode !== container)
|
431
|
+
elt = elt.parentNode;
|
432
|
+
|
433
|
+
return $(elt);
|
434
|
+
}
|
435
|
+
};
|
436
|
+
|
437
|
+
/**
|
438
|
+
* Register JQuery plugin
|
439
|
+
*/
|
440
|
+
$.fn.tagsinput = function(arg1, arg2) {
|
441
|
+
var results = [];
|
442
|
+
|
443
|
+
this.each(function() {
|
444
|
+
var tagsinput = $(this).data('tagsinput');
|
445
|
+
|
446
|
+
// Initialize a new tags input
|
447
|
+
if (!tagsinput) {
|
448
|
+
tagsinput = new TagsInput(this, arg1);
|
449
|
+
$(this).data('tagsinput', tagsinput);
|
450
|
+
results.push(tagsinput);
|
451
|
+
|
452
|
+
if (this.tagName === 'SELECT') {
|
453
|
+
$('option', $(this)).attr('selected', 'selected');
|
454
|
+
}
|
455
|
+
|
456
|
+
// Init tags from $(this).val()
|
457
|
+
$(this).val($(this).val());
|
458
|
+
} else {
|
459
|
+
// Invoke function on existing tags input
|
460
|
+
var retVal = tagsinput[arg1](arg2);
|
461
|
+
if (retVal !== undefined)
|
462
|
+
results.push(retVal);
|
463
|
+
}
|
464
|
+
});
|
465
|
+
|
466
|
+
if ( typeof arg1 == 'string') {
|
467
|
+
// Return the results from the invoked function calls
|
468
|
+
return results.length > 1 ? results : results[0];
|
469
|
+
} else {
|
470
|
+
return results;
|
471
|
+
}
|
472
|
+
};
|
473
|
+
|
474
|
+
$.fn.tagsinput.Constructor = TagsInput;
|
475
|
+
|
476
|
+
/**
|
477
|
+
* Most options support both a string or number as well as a function as
|
478
|
+
* option value. This function makes sure that the option with the given
|
479
|
+
* key in the given options is wrapped in a function
|
480
|
+
*/
|
481
|
+
function makeOptionItemFunction(options, key) {
|
482
|
+
if (typeof options[key] !== 'function') {
|
483
|
+
var propertyName = options[key];
|
484
|
+
options[key] = function(item) { return item[propertyName]; };
|
485
|
+
}
|
486
|
+
}
|
487
|
+
function makeOptionFunction(options, key) {
|
488
|
+
if (typeof options[key] !== 'function') {
|
489
|
+
var value = options[key];
|
490
|
+
options[key] = function() { return value; };
|
491
|
+
}
|
492
|
+
}
|
493
|
+
/**
|
494
|
+
* HtmlEncodes the given value
|
495
|
+
*/
|
496
|
+
var htmlEncodeContainer = $('<div />');
|
497
|
+
function htmlEncode(value) {
|
498
|
+
if (value) {
|
499
|
+
return htmlEncodeContainer.text(value).html();
|
500
|
+
} else {
|
501
|
+
return '';
|
502
|
+
}
|
503
|
+
}
|
504
|
+
|
505
|
+
/**
|
506
|
+
* Returns the position of the caret in the given input field
|
507
|
+
* http://flightschool.acylt.com/devnotes/caret-position-woes/
|
508
|
+
*/
|
509
|
+
function doGetCaretPosition(oField) {
|
510
|
+
var iCaretPos = 0;
|
511
|
+
if (document.selection) {
|
512
|
+
oField.focus ();
|
513
|
+
var oSel = document.selection.createRange();
|
514
|
+
oSel.moveStart ('character', -oField.value.length);
|
515
|
+
iCaretPos = oSel.text.length;
|
516
|
+
} else if (oField.selectionStart || oField.selectionStart == '0') {
|
517
|
+
iCaretPos = oField.selectionStart;
|
518
|
+
}
|
519
|
+
return (iCaretPos);
|
520
|
+
}
|
521
|
+
|
522
|
+
/**
|
523
|
+
* Initialize tagsinput behaviour on inputs and selects which have
|
524
|
+
* data-role=tagsinput
|
525
|
+
*/
|
526
|
+
$(function() {
|
527
|
+
$("input[data-role=tagsinput], select[multiple][data-role=tagsinput]").tagsinput();
|
528
|
+
});
|
529
|
+
})(window.jQuery);
|
530
|
+
|