undercase 0.2.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +70 -0
- data/Rakefile +21 -0
- data/app/assets/fonts/FontAwesome/FontAwesome.otf +0 -0
- data/app/assets/fonts/FontAwesome/fontawesome-webfont.eot +0 -0
- data/app/assets/fonts/FontAwesome/fontawesome-webfont.svg +414 -0
- data/app/assets/fonts/FontAwesome/fontawesome-webfont.ttf +0 -0
- data/app/assets/fonts/FontAwesome/fontawesome-webfont.woff +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-black-webfont.eot +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-black-webfont.svg +914 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-black-webfont.ttf +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-black-webfont.woff +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-blackit-webfont.eot +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-blackit-webfont.svg +812 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-blackit-webfont.ttf +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-blackit-webfont.woff +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-bold-webfont.eot +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-bold-webfont.svg +955 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-bold-webfont.ttf +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-bold-webfont.woff +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-boldit-webfont.eot +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-boldit-webfont.svg +831 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-boldit-webfont.ttf +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-boldit-webfont.woff +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-extralight-webfont.eot +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-extralight-webfont.svg +905 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-extralight-webfont.ttf +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-extralight-webfont.woff +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-extralightit-webfont.eot +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-extralightit-webfont.svg +828 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-extralightit-webfont.ttf +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-extralightit-webfont.woff +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-it-webfont.eot +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-it-webfont.svg +843 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-it-webfont.ttf +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-it-webfont.woff +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +904 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-lightit-webfont.eot +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-lightit-webfont.svg +830 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-lightit-webfont.ttf +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-lightit-webfont.woff +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +978 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-semibold-webfont.eot +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-semibold-webfont.svg +968 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-semibold-webfont.ttf +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-semibold-webfont.woff +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-semiboldit-webfont.eot +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-semiboldit-webfont.svg +838 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-semiboldit-webfont.ttf +0 -0
- data/app/assets/fonts/Source-Sans-Pro/sourcesanspro-semiboldit-webfont.woff +0 -0
- data/app/assets/fonts/Undercase-Icons/Undercase-Icons.eot +0 -0
- data/app/assets/fonts/Undercase-Icons/Undercase-Icons.svg +72 -0
- data/app/assets/fonts/Undercase-Icons/Undercase-Icons.ttf +0 -0
- data/app/assets/fonts/Undercase-Icons/Undercase-Icons.woff +0 -0
- data/app/assets/images/avatar_male_small.png +0 -0
- data/app/assets/images/backgrounds/checkerboard_tile.png +0 -0
- data/app/assets/images/icons/calendar_datepicker.svg +18 -0
- data/app/assets/images/icons/checkbox-selected.svg +17 -0
- data/app/assets/images/icons/checkbox-unselected.svg +12 -0
- data/app/assets/images/icons/double-arrow-left.svg +13 -0
- data/app/assets/images/icons/double-arrow-right.svg +13 -0
- data/app/assets/images/icons/focus-child.svg +14 -0
- data/app/assets/images/icons/master-profile.svg +11 -0
- data/app/assets/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/app/assets/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/app/assets/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/images/ui-bg_flat_100_b8b8b8_40x100.png +0 -0
- data/app/assets/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/app/assets/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/app/assets/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/app/assets/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/app/assets/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/app/assets/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/app/assets/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/app/assets/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/app/assets/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/app/assets/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/app/assets/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/app/assets/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/app/assets/images/ui-bg_inset-soft_95_fef1ec_1x100.png +0 -0
- data/app/assets/images/ui-icons_222222_256x240.png +0 -0
- data/app/assets/images/ui-icons_228ef1_256x240.png +0 -0
- data/app/assets/images/ui-icons_2e83ff_256x240.png +0 -0
- data/app/assets/images/ui-icons_454545_256x240.png +0 -0
- data/app/assets/images/ui-icons_888888_256x240.png +0 -0
- data/app/assets/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/app/assets/images/ui-icons_ef8c08_256x240.png +0 -0
- data/app/assets/images/ui-icons_ffd27a_256x240.png +0 -0
- data/app/assets/images/ui-icons_ffffff_256x240.png +0 -0
- data/app/assets/images/undercase/undercase_gem_logo.png +0 -0
- data/app/assets/javascripts/undercase/index.js +19 -0
- data/app/assets/javascripts/undercase/lib/BreakpointTell.js +9 -0
- data/app/assets/javascripts/undercase/lib/timezone.js +28 -0
- data/app/assets/javascripts/undercase/patterns/Filter.js +75 -0
- data/app/assets/javascripts/undercase/patterns/FlexibleSearchMenu.js +64 -0
- data/app/assets/javascripts/undercase/patterns/ToggleNavigationSearch.js +60 -0
- data/app/assets/javascripts/undercase/patterns/datepicker.js +36 -0
- data/app/assets/javascripts/undercase/patterns/expando.js +39 -0
- data/app/assets/javascripts/undercase/patterns/modal.js +60 -0
- data/app/assets/javascripts/undercase/patterns/tabs.js +26 -0
- data/app/assets/javascripts/undercase/patterns/timepicker.js +5 -0
- data/app/assets/javascripts/undercase/popover.js +26 -0
- data/app/assets/javascripts/undercase/presenter.js +55 -0
- data/app/assets/javascripts/undercase/show_code.js +35 -0
- data/app/assets/javascripts/undercase/vendor/date.js +879 -0
- data/app/assets/javascripts/undercase/vendor/jquery-extensions/jquery.calendrical.js +517 -0
- data/app/assets/javascripts/undercase/vendor/jquery-ui-1.10.3.js +14972 -0
- data/app/assets/javascripts/undercase/vendor/modernizr.custom.14960.js +764 -0
- data/app/assets/javascripts/undercase/vendor/underscore.js +1189 -0
- data/app/assets/stylesheets/undercase/libraries/_all.scss +38 -0
- data/app/assets/stylesheets/undercase/libraries/_borders.scss +20 -0
- data/app/assets/stylesheets/undercase/libraries/_colors.scss +41 -0
- data/app/assets/stylesheets/undercase/libraries/_constants.scss +76 -0
- data/app/assets/stylesheets/undercase/libraries/_groundwork_settings.scss +351 -0
- data/app/assets/stylesheets/undercase/libraries/_icon_codes.scss +369 -0
- data/app/assets/stylesheets/undercase/libraries/_mixins.scss +49 -0
- data/app/assets/stylesheets/undercase/libraries/mixins/_button.scss +124 -0
- data/app/assets/stylesheets/undercase/libraries/mixins/_forms.scss +33 -0
- data/app/assets/stylesheets/undercase/libraries/mixins/_layout.scss +23 -0
- data/app/assets/stylesheets/undercase/libraries/mixins/_typography.scss +99 -0
- data/app/assets/stylesheets/undercase/patterns/_all.scss +32 -0
- data/app/assets/stylesheets/undercase/patterns/_borders.scss +89 -0
- data/app/assets/stylesheets/undercase/patterns/_box_helpers.scss +39 -0
- data/app/assets/stylesheets/undercase/patterns/_buttons.scss +110 -0
- data/app/assets/stylesheets/undercase/patterns/_cards.scss +36 -0
- data/app/assets/stylesheets/undercase/patterns/_chevrons.scss +98 -0
- data/app/assets/stylesheets/undercase/patterns/_colors.scss +34 -0
- data/app/assets/stylesheets/undercase/patterns/_content_with_toolbar.scss +23 -0
- data/app/assets/stylesheets/undercase/patterns/_dropdowns.scss +49 -0
- data/app/assets/stylesheets/undercase/patterns/_filters.scss +121 -0
- data/app/assets/stylesheets/undercase/patterns/_font_faces.scss +32 -0
- data/app/assets/stylesheets/undercase/patterns/_forms.scss +617 -0
- data/app/assets/stylesheets/undercase/patterns/_horizontal_rules.scss +5 -0
- data/app/assets/stylesheets/undercase/patterns/_icons.scss +4 -0
- data/app/assets/stylesheets/undercase/patterns/_inline_message.scss +36 -0
- data/app/assets/stylesheets/undercase/patterns/_layout.scss +57 -0
- data/app/assets/stylesheets/undercase/patterns/_length_of_time.scss +10 -0
- data/app/assets/stylesheets/undercase/patterns/_links.scss +96 -0
- data/app/assets/stylesheets/undercase/patterns/_lists.scss +84 -0
- data/app/assets/stylesheets/undercase/patterns/_media.scss +15 -0
- data/app/assets/stylesheets/undercase/patterns/_modals.scss +114 -0
- data/app/assets/stylesheets/undercase/patterns/_navigation.scss +224 -0
- data/app/assets/stylesheets/undercase/patterns/_pagination.scss +33 -0
- data/app/assets/stylesheets/undercase/patterns/_person_placard.scss +52 -0
- data/app/assets/stylesheets/undercase/patterns/_popovers.scss +12 -0
- data/app/assets/stylesheets/undercase/patterns/_quiz.scss +67 -0
- data/app/assets/stylesheets/undercase/patterns/_site.scss +95 -0
- data/app/assets/stylesheets/undercase/patterns/_spinners.scss +23 -0
- data/app/assets/stylesheets/undercase/patterns/_tables.scss +111 -0
- data/app/assets/stylesheets/undercase/patterns/_tabs.scss +56 -0
- data/app/assets/stylesheets/undercase/patterns/_typography.scss +231 -0
- data/app/assets/stylesheets/undercase/patterns/undercase_icons/glyphs.scss +28 -0
- data/app/assets/stylesheets/undercase/patterns_new_front_end/_all.scss +6 -0
- data/app/assets/stylesheets/undercase/patterns_new_front_end/_cards.scss +248 -0
- data/app/assets/stylesheets/undercase/patterns_new_front_end/_links.scss +10 -0
- data/app/assets/stylesheets/undercase/patterns_new_front_end/_warnings.scss +32 -0
- data/app/assets/stylesheets/undercase/vendor_static/_all.scss +12 -0
- data/app/assets/stylesheets/undercase/vendor_static/_calendrical.scss +105 -0
- data/app/assets/stylesheets/undercase/vendor_static/_icons.scss +422 -0
- data/app/assets/stylesheets/undercase/vendor_static/_jquery-ui-1.8.13.custom.scss +615 -0
- data/app/assets/stylesheets/undercase_frame/_dummy_site.scss +307 -0
- data/app/assets/stylesheets/undercase_frame/vendor/coderay.css +118 -0
- data/app/assets/stylesheets/undercase_frame_application.css.scss +18 -0
- data/app/assets/stylesheets/undercase_frame_vendor_static.scss +4 -0
- data/app/controllers/undercase/application_controller.rb +4 -0
- data/app/controllers/undercase/patterns_controller.rb +13 -0
- data/app/helpers/undercase/application_helper.rb +86 -0
- data/app/helpers/undercase/pattern_helper.rb +7 -0
- data/app/inputs/currency_input.rb +20 -0
- data/app/inputs/date_picker_input.rb +77 -0
- data/app/inputs/date_time_picker_input.rb +141 -0
- data/app/inputs/radio_as_accessible_input.rb +33 -0
- data/app/inputs/radio_with_clear_input.rb +41 -0
- data/app/models/dummy_form_object.rb +24 -0
- data/app/views/layouts/undercase/application.html.haml +49 -0
- data/app/views/undercase/patterns/_blue_dotted_link_caps.html.haml +2 -0
- data/app/views/undercase/patterns/_blue_link.html.haml +2 -0
- data/app/views/undercase/patterns/_blue_link_clean.html.haml +2 -0
- data/app/views/undercase/patterns/_cc_button_auto.html.haml +8 -0
- data/app/views/undercase/patterns/_cc_button_flat_blue.html.haml +2 -0
- data/app/views/undercase/patterns/_cc_button_flat_gray.html.haml +7 -0
- data/app/views/undercase/patterns/_cc_button_flat_gray_split.html.haml +4 -0
- data/app/views/undercase/patterns/_cc_button_flat_green.html.haml +2 -0
- data/app/views/undercase/patterns/_cc_button_gray.html.haml +1 -0
- data/app/views/undercase/patterns/_cc_button_icon.html.haml +2 -0
- data/app/views/undercase/patterns/_cc_button_wire_auto.html.haml +8 -0
- data/app/views/undercase/patterns/_cc_link_smartbar.html.haml +2 -0
- data/app/views/undercase/patterns/_chevrons.html.haml +38 -0
- data/app/views/undercase/patterns/_colors.html.haml +12 -0
- data/app/views/undercase/patterns/_content_with_toolbar.html.haml +6 -0
- data/app/views/undercase/patterns/_dropdown.html.haml +21 -0
- data/app/views/undercase/patterns/_filters.html.haml +210 -0
- data/app/views/undercase/patterns/_filters_show_only.html.haml +77 -0
- data/app/views/undercase/patterns/_gray_link.html.haml +2 -0
- data/app/views/undercase/patterns/_grid.html.haml +0 -0
- data/app/views/undercase/patterns/_icon_classes.html.haml +8 -0
- data/app/views/undercase/patterns/_icon_custom.html.haml +12 -0
- data/app/views/undercase/patterns/_inline_message.html.haml +5 -0
- data/app/views/undercase/patterns/_length_of_time.html.haml +12 -0
- data/app/views/undercase/patterns/_list_circle.html.haml +4 -0
- data/app/views/undercase/patterns/_list_disc.html.haml +4 -0
- data/app/views/undercase/patterns/_navigation.html.haml +40 -0
- data/app/views/undercase/patterns/_pagination.html.haml +17 -0
- data/app/views/undercase/patterns/_pattern.html.haml +27 -0
- data/app/views/undercase/patterns/_person_placard.html.haml +103 -0
- data/app/views/undercase/patterns/_popover.html.haml +9 -0
- data/app/views/undercase/patterns/_tables_mobile.html.haml +23 -0
- data/app/views/undercase/patterns/_tables_not_desktop.html.haml +21 -0
- data/app/views/undercase/patterns/_tables_small_mobile.html.haml +23 -0
- data/app/views/undercase/patterns/_tables_small_tablet.html.haml +25 -0
- data/app/views/undercase/patterns/_typography.html.haml +16 -0
- data/app/views/undercase/patterns/_typography_body_em.html.haml +1 -0
- data/app/views/undercase/patterns/_typography_body_p.html.haml +1 -0
- data/app/views/undercase/patterns/_typography_body_strong.html.haml +1 -0
- data/app/views/undercase/patterns/_typography_body_thin.html.haml +1 -0
- data/app/views/undercase/patterns/_typography_body_underline.html.haml +1 -0
- data/app/views/undercase/patterns/_typography_body_uppercase.html.haml +1 -0
- data/app/views/undercase/patterns/_typography_heading_1.html.haml +1 -0
- data/app/views/undercase/patterns/_typography_heading_2.html.haml +1 -0
- data/app/views/undercase/patterns/_typography_heading_3.html.haml +1 -0
- data/app/views/undercase/patterns/_typography_heading_4.html.haml +1 -0
- data/app/views/undercase/patterns/_typography_heading_thin.html.haml +1 -0
- data/app/views/undercase/patterns/_typography_links_general.html.haml +2 -0
- data/app/views/undercase/patterns/_typography_links_navigation.html.haml +2 -0
- data/app/views/undercase/patterns/_typography_links_page_banner.html.haml +2 -0
- data/app/views/undercase/patterns/_uc_borders_blue.html.haml +2 -0
- data/app/views/undercase/patterns/_uc_borders_gray.html.haml +2 -0
- data/app/views/undercase/patterns/_uc_borders_hover_blue.html.haml +3 -0
- data/app/views/undercase/patterns/_uc_borders_left.html.haml +4 -0
- data/app/views/undercase/patterns/_uc_borders_lighter_gray.html.haml +3 -0
- data/app/views/undercase/patterns/_uc_borders_middle_blue_2.html.haml +1 -0
- data/app/views/undercase/patterns/_uc_borders_middle_gray.html.haml +2 -0
- data/app/views/undercase/patterns/_uc_borders_yellow.html.haml +1 -0
- data/app/views/undercase/patterns/_uc_card.html.haml +40 -0
- data/app/views/undercase/patterns/_uc_dialog_loading.html.haml +2 -0
- data/app/views/undercase/patterns/_uc_errors.html.haml +1 -0
- data/app/views/undercase/patterns/_uc_forms_check_boxes.html.haml +7 -0
- data/app/views/undercase/patterns/_uc_forms_check_boxes_boolean.html.haml +20 -0
- data/app/views/undercase/patterns/_uc_forms_checkbutton.html.haml +14 -0
- data/app/views/undercase/patterns/_uc_forms_conditionally_required.html.haml +19 -0
- data/app/views/undercase/patterns/_uc_forms_currency_input.html.haml +7 -0
- data/app/views/undercase/patterns/_uc_forms_date_picker.html.haml +9 -0
- data/app/views/undercase/patterns/_uc_forms_date_time_picker.html.haml +9 -0
- data/app/views/undercase/patterns/_uc_forms_disabled_field.html.haml +8 -0
- data/app/views/undercase/patterns/_uc_forms_dropdown.html.haml +10 -0
- data/app/views/undercase/patterns/_uc_forms_dropdown_with_optgroups.html.haml +10 -0
- data/app/views/undercase/patterns/_uc_forms_full_name.html.haml +32 -0
- data/app/views/undercase/patterns/_uc_forms_grouped_inputs.html.haml +17 -0
- data/app/views/undercase/patterns/_uc_forms_large_field.html.haml +8 -0
- data/app/views/undercase/patterns/_uc_forms_medium_field.html.haml +8 -0
- data/app/views/undercase/patterns/_uc_forms_phone.html.haml +26 -0
- data/app/views/undercase/patterns/_uc_forms_radio_button_clear_link.html.haml +7 -0
- data/app/views/undercase/patterns/_uc_forms_radio_buttons.html.haml +7 -0
- data/app/views/undercase/patterns/_uc_forms_radio_buttons_breathe.html.haml +11 -0
- data/app/views/undercase/patterns/_uc_forms_radio_buttons_horizontal.html.haml +11 -0
- data/app/views/undercase/patterns/_uc_forms_search.html.haml +23 -0
- data/app/views/undercase/patterns/_uc_forms_short_name.html.haml +20 -0
- data/app/views/undercase/patterns/_uc_forms_small_field.html.haml +8 -0
- data/app/views/undercase/patterns/_uc_forms_textarea.html.haml +9 -0
- data/app/views/undercase/patterns/_uc_forms_tiny_field.html.haml +8 -0
- data/app/views/undercase/patterns/_uc_list_comma.html.haml +4 -0
- data/app/views/undercase/patterns/_uc_list_ordered_alpha.html.haml +12 -0
- data/app/views/undercase/patterns/_uc_list_ordered_decimal.html.haml +12 -0
- data/app/views/undercase/patterns/_uc_list_pipe.html.haml +4 -0
- data/app/views/undercase/patterns/_uc_media.html.haml +6 -0
- data/app/views/undercase/patterns/_uc_modal_basic.html.haml +28 -0
- data/app/views/undercase/patterns/_uc_modal_exception.html.haml +34 -0
- data/app/views/undercase/patterns/_uc_modal_with_linked.html.haml +37 -0
- data/app/views/undercase/patterns/_uc_quiz_questions.html.haml +12 -0
- data/app/views/undercase/patterns/_uc_tabs.html.haml +16 -0
- data/app/views/undercase/patterns/index.html.haml +48 -0
- data/app/views/undercase/patterns/show.html.haml +7 -0
- data/app/views/undercase/popups/_dropdown.html.haml +5 -0
- data/config/initializers/dotiw.rb +1 -0
- data/config/initializers/simple_form.rb +147 -0
- data/config/routes.rb +4 -0
- data/config/tddium.yml +17 -0
- data/config/undercase-icons-regular.yml +41 -0
- data/lib/tasks/undercase.rake +51 -0
- data/lib/undercase.rb +15 -0
- data/lib/undercase/categories.yml +12 -0
- data/lib/undercase/category.rb +20 -0
- data/lib/undercase/engine.rb +13 -0
- data/lib/undercase/pattern.rb +68 -0
- data/lib/undercase/patterns/blue_dotted_link_caps.yml +4 -0
- data/lib/undercase/patterns/blue_link.yml +4 -0
- data/lib/undercase/patterns/blue_link_clean.yml +4 -0
- data/lib/undercase/patterns/cc_button_auto.yml +4 -0
- data/lib/undercase/patterns/cc_button_flat_blue.yml +4 -0
- data/lib/undercase/patterns/cc_button_flat_gray.yml +4 -0
- data/lib/undercase/patterns/cc_button_flat_gray_split.yml +9 -0
- data/lib/undercase/patterns/cc_button_flat_green.yml +27 -0
- data/lib/undercase/patterns/cc_button_gray.yml +4 -0
- data/lib/undercase/patterns/cc_button_icon.yml +4 -0
- data/lib/undercase/patterns/cc_button_wire_auto.yml +5 -0
- data/lib/undercase/patterns/cc_link_smartbar.yml +4 -0
- data/lib/undercase/patterns/chevrons.yml +4 -0
- data/lib/undercase/patterns/colors.yml +5 -0
- data/lib/undercase/patterns/content_with_toolbar.yml +4 -0
- data/lib/undercase/patterns/dropdown.yml +4 -0
- data/lib/undercase/patterns/filters.yml +5 -0
- data/lib/undercase/patterns/filters_show_only.yml +5 -0
- data/lib/undercase/patterns/gray_link.yml +4 -0
- data/lib/undercase/patterns/grid.yml +4 -0
- data/lib/undercase/patterns/icon_classes.yml +5 -0
- data/lib/undercase/patterns/icon_custom.yml +4 -0
- data/lib/undercase/patterns/inline_message.yml +4 -0
- data/lib/undercase/patterns/length_of_time.yml +4 -0
- data/lib/undercase/patterns/list_circle.yml +4 -0
- data/lib/undercase/patterns/list_disc.yml +4 -0
- data/lib/undercase/patterns/navigation.yml +4 -0
- data/lib/undercase/patterns/pagination.yml +4 -0
- data/lib/undercase/patterns/person_placard.yml +4 -0
- data/lib/undercase/patterns/popover.yml +4 -0
- data/lib/undercase/patterns/tables_mobile.yml +4 -0
- data/lib/undercase/patterns/tables_not_desktop.yml +4 -0
- data/lib/undercase/patterns/tables_small_tablet.yml +4 -0
- data/lib/undercase/patterns/typography.yml +4 -0
- data/lib/undercase/patterns/typography_body_em.yml +4 -0
- data/lib/undercase/patterns/typography_body_p.yml +4 -0
- data/lib/undercase/patterns/typography_body_strong.yml +4 -0
- data/lib/undercase/patterns/typography_body_thin.yml +4 -0
- data/lib/undercase/patterns/typography_body_underline.yml +4 -0
- data/lib/undercase/patterns/typography_body_uppercase.yml +4 -0
- data/lib/undercase/patterns/typography_heading_1.yml +4 -0
- data/lib/undercase/patterns/typography_heading_2.yml +4 -0
- data/lib/undercase/patterns/typography_heading_3.yml +4 -0
- data/lib/undercase/patterns/typography_heading_4.yml +4 -0
- data/lib/undercase/patterns/typography_heading_thin.yml +4 -0
- data/lib/undercase/patterns/typography_links_general.yml +4 -0
- data/lib/undercase/patterns/typography_links_navigation.yml +4 -0
- data/lib/undercase/patterns/typography_links_page_banner.yml +4 -0
- data/lib/undercase/patterns/uc_borders_blue.yml +4 -0
- data/lib/undercase/patterns/uc_borders_gray.yml +4 -0
- data/lib/undercase/patterns/uc_borders_hover_blue.yml +4 -0
- data/lib/undercase/patterns/uc_borders_left.yml +4 -0
- data/lib/undercase/patterns/uc_borders_lighter_gray.yml +4 -0
- data/lib/undercase/patterns/uc_borders_middle_blue_2.yml +4 -0
- data/lib/undercase/patterns/uc_borders_middle_gray.yml +4 -0
- data/lib/undercase/patterns/uc_borders_yellow.yml +4 -0
- data/lib/undercase/patterns/uc_card.yml +5 -0
- data/lib/undercase/patterns/uc_dialog_loading.yml +4 -0
- data/lib/undercase/patterns/uc_errors.yml +5 -0
- data/lib/undercase/patterns/uc_forms_check_boxes.yml +4 -0
- data/lib/undercase/patterns/uc_forms_check_boxes_boolean.yml +4 -0
- data/lib/undercase/patterns/uc_forms_checkbutton.yml +4 -0
- data/lib/undercase/patterns/uc_forms_conditionally_required.yml +4 -0
- data/lib/undercase/patterns/uc_forms_currency_input.yml +4 -0
- data/lib/undercase/patterns/uc_forms_date_picker.yml +4 -0
- data/lib/undercase/patterns/uc_forms_date_time_picker.yml +4 -0
- data/lib/undercase/patterns/uc_forms_disabled_field.yml +4 -0
- data/lib/undercase/patterns/uc_forms_dropdown.yml +4 -0
- data/lib/undercase/patterns/uc_forms_dropdown_with_optgroups.yml +4 -0
- data/lib/undercase/patterns/uc_forms_full_name.yml +4 -0
- data/lib/undercase/patterns/uc_forms_grouped_inputs.yml +4 -0
- data/lib/undercase/patterns/uc_forms_large_field.yml +4 -0
- data/lib/undercase/patterns/uc_forms_medium_field.yml +4 -0
- data/lib/undercase/patterns/uc_forms_phone.yml +4 -0
- data/lib/undercase/patterns/uc_forms_radio_button_clear_link.yml +4 -0
- data/lib/undercase/patterns/uc_forms_radio_buttons.yml +4 -0
- data/lib/undercase/patterns/uc_forms_radio_buttons_breathe.yml +4 -0
- data/lib/undercase/patterns/uc_forms_radio_buttons_horizontal.yml +4 -0
- data/lib/undercase/patterns/uc_forms_search.yml +4 -0
- data/lib/undercase/patterns/uc_forms_short_name.yml +4 -0
- data/lib/undercase/patterns/uc_forms_small_field.yml +4 -0
- data/lib/undercase/patterns/uc_forms_textarea.yml +4 -0
- data/lib/undercase/patterns/uc_forms_tiny_field.yml +4 -0
- data/lib/undercase/patterns/uc_list_comma.yml +4 -0
- data/lib/undercase/patterns/uc_list_ordered_alpha.yml +4 -0
- data/lib/undercase/patterns/uc_list_ordered_decimal.yml +4 -0
- data/lib/undercase/patterns/uc_list_pipe.yml +4 -0
- data/lib/undercase/patterns/uc_media.yml +4 -0
- data/lib/undercase/patterns/uc_modal_basic.yml +4 -0
- data/lib/undercase/patterns/uc_modal_exception.yml +4 -0
- data/lib/undercase/patterns/uc_modal_with_linked.yml +4 -0
- data/lib/undercase/patterns/uc_quiz_questions.yml +4 -0
- data/lib/undercase/patterns/uc_tabs.yml +4 -0
- data/lib/undercase/templates/fontcustom/glyphs.scss +6 -0
- data/lib/undercase/version.rb +3 -0
- data/public/timezones/Makefile +523 -0
- data/public/timezones/africa +1194 -0
- data/public/timezones/antarctica +411 -0
- data/public/timezones/asia +2751 -0
- data/public/timezones/australasia +1726 -0
- data/public/timezones/backward +117 -0
- data/public/timezones/etcetera +81 -0
- data/public/timezones/europe +2973 -0
- data/public/timezones/factory +10 -0
- data/public/timezones/iso3166.tab +276 -0
- data/public/timezones/leapseconds +100 -0
- data/public/timezones/northamerica +3254 -0
- data/public/timezones/pacificnew +28 -0
- data/public/timezones/solar87 +390 -0
- data/public/timezones/solar88 +390 -0
- data/public/timezones/solar89 +395 -0
- data/public/timezones/southamerica +1718 -0
- data/public/timezones/systemv +38 -0
- data/public/timezones/yearistype.sh +38 -0
- data/public/timezones/zone.tab +444 -0
- metadata +789 -0
@@ -0,0 +1,517 @@
|
|
1
|
+
(function($) {
|
2
|
+
var monthNames = ['January', 'February', 'March', 'April', 'May', 'June',
|
3
|
+
'July', 'August', 'September', 'October', 'November', 'December'];
|
4
|
+
|
5
|
+
function getToday()
|
6
|
+
{
|
7
|
+
var date = new Date();
|
8
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
9
|
+
}
|
10
|
+
|
11
|
+
function areDatesEqual(date1, date2)
|
12
|
+
{
|
13
|
+
return String(date1) == String(date2);
|
14
|
+
}
|
15
|
+
|
16
|
+
function daysInMonth(year, month)
|
17
|
+
{
|
18
|
+
if (year instanceof Date) return daysInMonth(year.getFullYear(), year.getMonth());
|
19
|
+
if (month == 1) {
|
20
|
+
var leapYear = (year % 4 == 0) &&
|
21
|
+
(!(year % 100 == 0) || (year % 400 == 0));
|
22
|
+
return leapYear ? 29 : 28;
|
23
|
+
} else if (month == 3 || month == 5 || month == 8 || month == 10) {
|
24
|
+
return 30;
|
25
|
+
} else {
|
26
|
+
return 31;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
function dayAfter(date)
|
31
|
+
{
|
32
|
+
var year = date.getFullYear();
|
33
|
+
var month = date.getMonth();
|
34
|
+
var day = date.getDate();
|
35
|
+
var lastDay = daysInMonth(date);
|
36
|
+
return (day == lastDay) ?
|
37
|
+
((month == 11) ?
|
38
|
+
new Date(year + 1, 0, 1) :
|
39
|
+
new Date(year, month + 1, 1)
|
40
|
+
) :
|
41
|
+
new Date(year, month, day + 1);
|
42
|
+
}
|
43
|
+
|
44
|
+
function dayBefore(date)
|
45
|
+
{
|
46
|
+
var year = date.getFullYear();
|
47
|
+
var month = date.getMonth();
|
48
|
+
var day = date.getDate();
|
49
|
+
return (day == 1) ?
|
50
|
+
((month == 0) ?
|
51
|
+
new Date(year - 1, 11, daysInMonth(year - 1, 11)) :
|
52
|
+
new Date(year, month - 1, daysInMonth(year, month - 1))
|
53
|
+
) :
|
54
|
+
new Date(year, month, day - 1);
|
55
|
+
}
|
56
|
+
|
57
|
+
function monthAfter(year, month)
|
58
|
+
{
|
59
|
+
return (month == 11) ?
|
60
|
+
new Date(year + 1, 0, 1) :
|
61
|
+
new Date(year, month + 1, 1);
|
62
|
+
}
|
63
|
+
|
64
|
+
function formatDate(date, usa)
|
65
|
+
{
|
66
|
+
return (usa ?
|
67
|
+
((date.getMonth() + 1) + '/' + date.getDate()) :
|
68
|
+
(date.getDate() + '/' + (date.getMonth() + 1))
|
69
|
+
) + '/' + date.getFullYear();
|
70
|
+
}
|
71
|
+
|
72
|
+
function parseDate(date, usa)
|
73
|
+
{
|
74
|
+
if (usa) return new Date(date);
|
75
|
+
a = date.split(/[\.\-\/]/);
|
76
|
+
var day = a.shift();
|
77
|
+
var month = a.shift();
|
78
|
+
a.unshift(day);
|
79
|
+
a.unshift(month);
|
80
|
+
return new Date(a.join('/'));
|
81
|
+
}
|
82
|
+
|
83
|
+
function formatTime(hour, minute, options)
|
84
|
+
{
|
85
|
+
var printMinute = minute;
|
86
|
+
if (minute < 10) printMinute = '0' + minute;
|
87
|
+
|
88
|
+
if (options.isoTime) {
|
89
|
+
var printHour = hour
|
90
|
+
if (printHour < 10) printHour = '0' + hour;
|
91
|
+
return printHour + ':' + printMinute;
|
92
|
+
} else {
|
93
|
+
var printHour = hour % 12;
|
94
|
+
if (printHour == 0) printHour = 12;
|
95
|
+
|
96
|
+
if (options.meridiemUpperCase) {
|
97
|
+
var half = (hour < 12) ? 'AM' : 'PM';
|
98
|
+
} else {
|
99
|
+
var half = (hour < 12) ? 'am' : 'pm';
|
100
|
+
}
|
101
|
+
|
102
|
+
return printHour + ':' + printMinute + half;
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
function parseTime(text)
|
107
|
+
{
|
108
|
+
var match = match = /(\d+)\s*[:\-\.,]\s*(\d+)\s*(am|pm)?/i.exec(text);
|
109
|
+
if (match && match.length >= 3) {
|
110
|
+
var hour = Number(match[1]);
|
111
|
+
var minute = Number(match[2])
|
112
|
+
if (hour == 12 && match[3]) hour -= 12;
|
113
|
+
if (match[3] && match[3].toLowerCase() == 'pm') hour += 12;
|
114
|
+
return {
|
115
|
+
hour: hour,
|
116
|
+
minute: minute
|
117
|
+
};
|
118
|
+
} else {
|
119
|
+
return null;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
function timeToMinutes(time)
|
124
|
+
{
|
125
|
+
return time && (time.hour * 60 + time.minute);
|
126
|
+
}
|
127
|
+
|
128
|
+
/**
|
129
|
+
* Generates calendar header, with month name, << and >> controls, and
|
130
|
+
* initials for days of the week.
|
131
|
+
*/
|
132
|
+
function renderCalendarHeader(element, year, month, options)
|
133
|
+
{
|
134
|
+
//Prepare thead element
|
135
|
+
var thead = $('<thead />');
|
136
|
+
var titleRow = $('<tr />').appendTo(thead);
|
137
|
+
|
138
|
+
//Generate << (back a month) link
|
139
|
+
$('<th />').addClass('monthCell').append(
|
140
|
+
$('<a href="javascript:;">«</a>')
|
141
|
+
.addClass('prevMonth')
|
142
|
+
.mousedown(function(e) {
|
143
|
+
renderCalendarPage(element,
|
144
|
+
month == 0 ? (year - 1) : year,
|
145
|
+
month == 0 ? 11 : (month - 1), options
|
146
|
+
);
|
147
|
+
e.preventDefault();
|
148
|
+
})
|
149
|
+
).appendTo(titleRow);
|
150
|
+
|
151
|
+
//Generate month title
|
152
|
+
$('<th />').addClass('monthCell').attr('colSpan', 5).append(
|
153
|
+
$('<a href="javascript:;">' + monthNames[month] + ' ' +
|
154
|
+
year + '</a>').addClass('monthName')
|
155
|
+
).appendTo(titleRow);
|
156
|
+
|
157
|
+
//Generate >> (forward a month) link
|
158
|
+
$('<th />').addClass('monthCell').append(
|
159
|
+
$('<a href="javascript:;">»</a>')
|
160
|
+
.addClass('nextMonth')
|
161
|
+
.mousedown(function() {
|
162
|
+
renderCalendarPage(element,
|
163
|
+
month == 11 ? (year + 1) : year,
|
164
|
+
month == 11 ? 0 : (month + 1), options
|
165
|
+
);
|
166
|
+
})
|
167
|
+
).appendTo(titleRow);
|
168
|
+
|
169
|
+
//Generate weekday initials row
|
170
|
+
var dayNames = $('<tr />').appendTo(thead);
|
171
|
+
$.each(String('SMTWTFS').split(''), function(k, v) {
|
172
|
+
$('<td />').addClass('dayName').append(v).appendTo(dayNames);
|
173
|
+
});
|
174
|
+
|
175
|
+
return thead;
|
176
|
+
}
|
177
|
+
|
178
|
+
function renderCalendarPage(element, year, month, options)
|
179
|
+
{
|
180
|
+
options = options || {};
|
181
|
+
|
182
|
+
var today = getToday();
|
183
|
+
|
184
|
+
var date = new Date(year, month, 1);
|
185
|
+
|
186
|
+
//Wind end date forward to saturday week after month
|
187
|
+
var endDate = monthAfter(year, month);
|
188
|
+
var ff = 6 - endDate.getDay();
|
189
|
+
if (ff < 6) ff += 7;
|
190
|
+
for (var i = 0; i < ff; i++) endDate = dayAfter(endDate);
|
191
|
+
|
192
|
+
var table = $('<table />');
|
193
|
+
renderCalendarHeader(element, year, month, options).appendTo(table);
|
194
|
+
|
195
|
+
var tbody = $('<tbody />').appendTo(table);
|
196
|
+
var row = $('<tr />');
|
197
|
+
|
198
|
+
//Rewind date to monday week before month
|
199
|
+
var rewind = date.getDay() + 7;
|
200
|
+
for (var i = 0; i < rewind; i++) date = dayBefore(date);
|
201
|
+
|
202
|
+
while (date <= endDate) {
|
203
|
+
var td = $('<td />')
|
204
|
+
.addClass('day')
|
205
|
+
.append(
|
206
|
+
$('<a href="javascript:;">' +
|
207
|
+
date.getDate() + '</a>'
|
208
|
+
).click((function() {
|
209
|
+
var thisDate = date;
|
210
|
+
|
211
|
+
return function() {
|
212
|
+
if (options && options.selectDate) {
|
213
|
+
options.selectDate(thisDate);
|
214
|
+
}
|
215
|
+
}
|
216
|
+
}()))
|
217
|
+
)
|
218
|
+
.appendTo(row);
|
219
|
+
|
220
|
+
var isToday = areDatesEqual(date, today);
|
221
|
+
var isSelected = options.selected &&
|
222
|
+
areDatesEqual(options.selected, date);
|
223
|
+
|
224
|
+
if (isToday) td.addClass('today');
|
225
|
+
if (isSelected) td.addClass('selected');
|
226
|
+
if (isToday && isSelected) td.addClass('today_selected');
|
227
|
+
if (date.getMonth() != month) td.addClass('nonMonth');
|
228
|
+
|
229
|
+
dow = date.getDay();
|
230
|
+
if (dow == 6) {
|
231
|
+
tbody.append(row);
|
232
|
+
row = $('<tr />');
|
233
|
+
}
|
234
|
+
date = dayAfter(date);
|
235
|
+
}
|
236
|
+
if (row.children().length) {
|
237
|
+
tbody.append(row);
|
238
|
+
} else {
|
239
|
+
row.remove();
|
240
|
+
}
|
241
|
+
|
242
|
+
element.empty().append(table);
|
243
|
+
}
|
244
|
+
|
245
|
+
function renderTimeSelect(element, options)
|
246
|
+
{
|
247
|
+
var minTime = timeToMinutes(options.minTime);
|
248
|
+
var maxTime = timeToMinutes(options.maxTime);
|
249
|
+
var defaultTime = timeToMinutes(options.defaultTime);
|
250
|
+
var selection = options.selection && timeToMinutes(parseTime(options.selection));
|
251
|
+
|
252
|
+
//Round selection to nearest time interval so that it matches a list item
|
253
|
+
selection = selection && (
|
254
|
+
(
|
255
|
+
Math.floor((selection - minTime) / options.timeInterval) *
|
256
|
+
options.timeInterval
|
257
|
+
) + minTime
|
258
|
+
);
|
259
|
+
|
260
|
+
var scrollTo; //Element to scroll the dropdown box to when shown
|
261
|
+
var ul = $('<ul />');
|
262
|
+
|
263
|
+
for (var time = minTime; time <= maxTime; time += options.timeInterval) {
|
264
|
+
(function(time) {
|
265
|
+
var hour = Math.floor(time / 60);
|
266
|
+
var minute = time % 60;
|
267
|
+
var timeText = formatTime(hour, minute, options);
|
268
|
+
var fullText = timeText;
|
269
|
+
if (options.showDuration) {
|
270
|
+
var duration = time - minTime;
|
271
|
+
if (duration < 60) {
|
272
|
+
fullText += ' (' + duration + ' mins)';
|
273
|
+
} else if (duration == 60) {
|
274
|
+
fullText += ' (1 hr)';
|
275
|
+
} else {
|
276
|
+
//Round partial hours to 1 decimal place
|
277
|
+
fullText += ' (' + (Math.round(duration / 60.0 * 10.0) / 10.0) + ' hrs)';
|
278
|
+
}
|
279
|
+
}
|
280
|
+
var li = $('<li />').append(
|
281
|
+
$('<a href="javascript:;">' + fullText + '</a>')
|
282
|
+
.click(function() {
|
283
|
+
if (options && options.selectTime) {
|
284
|
+
options.selectTime(timeText);
|
285
|
+
}
|
286
|
+
}).mousemove(function() {
|
287
|
+
$('li.selected', ul).removeClass('selected');
|
288
|
+
})
|
289
|
+
).appendTo(ul);
|
290
|
+
|
291
|
+
//Set to scroll to the default hour, unless already set
|
292
|
+
if (!scrollTo && time == defaultTime) scrollTo = li;
|
293
|
+
|
294
|
+
if (selection == time) {
|
295
|
+
//Highlight selected item
|
296
|
+
li.addClass('selected');
|
297
|
+
|
298
|
+
//Set to scroll to the selected hour
|
299
|
+
//
|
300
|
+
//This is set even if scrollTo is already set, since
|
301
|
+
//scrolling to selected hour is more important than
|
302
|
+
//scrolling to default hour
|
303
|
+
scrollTo = li;
|
304
|
+
}
|
305
|
+
})(time);
|
306
|
+
}
|
307
|
+
if (scrollTo) {
|
308
|
+
//Set timeout of zero so code runs immediately after any calling
|
309
|
+
//functions are finished (this is needed, since box hasn't been
|
310
|
+
//added to the DOM yet)
|
311
|
+
setTimeout(function() {
|
312
|
+
//Scroll the dropdown box so that scrollTo item is in
|
313
|
+
//the middle
|
314
|
+
element[0].scrollTop =
|
315
|
+
scrollTo[0].offsetTop - scrollTo.height() * 2;
|
316
|
+
}, 0);
|
317
|
+
}
|
318
|
+
element.empty().append(ul);
|
319
|
+
}
|
320
|
+
|
321
|
+
$.fn.calendricalDate = function(options)
|
322
|
+
{
|
323
|
+
options = options || {};
|
324
|
+
options.padding = options.padding || 4;
|
325
|
+
|
326
|
+
return this.each(function() {
|
327
|
+
var element = $(this);
|
328
|
+
var div;
|
329
|
+
var within = false;
|
330
|
+
|
331
|
+
element.bind('focus click', function() {
|
332
|
+
if (div) return;
|
333
|
+
var offset = element.position();
|
334
|
+
var padding = element.css('padding-left');
|
335
|
+
div = $('<div />')
|
336
|
+
.addClass('calendricalDatePopup')
|
337
|
+
.mouseenter(function() { within = true; })
|
338
|
+
.mouseleave(function() { within = false; })
|
339
|
+
.mousedown(function(e) {
|
340
|
+
e.preventDefault();
|
341
|
+
})
|
342
|
+
.css({
|
343
|
+
position: 'absolute',
|
344
|
+
left: offset.left,
|
345
|
+
top: offset.top + element.height() +
|
346
|
+
options.padding * 2
|
347
|
+
});
|
348
|
+
element.after(div);
|
349
|
+
|
350
|
+
var selected = parseDate(element.val(), options.usa);
|
351
|
+
if (!selected.getFullYear()) selected = getToday();
|
352
|
+
|
353
|
+
renderCalendarPage(
|
354
|
+
div,
|
355
|
+
selected.getFullYear(),
|
356
|
+
selected.getMonth(), {
|
357
|
+
selected: selected,
|
358
|
+
selectDate: function(date) {
|
359
|
+
within = false;
|
360
|
+
element.val(formatDate(date, options.usa));
|
361
|
+
div.remove();
|
362
|
+
div = null;
|
363
|
+
if (options.endDate) {
|
364
|
+
var endDate = parseDate(
|
365
|
+
options.endDate.val(), options.usa
|
366
|
+
);
|
367
|
+
if (endDate >= selected) {
|
368
|
+
options.endDate.val(formatDate(
|
369
|
+
new Date(
|
370
|
+
date.getTime() +
|
371
|
+
endDate.getTime() -
|
372
|
+
selected.getTime()
|
373
|
+
),
|
374
|
+
options.usa
|
375
|
+
));
|
376
|
+
}
|
377
|
+
}
|
378
|
+
}
|
379
|
+
}
|
380
|
+
);
|
381
|
+
}).blur(function() {
|
382
|
+
if (within){
|
383
|
+
if (div) element.focus();
|
384
|
+
return;
|
385
|
+
}
|
386
|
+
if (!div) return;
|
387
|
+
div.remove();
|
388
|
+
div = null;
|
389
|
+
});
|
390
|
+
});
|
391
|
+
};
|
392
|
+
|
393
|
+
$.fn.calendricalDateRange = function(options)
|
394
|
+
{
|
395
|
+
if (this.length >= 2) {
|
396
|
+
$(this[0]).calendricalDate($.extend({
|
397
|
+
endDate: $(this[1])
|
398
|
+
}, options));
|
399
|
+
$(this[1]).calendricalDate(options);
|
400
|
+
}
|
401
|
+
return this;
|
402
|
+
};
|
403
|
+
|
404
|
+
$.fn.calendricalTime = function(options)
|
405
|
+
{
|
406
|
+
options = options || {};
|
407
|
+
options.timeInterval = options.timeInterval || 30;
|
408
|
+
options.padding = options.padding || 4;
|
409
|
+
return this.each(function() {
|
410
|
+
var element = $(this);
|
411
|
+
var div;
|
412
|
+
var within = false;
|
413
|
+
|
414
|
+
element.bind('focus click', function() {
|
415
|
+
if (div) return;
|
416
|
+
var offset = element.position();
|
417
|
+
div = $('<div />')
|
418
|
+
.addClass('calendricalTimePopup')
|
419
|
+
.mouseenter(function() { within = true; })
|
420
|
+
.mouseleave(function() { within = false; })
|
421
|
+
.mousedown(function(e) {
|
422
|
+
e.preventDefault();
|
423
|
+
})
|
424
|
+
.css({
|
425
|
+
position: 'absolute',
|
426
|
+
left: offset.left,
|
427
|
+
top: offset.top + element.height() +
|
428
|
+
options.padding * 2
|
429
|
+
});
|
430
|
+
|
431
|
+
element.after(div);
|
432
|
+
|
433
|
+
var renderOptions = {
|
434
|
+
selection: element.val(),
|
435
|
+
selectTime: function(time) {
|
436
|
+
within = false;
|
437
|
+
element.val(time);
|
438
|
+
div.remove();
|
439
|
+
div = null;
|
440
|
+
},
|
441
|
+
isoTime: options.isoTime || false,
|
442
|
+
meridiemUpperCase: options.meridiemUpperCase || false,
|
443
|
+
defaultTime: options.defaultTime || {hour: 8, minute: 0},
|
444
|
+
minTime: options.minTime || {hour: 0, minute: 0},
|
445
|
+
maxTime: options.maxTime || {hour: 23, minute: 59},
|
446
|
+
timeInterval: options.timeInterval || 30
|
447
|
+
};
|
448
|
+
|
449
|
+
if (options.startTime) {
|
450
|
+
var startTime = parseTime(options.startTime.val());
|
451
|
+
//Don't display duration if part of a datetime range,
|
452
|
+
//and start and end times are on different days
|
453
|
+
if (options.startDate && options.endDate &&
|
454
|
+
!areDatesEqual(parseDate(options.startDate.val()),
|
455
|
+
parseDate(options.endDate.val()))) {
|
456
|
+
startTime = null;
|
457
|
+
}
|
458
|
+
if (startTime) {
|
459
|
+
renderOptions.minTime = startTime;
|
460
|
+
renderOptions.showDuration = true;
|
461
|
+
div.addClass('calendricalEndTimePopup');
|
462
|
+
}
|
463
|
+
}
|
464
|
+
|
465
|
+
renderTimeSelect(div, renderOptions);
|
466
|
+
}).keydown(function(event) {
|
467
|
+
var TABKEY = 9;
|
468
|
+
|
469
|
+
if (event.which == TABKEY) {
|
470
|
+
if (within){
|
471
|
+
if (div) element.focus();
|
472
|
+
return;
|
473
|
+
}
|
474
|
+
if (!div) return;
|
475
|
+
div.remove();
|
476
|
+
div = null;
|
477
|
+
}
|
478
|
+
}).blur(function() {
|
479
|
+
if (within){
|
480
|
+
if (div) element.focus();
|
481
|
+
return;
|
482
|
+
}
|
483
|
+
if (!div) return;
|
484
|
+
div.remove();
|
485
|
+
div = null;
|
486
|
+
});
|
487
|
+
})
|
488
|
+
},
|
489
|
+
|
490
|
+
$.fn.calendricalTimeRange = function(options)
|
491
|
+
{
|
492
|
+
if (this.length >= 2) {
|
493
|
+
$(this[0]).calendricalTime(options);
|
494
|
+
$(this[1]).calendricalTime($.extend({
|
495
|
+
startTime: $(this[0])
|
496
|
+
}, options));
|
497
|
+
}
|
498
|
+
return this;
|
499
|
+
};
|
500
|
+
|
501
|
+
$.fn.calendricalDateTimeRange = function(options)
|
502
|
+
{
|
503
|
+
if (this.length >= 4) {
|
504
|
+
$(this[0]).calendricalDate($.extend({
|
505
|
+
endDate: $(this[2])
|
506
|
+
}, options));
|
507
|
+
$(this[1]).calendricalTime(options);
|
508
|
+
$(this[2]).calendricalDate(options);
|
509
|
+
$(this[3]).calendricalTime($.extend({
|
510
|
+
startTime: $(this[1]),
|
511
|
+
startDate: $(this[0]),
|
512
|
+
endDate: $(this[2])
|
513
|
+
}, options));
|
514
|
+
}
|
515
|
+
return this;
|
516
|
+
};
|
517
|
+
})(jQuery);
|