artfully_ose 1.2.0.beta.1 → 1.2.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +9 -9
- data/app/assets/fonts/FontAwesome.otf +0 -0
- data/app/assets/fonts/fontawesome-webfont.eot +0 -0
- data/app/assets/fonts/fontawesome-webfont.svg +252 -472
- data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/app/assets/fonts/fontawesome-webfont.woff +0 -0
- data/app/assets/images/person-default-avatar.psd +0 -0
- data/app/assets/javascripts/application.js +10 -163
- data/app/assets/javascripts/box-office.js +262 -0
- data/app/assets/javascripts/custom/inline-people-search.js +40 -40
- data/app/assets/javascripts/custom/people.js +5 -68
- data/app/assets/javascripts/custom/prices.js +0 -1
- data/app/assets/javascripts/custom/show.js +8 -18
- data/app/assets/javascripts/jquery-lib/jquery.mask-money.js +0 -1
- data/app/assets/javascripts/locationselector.js +1 -1
- data/app/assets/javascripts/store/jquery.validate.additional-methods.js +159 -476
- data/app/assets/javascripts/store/jquery.validate.js +406 -449
- data/app/assets/javascripts/store/store.js +5 -29
- data/app/assets/stylesheets/application.sass +60 -223
- data/app/assets/stylesheets/bootstrap-overrides.css +3 -13
- data/app/assets/stylesheets/bootstrap.css +0 -1
- data/app/assets/stylesheets/font-awesome.sass +759 -0
- data/app/assets/stylesheets/sass/_event_list.sass +1 -12
- data/app/assets/stylesheets/sass/_tags.sass +2 -13
- data/app/assets/stylesheets/sass/box-office.sass +1 -2
- data/app/assets/stylesheets/sass/cart.sass +6 -0
- data/app/assets/stylesheets/sass/store.sass +68 -123
- data/app/assets/stylesheets/storefront.css +1 -2
- data/app/concerns/itemable.rb +1 -1
- data/app/controllers/artfully_ose_controller.rb +7 -29
- data/app/controllers/discounts_controller.rb +1 -8
- data/app/controllers/events_controller.rb +33 -41
- data/app/controllers/exchanges_controller.rb +2 -8
- data/app/controllers/export_controller.rb +0 -6
- data/app/controllers/imports_controller.rb +0 -19
- data/app/controllers/members/index_controller.rb +1 -1
- data/app/controllers/members/members_controller.rb +1 -6
- data/app/controllers/membership_awards_controller.rb +58 -0
- data/app/controllers/membership_types_controller.rb +3 -40
- data/app/controllers/memberships_controller.rb +4 -6
- data/app/controllers/orders_controller.rb +2 -86
- data/app/controllers/organizations_controller.rb +3 -4
- data/app/controllers/people_controller.rb +23 -54
- data/app/controllers/refunds_controller.rb +7 -7
- data/app/controllers/sales_controller.rb +28 -67
- data/app/controllers/searches_controller.rb +9 -15
- data/app/controllers/sections_controller.rb +2 -2
- data/app/controllers/segments_controller.rb +4 -4
- data/app/controllers/shows_controller.rb +49 -79
- data/app/controllers/slices_controller.rb +2 -3
- data/app/controllers/statements_controller.rb +1 -1
- data/app/controllers/store/checkouts_controller.rb +3 -8
- data/app/controllers/store/donations_controller.rb +1 -19
- data/app/controllers/store/events_controller.rb +1 -14
- data/app/controllers/store/memberships_controller.rb +1 -12
- data/app/controllers/store/orders_controller.rb +17 -36
- data/app/controllers/store/passes_controller.rb +0 -9
- data/app/controllers/store/store_controller.rb +2 -7
- data/app/controllers/tickets_controller.rb +2 -2
- data/app/helpers/artfully_ose_helper.rb +21 -79
- data/app/helpers/link_helper.rb +2 -12
- data/app/mailers/order_mailer.rb +1 -28
- data/app/mailers/reports_mailer.rb +4 -5
- data/app/models/ability.rb +0 -1
- data/app/models/action.rb +1 -1
- data/app/models/actions/go_action.rb +2 -3
- data/app/{concerns → models/actions}/immutable_action.rb +0 -0
- data/app/models/address.rb +11 -32
- data/app/models/{cart.rb → carts/cart.rb} +37 -46
- data/app/models/carts/cart_finder.rb +33 -0
- data/app/models/checkout.rb +41 -85
- data/app/models/comp.rb +17 -24
- data/app/models/company.rb +1 -1
- data/app/models/contribution.rb +0 -1
- data/app/models/database_views/item_view.rb +28 -169
- data/app/models/database_views/order_view.rb +34 -0
- data/app/models/donation.rb +0 -4
- data/app/models/door_list.rb +3 -6
- data/app/models/event.rb +10 -60
- data/app/models/exchange.rb +5 -7
- data/app/models/{ext.rb → ext/ext.rb} +1 -14
- data/app/models/ext/integrations.rb +21 -39
- data/app/models/fee_strategy.rb +1 -47
- data/app/models/import.rb +2 -22
- data/app/models/imports/donations_import.rb +19 -1
- data/app/models/imports/events_import.rb +51 -43
- data/app/models/individual.rb +1 -3
- data/app/models/item.rb +11 -28
- data/app/models/job/daily_email_report_job.rb +6 -20
- data/app/models/job/mailchimp_sync_job.rb +3 -1
- data/app/models/job/order_processor.rb +12 -78
- data/app/models/job/show_creator.rb +3 -8
- data/app/models/kit.rb +4 -2
- data/app/models/kits/mailchimp_kit.rb +10 -18
- data/app/models/kits/regular_donation_kit.rb +8 -38
- data/app/models/member.rb +17 -152
- data/app/models/membership.rb +23 -59
- data/app/models/membership_award.rb +23 -0
- data/app/models/membership_type.rb +2 -44
- data/app/models/note.rb +1 -1
- data/app/models/order_handler.rb +39 -100
- data/app/models/orders/comp_order.rb +0 -4
- data/app/models/orders/imported_order.rb +0 -4
- data/app/models/{order.rb → orders/order.rb} +18 -113
- data/app/models/orders/refund_order.rb +0 -4
- data/app/{concerns → models/orders}/unrefundable.rb +0 -0
- data/app/models/organization.rb +15 -55
- data/app/models/organization_ability.rb +0 -1
- data/app/models/parsed_row.rb +3 -58
- data/app/models/payments/cash_payment.rb +1 -3
- data/app/models/payments/comp_payment.rb +1 -3
- data/app/models/payments/credit_card_payment.rb +23 -44
- data/app/models/{payment.rb → payments/payment.rb} +1 -29
- data/app/models/person.rb +36 -140
- data/app/models/phone.rb +8 -0
- data/app/models/refund.rb +2 -5
- data/app/models/sale.rb +10 -14
- data/app/models/sale_search.rb +21 -3
- data/app/models/search.rb +67 -320
- data/app/models/section.rb +2 -18
- data/app/models/show.rb +20 -67
- data/app/models/slices.rb +8 -25
- data/app/models/statement.rb +5 -32
- data/app/models/ticket.rb +15 -50
- data/app/models/ticket/locker.rb +1 -2
- data/app/models/ticket/pricing.rb +1 -11
- data/app/models/ticket/reports.rb +0 -16
- data/app/models/ticket/sale_transitions.rb +0 -4
- data/app/models/ticket/template.rb +0 -1
- data/app/models/ticket/transfers.rb +2 -12
- data/app/models/ticket_summary.rb +1 -7
- data/app/models/ticket_type.rb +7 -59
- data/app/models/user.rb +5 -18
- data/app/models/user_membership.rb +3 -21
- data/app/models/valuation/lifetime_ticket_value.rb +1 -1
- data/app/models/venue.rb +7 -21
- data/app/presenters/event_presenter.rb +1 -1
- data/app/views/actions/_form.html.haml +6 -6
- data/app/views/actions/get/_show.html.haml +13 -2
- data/app/views/actions/give/_show.html.haml +1 -1
- data/app/views/actions/shared/_show.html.haml +1 -1
- data/app/views/addresses/_address.html.haml +6 -7
- data/app/views/contributions/_form.html.haml +1 -1
- data/app/views/contributions/index.html.haml +2 -2
- data/app/views/discounts/_discount_section_fields.html.haml +1 -1
- data/app/views/discounts/_form.html.haml +1 -1
- data/app/views/discounts/index.html.haml +1 -1
- data/app/views/events/_day_date_show.html.haml +2 -2
- data/app/views/events/_discount_section_fields.html.haml +1 -1
- data/app/views/events/_header.html.haml +0 -1
- data/app/views/events/_list.html.haml +5 -10
- data/app/views/events/_menu.html.haml +15 -6
- data/app/views/events/_section_fields.html.haml +1 -1
- data/app/views/events/_share_and_sell.haml +2 -3
- data/app/views/events/_ticket_type_fields.html.haml +4 -43
- data/app/views/events/edit.html.haml +1 -6
- data/app/views/events/image.html.haml +1 -2
- data/app/views/events/index.html.haml +3 -20
- data/app/views/events/show.html.haml +1 -3
- data/app/views/events/temp_discount_form.html.haml +1 -1
- data/app/views/events/temp_discounts_index.html.haml +1 -1
- data/app/views/exchanges/new.html.haml +28 -51
- data/app/views/imports/donations/_pending.html.haml +1 -1
- data/app/views/imports/events/_pending.html.haml +1 -1
- data/app/views/imports/index.html.haml +3 -6
- data/app/views/imports/people/_imported.html.haml +2 -2
- data/app/views/imports/people/_new.html.haml +8 -20
- data/app/views/imports/people/_pending.html.haml +2 -2
- data/app/views/imports/people/_recalled.html.haml +1 -1
- data/app/views/imports/shared/_sidebar.html.haml +1 -1
- data/app/views/index/dashboard.html.haml +4 -4
- data/app/views/layouts/_flash.html.haml +3 -3
- data/app/views/layouts/_google_analytics.html.haml +2 -5
- data/app/views/layouts/_menu.html.haml +5 -9
- data/app/views/layouts/application.html.haml +2 -2
- data/app/views/layouts/devise_layout.html.haml +2 -2
- data/app/views/layouts/members.html.haml +1 -1
- data/app/views/layouts/storefront.html.haml +15 -27
- data/app/views/members/index/index.html.haml +13 -7
- data/app/views/membership_awards/confirm.html.haml +59 -0
- data/app/views/membership_awards/create.html.haml +1 -0
- data/app/views/membership_awards/new.html.haml +74 -0
- data/app/views/membership_types/_form.html.haml +19 -67
- data/app/views/membership_types/index.html.haml +14 -15
- data/app/views/memberships/index.html.haml +50 -116
- data/app/views/merges/find_person.html.haml +1 -1
- data/app/views/notes/_note.html.haml +4 -4
- data/app/views/order_mailer/confirmation_for.html.haml +21 -33
- data/app/views/order_mailer/confirmation_for.text.haml +3 -6
- data/app/views/orders/_item_table.haml +8 -25
- data/app/views/orders/_order_sidebar.html.haml +4 -2
- data/app/views/orders/sales.html.haml +3 -3
- data/app/views/organizations/_connection_form.html.haml +1 -1
- data/app/views/organizations/_form.html.haml +20 -25
- data/app/views/organizations/edit.html.haml +2 -2
- data/app/views/organizations/show.html.haml +16 -22
- data/app/views/people/_edit_modal.html.haml +28 -48
- data/app/views/people/_header.html.haml +9 -18
- data/app/views/people/_phone_fields.html.haml +1 -1
- data/app/views/people/index.html.haml +6 -18
- data/app/views/people/new.html.haml +1 -1
- data/app/views/people/show.html.haml +24 -71
- data/app/views/refunds/new.html.haml +27 -45
- data/app/views/reports_mailer/daily.html.haml +21 -86
- data/app/views/sales/new.html.haml +125 -33
- data/app/views/searches/_form.html.haml +50 -115
- data/app/views/searches/_person.html.haml +2 -5
- data/app/views/searches/new.html.haml +1 -1
- data/app/views/searches/show.html.haml +6 -17
- data/app/views/segments/show.html.haml +4 -7
- data/app/views/shared/_error_messages.html.haml +1 -1
- data/app/views/shared/_tags.html.haml +2 -2
- data/app/views/shows/_controls.html.haml +20 -4
- data/app/views/shows/_glance.html.haml +5 -1
- data/app/views/shows/_sections_table.html.haml +6 -8
- data/app/views/shows/_ticket_table.html.haml +3 -3
- data/app/views/shows/_work_with.html.haml +5 -5
- data/app/views/shows/door_list.html.haml +2 -2
- data/app/views/shows/index.html.haml +19 -88
- data/app/views/shows/new.html.haml +11 -10
- data/app/views/shows/show.html.haml +2 -2
- data/app/views/slices/index.html.haml +1 -2
- data/app/views/statements/_discounts_table.html.haml +1 -1
- data/app/views/statements/_order_location_table.html.haml +1 -1
- data/app/views/statements/_payment_method_table.haml +1 -1
- data/app/views/statements/_ticket_type_table.haml +2 -5
- data/app/views/statements/show.html.haml +2 -5
- data/app/views/store/checkouts/thanks.html.haml +16 -38
- data/app/views/store/donations/index.html.haml +2 -19
- data/app/views/store/events/_calendar.html.haml +4 -1
- data/app/views/store/events/index.html.haml +4 -11
- data/app/views/store/events/show.html.haml +19 -10
- data/app/views/store/memberships/index.html.haml +17 -17
- data/app/views/store/orders/show.html.haml +22 -33
- data/app/views/store/shared/_donate_form.html.haml +12 -31
- data/app/views/store/shows/_show.html.haml +29 -37
- data/app/views/user_memberships/_list.html.haml +29 -28
- data/app/views/users/invitations/edit.html.haml +9 -19
- data/app/views/users/mailer/invitation_instructions.html.erb +8 -0
- data/app/views/users/passwords/edit.html.haml +2 -2
- data/app/views/users/registrations/edit.html.erb +3 -3
- data/app/views/users/sessions/new.html.haml +2 -2
- data/app/views/venues/edit.html.haml +1 -3
- data/config/initializers/devise.rb +5 -2
- data/config/locales/devise.en.yml +1 -1
- data/config/locales/devise_invitable.en.yml +1 -1
- data/config/locales/en.yml +3 -18
- data/config/routes.rb +12 -101
- data/lib/artfully_ose.rb +4 -6
- data/lib/artfully_ose/common_abilities.rb +2 -8
- data/lib/artfully_ose/engine.rb +10 -34
- data/lib/artfully_ose/version.rb +1 -1
- metadata +45 -349
- data/README.md +0 -28
- data/app/assets/images/household-default-avatar.png +0 -0
- data/app/assets/javascripts/angular-resource.js +0 -546
- data/app/assets/javascripts/angular.js +0 -20311
- data/app/assets/javascripts/bootstrap-wysihtml5.js +0 -511
- data/app/assets/javascripts/boxoffice.js +0 -558
- data/app/assets/javascripts/change-membership.js +0 -152
- data/app/assets/javascripts/custom/kits-config.js +0 -33
- data/app/assets/javascripts/households.js +0 -59
- data/app/assets/javascripts/jquery-migrate-1.2.1.min.js +0 -2
- data/app/assets/javascripts/relationships.js +0 -63
- data/app/assets/javascripts/sales-console.js +0 -158
- data/app/assets/javascripts/wysihtml5-0.3.0.min.js +0 -261
- data/app/assets/stylesheets/bootstrap-wysihtml5.css +0 -102
- data/app/assets/stylesheets/boxoffice.css.scss +0 -258
- data/app/assets/stylesheets/font-awesome.css.scss +0 -1566
- data/app/assets/stylesheets/pages/bootstrap-responsive.css +0 -1109
- data/app/assets/stylesheets/wysiwyg-color.css +0 -67
- data/app/concerns/cart_finder.rb +0 -50
- data/app/concerns/pdf_generation.rb +0 -64
- data/app/concerns/search_by_dates.rb +0 -20
- data/app/controllers/console_sales_controller.rb +0 -182
- data/app/controllers/events_pass_types_controller.rb +0 -87
- data/app/controllers/households_controller.rb +0 -71
- data/app/controllers/member_cards_controller.rb +0 -44
- data/app/controllers/members/invitations_controller.rb +0 -7
- data/app/controllers/members/passwords_controller.rb +0 -10
- data/app/controllers/members/people_controller.rb +0 -17
- data/app/controllers/members/sessions_controller.rb +0 -14
- data/app/controllers/membership_cancellations_controller.rb +0 -46
- data/app/controllers/membership_changes_controller.rb +0 -39
- data/app/controllers/membership_comps_controller.rb +0 -102
- data/app/controllers/membership_kits_controller.rb +0 -25
- data/app/controllers/mobile/dashboard_controller.rb +0 -17
- data/app/controllers/mobile/events_controller.rb +0 -16
- data/app/controllers/mobile/orders_controller.rb +0 -61
- data/app/controllers/mobile/shows_controller.rb +0 -39
- data/app/controllers/mobile/tickets_controller.rb +0 -114
- data/app/controllers/mobile/users_controller.rb +0 -30
- data/app/controllers/pass_types_controller.rb +0 -53
- data/app/controllers/passes_controller.rb +0 -52
- data/app/controllers/passes_kits_controller.rb +0 -25
- data/app/controllers/passes_reports_controller.rb +0 -25
- data/app/controllers/regular_donation_kits_controller.rb +0 -32
- data/app/controllers/relationships_controller.rb +0 -15
- data/app/controllers/store/retrievals_controller.rb +0 -29
- data/app/controllers/users/sessions_controller.rb +0 -3
- data/app/helpers/households_helper.rb +0 -7
- data/app/helpers/membership_types_helper.rb +0 -22
- data/app/helpers/relationships_helper.rb +0 -26
- data/app/helpers/sales_helper.rb +0 -29
- data/app/helpers/searches_helper.rb +0 -13
- data/app/helpers/suggested_households_helper.rb +0 -5
- data/app/mailers/pass_mailer.rb +0 -17
- data/app/models/actions/change_action.rb +0 -13
- data/app/models/actions/comp_action.rb +0 -15
- data/app/models/console_sale.rb +0 -30
- data/app/models/daily_membership_report.rb +0 -50
- data/app/models/daily_pass_report.rb +0 -48
- data/app/models/events_pass_type.rb +0 -18
- data/app/models/ext/preprocessor.rb +0 -7
- data/app/models/extendable.rb +0 -6
- data/app/models/household.rb +0 -61
- data/app/models/household_suggester.rb +0 -58
- data/app/models/imports/memberships_import.rb +0 -43
- data/app/models/job/checkout_processor.rb +0 -46
- data/app/models/job/cleanup_suggested_households_job.rb +0 -17
- data/app/models/job/destroy_show_job.rb +0 -10
- data/app/models/job/geocode_address_job.rb +0 -11
- data/app/models/job/order_mailer_job.rb +0 -8
- data/app/models/job/refund_order_processor.rb +0 -16
- data/app/models/kits/membership_kit.rb +0 -62
- data/app/models/kits/passes_kit.rb +0 -62
- data/app/models/kits/scannable_tickets_kit.rb +0 -23
- data/app/models/member_card_generator.rb +0 -63
- data/app/models/member_walkup.rb +0 -150
- data/app/models/membership_cancellation.rb +0 -80
- data/app/models/membership_change.rb +0 -187
- data/app/models/membership_comp.rb +0 -105
- data/app/models/membership_comp_job.rb +0 -32
- data/app/models/membership_sale_search.rb +0 -18
- data/app/models/pass.rb +0 -197
- data/app/models/pass_sale_search.rb +0 -18
- data/app/models/pass_summary.rb +0 -18
- data/app/models/pass_type.rb +0 -46
- data/app/models/passes_report.rb +0 -117
- data/app/models/payments/check_payment.rb +0 -33
- data/app/models/relation.rb +0 -27
- data/app/models/relation_builder.rb +0 -32
- data/app/models/relationship.rb +0 -55
- data/app/models/relationship_builder.rb +0 -12
- data/app/models/relationship_validator.rb +0 -46
- data/app/models/relationships_kit.rb +0 -31
- data/app/models/rolling_membership_type.rb +0 -11
- data/app/models/seasonal_membership_type.rb +0 -3
- data/app/models/suggested_household.rb +0 -24
- data/app/models/ticket/qr_code.rb +0 -21
- data/app/models/valuation/lifetime_memberships.rb +0 -24
- data/app/serializers/show_serializer.rb +0 -15
- data/app/views/console_sales/_aloha.html.haml +0 -26
- data/app/views/console_sales/_cart.html.haml +0 -60
- data/app/views/console_sales/_payment.html.haml +0 -111
- data/app/views/console_sales/_shows.html.haml +0 -24
- data/app/views/console_sales/new.html.haml +0 -143
- data/app/views/events_pass_types/_form.html.haml +0 -42
- data/app/views/events_pass_types/edit.html.haml +0 -22
- data/app/views/events_pass_types/index.html.haml +0 -47
- data/app/views/events_pass_types/new.html.haml +0 -22
- data/app/views/households/_action.html.haml +0 -24
- data/app/views/households/_edit_modal.html.haml +0 -143
- data/app/views/households/_form.html.haml +0 -26
- data/app/views/households/_header.html.haml +0 -25
- data/app/views/households/_individual_fields.html.haml +0 -8
- data/app/views/households/_list.html.haml +0 -10
- data/app/views/households/_note.html.haml +0 -33
- data/app/views/households/edit.html.haml +0 -1
- data/app/views/households/index.html.haml +0 -13
- data/app/views/households/new.html.haml +0 -14
- data/app/views/households/show.html.haml +0 -72
- data/app/views/households/suggested.html.haml +0 -38
- data/app/views/imports/_export_links.html.haml +0 -3
- data/app/views/kits/_list.html.haml +0 -9
- data/app/views/members/invitations/edit.html.haml +0 -17
- data/app/views/members/invitations/new.html.erb +0 -14
- data/app/views/members/mailer/_invitation_body.html.haml +0 -18
- data/app/views/members/mailer/invitation_instructions.html.haml +0 -6
- data/app/views/members/mailer/reset_password_instructions.html.erb +0 -8
- data/app/views/members/passwords/edit.html.haml +0 -18
- data/app/views/members/sessions/new.html.haml +0 -19
- data/app/views/membership_cancellations/_form.html.haml +0 -39
- data/app/views/membership_cancellations/_modal.html.haml +0 -2
- data/app/views/membership_cancellations/_processing.html.haml +0 -12
- data/app/views/membership_cancellations/create.js.erb +0 -3
- data/app/views/membership_cancellations/new.js.erb +0 -3
- data/app/views/membership_comps/confirm.html.haml +0 -86
- data/app/views/membership_comps/create.html.haml +0 -20
- data/app/views/membership_comps/new.html.haml +0 -95
- data/app/views/membership_kits/edit.html.haml +0 -52
- data/app/views/membership_mailer/cancellation_confirmation.html.haml +0 -9
- data/app/views/membership_mailer/cancellation_confirmation.text.haml +0 -6
- data/app/views/membership_mailer/refund_problem.html.haml +0 -18
- data/app/views/membership_mailer/refund_problem.text.haml +0 -14
- data/app/views/membership_types/_membership_type_fees.html.haml +0 -0
- data/app/views/membership_types/_rolling_membership_type_form.html.haml +0 -5
- data/app/views/membership_types/_seasonal_membership_type_form.html.haml +0 -8
- data/app/views/membership_types/type.html.haml +0 -19
- data/app/views/memberships/_membership_scripts.js.erb +0 -15
- data/app/views/order_mailer/confirmation_for_exchange.html.haml +0 -34
- data/app/views/order_mailer/confirmation_for_exchange.text.haml +0 -26
- data/app/views/order_mailer/confirmation_for_refund.html.haml +0 -36
- data/app/views/order_mailer/confirmation_for_refund.text.haml +0 -22
- data/app/views/orders/membership.html.haml +0 -100
- data/app/views/orders/passes.html.haml +0 -97
- data/app/views/pass_mailer/pass_info_for.html.haml +0 -21
- data/app/views/pass_types/_form.html.haml +0 -76
- data/app/views/pass_types/_pass_type_fees.html.haml +0 -0
- data/app/views/pass_types/edit.html.haml +0 -4
- data/app/views/pass_types/index.html.haml +0 -34
- data/app/views/pass_types/new.html.haml +0 -4
- data/app/views/passes/index.html.haml +0 -108
- data/app/views/passes_kits/edit.html.haml +0 -30
- data/app/views/passes_reports/index.html.haml +0 -80
- data/app/views/pdfs/member.html.haml +0 -66
- data/app/views/pdfs/member_card_generator/blanks_usa_idc6.html.haml +0 -109
- data/app/views/pdfs/order.html.haml +0 -84
- data/app/views/people/_household_fields.html.haml +0 -5
- data/app/views/people/_relationship_fields.html.haml +0 -14
- data/app/views/people/_work_with_menu.html.haml +0 -39
- data/app/views/producer_mailer/donation_kit_notification.html.haml +0 -8
- data/app/views/producer_mailer/donation_kit_notification.text.erb +0 -8
- data/app/views/producer_mailer/mailchimp_kit_initial_sync_notification.html.haml +0 -21
- data/app/views/producer_mailer/ticket_offer_accepted.html.haml +0 -7
- data/app/views/producer_mailer/ticket_offer_accepted.text.erb +0 -7
- data/app/views/producer_mailer/ticket_offer_rejected.html.haml +0 -11
- data/app/views/producer_mailer/ticket_offer_rejected.text.erb +0 -13
- data/app/views/regular_donation_kits/edit.html.haml +0 -140
- data/app/views/relationships/index.html.haml +0 -32
- data/app/views/sales/_boxoffice.html.haml +0 -141
- data/app/views/sales/_doorlist.html.haml +0 -79
- data/app/views/searches/_household.html.haml +0 -7
- data/app/views/shared/_show_time_and_calendar.html.haml +0 -21
- data/app/views/shows/door_list.pdf.haml +0 -29
- data/app/views/statements/_passes_table.html.haml +0 -22
- data/app/views/store/checkouts/_membership_info.html.haml +0 -12
- data/app/views/store/events/_venue.html.haml +0 -9
- data/app/views/store/events/calendar.html.haml +0 -50
- data/app/views/store/events/single_show.html.haml +0 -45
- data/app/views/store/passes/index.html.haml +0 -33
- data/app/views/store/retrievals/index.html.haml +0 -11
- data/app/views/store/shared/_small_donate_form.html.haml +0 -21
- data/app/views/users/mailer/invitation_instructions.html.haml +0 -14
- data/config/initializers/paperclip.rb +0 -69
- data/db/migrate/20130411162346_add_country_zip_state_phone_number_discipline_to_organizations.rb +0 -9
- data/db/migrate/20130412184415_add_first_name_and_last_name_to_users.rb +0 -6
- data/db/migrate/20130722153731_add_autentication_token_to_users.rb +0 -5
- data/db/migrate/20130723212712_add_qr_code_to_tickets.rb +0 -9
- data/db/migrate/20130820011240_add_uuid_to_tickets.rb +0 -13
- data/db/migrate/20130820025134_make_ticket_uuid_not_null.rb +0 -11
- data/db/migrate/20130823191625_add_pdf_to_orders.rb +0 -5
- data/db/migrate/20130916194547_add_relationships.rb +0 -21
- data/db/migrate/20131002191646_create_show_stats_view.rb +0 -16
- data/db/migrate/20131003134821_add_relationships_to_search.rb +0 -7
- data/db/migrate/20131003200508_add_starred_to_relationships.rb +0 -5
- data/db/migrate/20131007141421_add_counters_to_member.rb +0 -7
- data/db/migrate/20131007144456_remove_expires_at_from_membership.rb +0 -6
- data/db/migrate/20131011154027_add_purchased_to_searches.rb +0 -5
- data/db/migrate/20131013144010_add_type_to_membership_type.rb +0 -5
- data/db/migrate/20131013150230_add_duration_to_membership_type.rb +0 -6
- data/db/migrate/20131013192807_change_number_of_shows_to_tickets.rb +0 -5
- data/db/migrate/20131015151550_add_households.rb +0 -18
- data/db/migrate/20131022183913_add_search_output_options.rb +0 -24
- data/db/migrate/20131023200559_add_admin_to_user_memberships.rb +0 -14
- data/db/migrate/20131025162155_default_search_filter_values.rb +0 -10
- data/db/migrate/20131025180139_unique_household_names.rb +0 -8
- data/db/migrate/20131029173612_add_sales_start_to_membership_typ.rb +0 -6
- data/db/migrate/20131106191847_add_suggested_households.rb +0 -13
- data/db/migrate/20131127162818_add_buyer_id_index_to_tickets.rb +0 -5
- data/db/migrate/20131127164000_member_tickets.rb +0 -9
- data/db/migrate/20131204162642_add_shared_address.rb +0 -9
- data/db/migrate/20131206153323_add_membership_kit.rb +0 -5
- data/db/migrate/20131206175325_add_marketing_to_membership_type.rb +0 -6
- data/db/migrate/20131210212342_add_show_fee_to_memberhsip_type.rb +0 -5
- data/db/migrate/20131210222814_add_renewal_price_to_membership_type.rb +0 -6
- data/db/migrate/20131212164553_add_copy_to_individuals_option.rb +0 -5
- data/db/migrate/20131223215615_goodbye_order_view.rb +0 -6
- data/db/migrate/20140114011856_add_welcome_message_to_memberships.rb +0 -5
- data/db/migrate/20140114212127_add_send_email_to_memberships.rb +0 -5
- data/db/migrate/20140125183606_index_memberships_and_types.rb +0 -6
- data/db/migrate/20140128213101_add_pdf_to_members.rb +0 -5
- data/db/migrate/20140128223140_add_uuid_to_member.rb +0 -6
- data/db/migrate/20140128223948_add_qr_code_to_member.rb +0 -9
- data/db/migrate/20140207135731_update_items_view.rb +0 -38
- data/db/migrate/20140210154723_add_cached_stats.rb +0 -5
- data/db/migrate/20140218202726_cache_stats.rb +0 -7
- data/db/migrate/20140304171625_passes_ahoy.rb +0 -52
- data/db/migrate/20140304174807_add_passes_kit.rb +0 -5
- data/db/migrate/20140307144454_add_events_pass_types.rb +0 -9
- data/db/migrate/20140307193350_add_pass_id_to_cart.rb +0 -7
- data/db/migrate/20140314162422_add_total_paid_to_membership.rb +0 -13
- data/db/migrate/20140319191237_add_show_dates_to_advanced_search.rb +0 -6
- data/db/migrate/20140328172333_add_cols_to_events_pass_types.rb +0 -6
- data/db/migrate/20140328174217_add_deleted_at_to_ept.rb +0 -9
- data/db/migrate/20140328185432_add_active_to_ept.rb +0 -5
- data/db/migrate/20140328192612_add_pass_type_id_to_search.rb +0 -5
- data/db/migrate/20140415212841_add_min_max_start_dates_to_searches.artfully_ose_engine.rb +0 -6
- data/db/migrate/20140422193345_add_email_copy_to_pass_type.rb +0 -5
- data/db/migrate/20140423181639_add_min_max_end_dates_to_searches.artfully_ose_engine.rb +0 -6
- data/db/migrate/20140423185921_add_cached_stats_to_event.rb +0 -9
- data/db/migrate/20140424174423_add_lifetime_memberships_to_people.artfully_ose_engine.rb +0 -5
- data/db/migrate/20140506155241_add_lpt_to_membership_type.rb +0 -5
- data/db/migrate/20140507184646_add_bday_attributes_to_person.rb +0 -7
- data/db/migrate/20140507201048_add_check_number_to_orders.rb +0 -5
- data/db/migrate/20140515143651_remove_show_stats_view.rb +0 -6
- data/db/migrate/20140521195853_add_deleted_at_to_pass_type.rb +0 -5
- data/db/migrate/20140522205554_add_limit_to_events_pass_types.rb +0 -5
- data/db/migrate/20140523180444_remove_tickets_purchased_from_passes.rb +0 -5
- data/db/migrate/20140603200735_add_subtitle_to_events.rb +0 -5
- data/db/migrate/20140619194127_add_do_not_call_to_people.artfully_ose_engine.rb +0 -5
- data/db/migrate/20140623160543_add_index_to_items.rb +0 -7
- data/spec/factories/action_factories.rb +0 -19
- data/spec/factories/address_factories.rb +0 -11
- data/spec/factories/cart_factories.rb +0 -26
- data/spec/factories/chart_factories.rb +0 -52
- data/spec/factories/discount_factories.rb +0 -11
- data/spec/factories/donation_factories.rb +0 -14
- data/spec/factories/event_factories.rb +0 -29
- data/spec/factories/household_factories.rb +0 -8
- data/spec/factories/import_factories.rb +0 -61
- data/spec/factories/item_factories.rb +0 -51
- data/spec/factories/kit_factories.rb +0 -33
- data/spec/factories/member_factories.rb +0 -19
- data/spec/factories/membership_factories.rb +0 -9
- data/spec/factories/membership_type_factories.rb +0 -18
- data/spec/factories/order_factories.rb +0 -40
- data/spec/factories/organization_factories.rb +0 -48
- data/spec/factories/pass_type_factories.rb +0 -11
- data/spec/factories/payments_factories.rb +0 -97
- data/spec/factories/person_factories.rb +0 -47
- data/spec/factories/phone_factories.rb +0 -6
- data/spec/factories/section_factories.rb +0 -21
- data/spec/factories/segment_factories.rb +0 -6
- data/spec/factories/show_factories.rb +0 -33
- data/spec/factories/ticket_factories.rb +0 -57
- data/spec/factories/ticket_offer_factories.rb +0 -16
- data/spec/factories/ticket_type_factories.rb +0 -8
- data/spec/factories/user_factories.rb +0 -24
@@ -6,10 +6,10 @@
|
|
6
6
|
* company_name
|
7
7
|
*/
|
8
8
|
function cleanJsonPerson(jsonPerson) {
|
9
|
-
jsonPerson.first_name = ( jsonPerson.first_name == null ? "" : jsonPerson.first_name )
|
10
|
-
jsonPerson.last_name = ( jsonPerson.last_name == null ? "" : jsonPerson.last_name )
|
11
|
-
jsonPerson.email = ( jsonPerson.email == null ? "" : jsonPerson.email )
|
12
|
-
jsonPerson.company_name = ( jsonPerson.company_name == null ? "" : jsonPerson.company_name )
|
9
|
+
jsonPerson.first_name = ( jsonPerson.first_name == null ? "" : jsonPerson.first_name )
|
10
|
+
jsonPerson.last_name = ( jsonPerson.last_name == null ? "" : jsonPerson.last_name )
|
11
|
+
jsonPerson.email = ( jsonPerson.email == null ? "" : jsonPerson.email )
|
12
|
+
jsonPerson.company_name = ( jsonPerson.company_name == null ? "" : jsonPerson.company_name )
|
13
13
|
return jsonPerson
|
14
14
|
}
|
15
15
|
|
@@ -21,65 +21,65 @@ function updateModal() {
|
|
21
21
|
}
|
22
22
|
|
23
23
|
function updateSelectedPerson(personId, personFirstName, personLastName, personEmail) {
|
24
|
-
|
25
|
-
$("input#person_first_name").val(personFirstName)
|
26
|
-
$("input#person_last_name").val(personLastName)
|
27
|
-
$("input#person_email").val(personEmail)
|
24
|
+
$("input#person_id").val(personId)
|
25
|
+
$("input#person_first_name").val(personFirstName)
|
26
|
+
$("input#person_last_name").val(personLastName)
|
27
|
+
$("input#person_email").val(personEmail)
|
28
28
|
updateModal()
|
29
29
|
}
|
30
30
|
|
31
31
|
function clearNewPersonForm() {
|
32
32
|
$("input#person_id").val("")
|
33
|
-
$("input#person_first_name").val("")
|
34
|
-
$("input#person_last_name").val("")
|
35
|
-
$("input#person_email").val("")
|
33
|
+
$("input#person_first_name").val("")
|
34
|
+
$("input#person_last_name").val("")
|
35
|
+
$("input#person_email").val("")
|
36
36
|
}
|
37
37
|
|
38
38
|
$("document").ready(function(){
|
39
|
-
|
39
|
+
|
40
40
|
$("#new_person").bind("ajax:success", function(xhr, person){
|
41
41
|
$(this).removeClass('loading')
|
42
42
|
$(this).find("input:submit").removeAttr('disabled');
|
43
43
|
person = cleanJsonPerson(person)
|
44
|
-
|
45
|
-
|
44
|
+
updateSelectedPerson(person.id, person.first_name, person.last_name, person.email)
|
45
|
+
clearNewPersonForm()
|
46
46
|
});
|
47
47
|
|
48
48
|
$("#new_person").bind("ajax:error", function(xhr, status, error){
|
49
49
|
$(this).find("input:submit").removeAttr('disabled');
|
50
50
|
data = eval("(" + status.responseText + ")");
|
51
51
|
$(this).removeClass('loading')
|
52
|
-
|
53
|
-
|
54
|
-
|
52
|
+
});
|
53
|
+
|
54
|
+
$("input", "#the-details").autocomplete({
|
55
55
|
html: true,
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
56
|
+
minLength: 3,
|
57
|
+
focus: function(event, person) {
|
58
|
+
event.preventDefault()
|
59
|
+
},
|
60
60
|
source: function(request, response) {
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
select: function(event, person) {
|
61
|
+
$.getJSON("/people?utf8=%E2%9C%93&commit=Search", { search: request.term }, function(people) {
|
62
|
+
responsePeople = new Array();
|
63
|
+
|
64
|
+
$.each(people, function (i, person) {
|
65
|
+
person = cleanJsonPerson(person)
|
66
|
+
responsePeople[i] = "<div id='search-result-full-name'><span id='search-result-first-name'>"+ person.first_name +"</span> <span id='search-result-last-name'>"+ person.last_name +"</span></div>"
|
67
|
+
responsePeople[i] += "<div id='search-result-email' class='search-result-details'>"+ person.email +"</div>"
|
68
|
+
responsePeople[i] += "<div class='clear'></div>"
|
69
|
+
responsePeople[i] += "<div id='search-result-company-name' class='search-result-details'>"+ person.company_name +"</div>"
|
70
|
+
responsePeople[i] += "<div id='search-result-id'>"+person.id+"</div>"
|
71
|
+
});
|
72
|
+
response(responsePeople)
|
73
|
+
});
|
74
|
+
},
|
75
|
+
select: function(event, person) {
|
76
76
|
event.preventDefault()
|
77
|
-
|
78
|
-
|
77
|
+
var personId = $(person.item.value).filter("#search-result-id").html()
|
78
|
+
var personFirstName = $("#search-result-first-name", person.item.value).html()
|
79
79
|
var personLastName = $("#search-result-last-name", person.item.value).html()
|
80
|
-
|
80
|
+
var personEmail = $(person.item.value).filter("#search-result-email").html()
|
81
81
|
|
82
82
|
updateSelectedPerson(personId, personFirstName, personLastName, personEmail)
|
83
83
|
}
|
84
84
|
});
|
85
|
-
});
|
85
|
+
});
|
@@ -2,15 +2,11 @@ String.prototype.startsWith = function(str)
|
|
2
2
|
{return (this.match("^"+str)==str)}
|
3
3
|
|
4
4
|
$(document).ready(function() {
|
5
|
-
$("#
|
6
|
-
$("#
|
5
|
+
$("#email-subscription input[type=checkbox]").on("click", function(event) {
|
6
|
+
$("#email-subscription input[type=submit]").removeClass("hidden");
|
7
7
|
});
|
8
|
-
|
9
|
-
$("#
|
10
|
-
$("#subscription-listing input[type=submit]").removeClass("hidden");
|
11
|
-
});
|
12
|
-
|
13
|
-
$("#person_do_not_call").on("click", function(event) {
|
8
|
+
|
9
|
+
$("#person_do_not_email").on("click", function(event) {
|
14
10
|
$lists = $(".mail-chimp-list");
|
15
11
|
if ($(this).attr("checked") != "checked") {
|
16
12
|
$lists.attr("disabled", false);
|
@@ -160,64 +156,5 @@ $(document).ready(function() {
|
|
160
156
|
$("#create-mailing-address, #update-mailing-address").show();
|
161
157
|
return false;
|
162
158
|
});
|
163
|
-
|
164
|
-
$('#edit_link').click(function(){
|
165
|
-
dayDropDownValue.call(this);
|
166
|
-
yearDropDownValue.call(this);
|
167
|
-
dayValueForSelect.call(this);
|
168
|
-
yearValueForSelect.call(this);
|
169
|
-
});
|
170
|
-
|
171
|
-
$('#birth_month').change(function(){
|
172
|
-
dayDropDownValue.call(this);
|
173
|
-
});
|
174
|
-
});
|
175
159
|
|
176
|
-
|
177
|
-
var year_now = getYear();
|
178
|
-
var yearsAsString = "";
|
179
|
-
|
180
|
-
for(var i = 1920; i <= year_now; i++) {
|
181
|
-
yearsAsString += "<option value='" + i + "'>" + i + "</option>";
|
182
|
-
}
|
183
|
-
|
184
|
-
$('#birth_year').html("<option value=''></option>");
|
185
|
-
$('#birth_year').append(yearsAsString);
|
186
|
-
}
|
187
|
-
|
188
|
-
function dayDropDownValue(){
|
189
|
-
var month = $('#birth_month').val();
|
190
|
-
var year = $('#birth_year').val();
|
191
|
-
var num_days = daysInMonth(month, 2012);
|
192
|
-
var days_range = range(1,num_days + 1);
|
193
|
-
var daysAsString = "";
|
194
|
-
|
195
|
-
for(var i = 1; i < days_range.length; i++) {
|
196
|
-
daysAsString += "<option value='" + days_range[i] + "'>" + days_range[i] + "</option>";
|
197
|
-
}
|
198
|
-
|
199
|
-
$('#birth_day').html("<option value=''></option>");
|
200
|
-
$('#birth_day').append(daysAsString);
|
201
|
-
}
|
202
|
-
|
203
|
-
function yearValueForSelect(){
|
204
|
-
var birth_year = $('div.year').data('person-birth_year');
|
205
|
-
$('#birth_year').val(birth_year);
|
206
|
-
}
|
207
|
-
|
208
|
-
function dayValueForSelect(){
|
209
|
-
var birth_day = $('div.day').data('person-birth_day');
|
210
|
-
$('#birth_day').val(birth_day);
|
211
|
-
}
|
212
|
-
|
213
|
-
function daysInMonth(month,year) {
|
214
|
-
return new Date(year, month, 0).getDate();
|
215
|
-
}
|
216
|
-
|
217
|
-
function getYear(){
|
218
|
-
return new Date().getFullYear();
|
219
|
-
}
|
220
|
-
|
221
|
-
function range(start,num){
|
222
|
-
return Array.apply(start, Array(num)).map(function (_, i) {return i;});
|
223
|
-
}
|
160
|
+
});
|
@@ -2,12 +2,12 @@ $(document).ready(function () {
|
|
2
2
|
|
3
3
|
/***** Calendar for existing shows *****/
|
4
4
|
|
5
|
-
var
|
6
|
-
|
5
|
+
var cal = $('#show-calendar')
|
6
|
+
cal.fullCalendar({
|
7
7
|
height: 500
|
8
8
|
,eventSources: [
|
9
9
|
{
|
10
|
-
url: '/events/'+
|
10
|
+
url: '/events/'+cal.attr('data-event-id')+'.json', color: "#adadad"
|
11
11
|
,success: function(data) {
|
12
12
|
$.each(data, function (index, obj) {
|
13
13
|
if(obj.state == "unpublished") {
|
@@ -31,7 +31,7 @@ $(document).ready(function () {
|
|
31
31
|
var cal = $('#new-show-calendar')
|
32
32
|
cal.fullCalendar({
|
33
33
|
height: 400
|
34
|
-
,eventSources: [ { url: '/
|
34
|
+
,eventSources: [ { url: '/events/'+cal.attr('data-event-id')+'.json', color: "#adadad" } ]
|
35
35
|
,events: eventArray
|
36
36
|
,dayClick: function(date, allDay, jsEvent, view) {
|
37
37
|
var validShow = true
|
@@ -39,12 +39,7 @@ $(document).ready(function () {
|
|
39
39
|
var hour = $('#show-time-hour').val()
|
40
40
|
var minute = $('#show-time-minute').val()
|
41
41
|
var meridian = $('#show-time-meridian').val()
|
42
|
-
|
43
42
|
var hour24 = hour
|
44
|
-
if (hour24 == "12") {
|
45
|
-
hour24 = "0"
|
46
|
-
}
|
47
|
-
|
48
43
|
if (meridian == "p") {
|
49
44
|
hour24 = (+hour24 + 12).toString()
|
50
45
|
}
|
@@ -147,15 +142,10 @@ $(document).ready(function () {
|
|
147
142
|
});
|
148
143
|
|
149
144
|
$(".sprited").on("ajax:success", function(xhr, show){
|
150
|
-
var
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
$.each(sprited, function () {
|
155
|
-
$(this).find(":submit").removeAttr('disabled');
|
156
|
-
$(this).removeClass("pending built published unpublished")
|
157
|
-
$(this).addClass(show.state);
|
158
|
-
})
|
145
|
+
var $row = $(this).closest(".sprited-container");
|
146
|
+
$(this).find(":submit").removeAttr('disabled');
|
147
|
+
$row.removeClass("pending built published unpublished")
|
148
|
+
$row.addClass(show.state);
|
159
149
|
$('.show-state').html(show.state)
|
160
150
|
});
|
161
151
|
|
@@ -43,7 +43,7 @@
|
|
43
43
|
"Canada": new Array('Alberta','British Columbia','Manitoba','New Brunswick','Newfoundland and Labrador','Northwest Territories','Nova Scotia','Nunavut','Ontario','Prince Edward Island','Quebec','Saskatchewan','Yukon'),
|
44
44
|
"France": new Array('Alsace','Aquitaine','Auvergne','Basse-Normandie','Bourgogne','Bretagne','Centre','Champagne-Ardenne','Corse','Franche-Comté','Guadeloupe','Guyanne','Haute-Normandie','Île-de-France','Languedoc-Rousillon','Limousin','Lorraine','Martinique','Midi-Pyrénées','Nord-Pas-de-Calais','Pays de la Loire','Picardie','Poitou-Charentes','Provence-Alpes-Côte d\'Azur','Réunion','Rhône-Alpes'),
|
45
45
|
"United Kingdom": new Array('Aberdeen City','Aberdeenshire','Angus','Antrim','Argyll and Bute','Armagh','Avon','Bedfordshire','Berkshire','Blaenau Gwent','Borders','Bridgend','Bristol','Buckinghamshire','Caerphilly','Cambridgeshire','Cardiff','Carmarthenshire','Ceredigion','Channel Islands','Cheshire','Clackmannan','Cleveland','Conwy','Cornwall','Cumbria','Denbighshire','Derbyshire','Devon','Dorset','Down','Dumfries and Galloway','Dundee (City of)','Durham','East Ayrshire','East Dunbartonshire','East Lothian','East Renfrewshire','East Riding of Yorkshire','East Sussex','Edinburgh (City of)','Essex','Falkirk','Fermanagh','Fife Glasgow (City of)','Flintshire','Gloucestershire','Greater Manchester','Gwynedd','Hampshire','Herefordshire','Hertfordshire','Highland','Humberside','Humberside','Inverclyde','Isle of Anglesey','Isle of Man','Isle of Wight','Isles of Scilly','Kent','Lancashire','Leicestershire','Lincolnshire','London','Londonderry','Merseyside','Merthyr Tydfil','Middlesex','Midlothian','Monmouthshire','Moray','Neath Port Talbot','Newport','Norfolk','North Ayrshire','North Lanarkshire','North Yorkshire','Northamptonshire','Northumberland','Nottinghamshire','Orkney','Oxfordshire','Pembrokeshire','Perthshire and Kinross','Powys','Renfrewshire','Rhondda Cynon Taff','Rutland','Shetland','Shropshire','Somerset','South Ayrshire','South Lanarkshire','South Yorkshire','Staffordshire','Stirling','Suffolk','Surrey','Swansea','The Vale of Glamorgan','Torfaen','Tyne and Wear','Tyrone','Warwickshire','West Dunbartonshire','West Lothian','West Midlands','West Sussex','West Yorkshire','Western Isles','Wiltshire','Worcestershire','Wrexham'),
|
46
|
-
"United States": new Array('Alaska','Alabama','American Samoa','Arkansas','Armed Forces Africa','Armed Forces Europe','Armed Forces Pacific','Arizona','California','Colorado','Connecticut','District of Columbia','Delaware','Federated States of Micronesia','Florida','Georgia','Guam','Hawaii','Iowa','Idaho','Illinois','Indiana','Kansas','Kentucky','Louisiana','Massachusetts','Northern Mariana Islands','Marshall Islands','Maryland','Maine','Michigan','Minnesota','Missouri','Mississippi','Montana','North Carolina','North Dakota','Nebraska','New Hampshire','New Jersey','New Mexico','Nevada','New York','Ohio','Oklahoma','Oregon','Pennsylvania','Palau','Puerto Rico','Rhode Island','South Carolina','South Dakota','Tennessee','Texas','Utah','Virginia','Virgin Islands','Vermont','Washington','Wisconsin','West
|
46
|
+
"United States": new Array('Alaska','Alabama','American Samoa','Arkansas','Armed Forces Africa','Armed Forces Europe','Armed Forces Pacific','Arizona','California','Colorado','Connecticut','District of Columbia','Delaware','Federated States of Micronesia','Florida','Georgia','Guam','Hawaii','Iowa','Idaho','Illinois','Indiana','Kansas','Kentucky','Louisiana','Massachusetts','Northern Mariana Islands','Marshall Islands','Maryland','Maine','Michigan','Minnesota','Missouri','Mississippi','Montana','North Carolina','North Dakota','Nebraska','New Hampshire','New Jersey','New Mexico','Nevada','New York','Ohio','Oklahoma','Oregon','Pennsylvania','Palau','Puerto Rico','Rhode Island','South Carolina','South Dakota','Tennessee','Texas','Utah','Virginia','Virgin Islands','Vermont','Washington','Wisconsin','West Virgina','Wyoming')
|
47
47
|
}
|
48
48
|
|
49
49
|
return this.each(function() {
|
@@ -1,12 +1,14 @@
|
|
1
|
-
|
2
|
-
* jQuery Validation Plugin 1.
|
1
|
+
/**
|
2
|
+
* jQuery Validation Plugin 1.9.0
|
3
3
|
*
|
4
4
|
* http://bassistance.de/jquery-plugins/jquery-plugin-validation/
|
5
5
|
* http://docs.jquery.com/Plugins/Validation
|
6
6
|
*
|
7
|
-
* Copyright
|
8
|
-
*
|
7
|
+
* Copyright (c) 2006 - 2011 Jörn Zaefferer
|
8
|
+
*
|
9
|
+
* Dual licensed under the MIT and GPL licenses:
|
9
10
|
* http://www.opensource.org/licenses/mit-license.php
|
11
|
+
* http://www.gnu.org/licenses/gpl.html
|
10
12
|
*/
|
11
13
|
|
12
14
|
(function() {
|
@@ -14,32 +16,30 @@
|
|
14
16
|
function stripHtml(value) {
|
15
17
|
// remove html tags and space chars
|
16
18
|
return value.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' ')
|
17
|
-
// remove punctuation
|
18
|
-
.replace(/[.(),;:!?%#$'"_
|
19
|
+
// remove numbers and punctuation
|
20
|
+
.replace(/[0-9.(),;:!?%#$'"_+=\/-]*/g,'');
|
19
21
|
}
|
20
22
|
jQuery.validator.addMethod("maxWords", function(value, element, params) {
|
21
|
-
|
23
|
+
return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length < params;
|
22
24
|
}, jQuery.validator.format("Please enter {0} words or less."));
|
23
25
|
|
24
26
|
jQuery.validator.addMethod("minWords", function(value, element, params) {
|
25
|
-
|
27
|
+
return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length >= params;
|
26
28
|
}, jQuery.validator.format("Please enter at least {0} words."));
|
27
29
|
|
28
30
|
jQuery.validator.addMethod("rangeWords", function(value, element, params) {
|
29
|
-
|
30
|
-
var regex = /\b\w+\b/g;
|
31
|
-
return this.optional(element) || valueStripped.match(regex).length >= params[0] && valueStripped.match(regex).length <= params[1];
|
31
|
+
return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length >= params[0] && value.match(/bw+b/g).length < params[1];
|
32
32
|
}, jQuery.validator.format("Please enter between {0} and {1} words."));
|
33
33
|
|
34
|
-
}()
|
34
|
+
})();
|
35
35
|
|
36
36
|
jQuery.validator.addMethod("letterswithbasicpunc", function(value, element) {
|
37
|
-
return this.optional(element) || /^[a-z
|
37
|
+
return this.optional(element) || /^[a-z-.,()'\"\s]+$/i.test(value);
|
38
38
|
}, "Letters or punctuation only please");
|
39
39
|
|
40
40
|
jQuery.validator.addMethod("alphanumeric", function(value, element) {
|
41
41
|
return this.optional(element) || /^\w+$/i.test(value);
|
42
|
-
}, "Letters, numbers,
|
42
|
+
}, "Letters, numbers, spaces or underscores only please");
|
43
43
|
|
44
44
|
jQuery.validator.addMethod("lettersonly", function(value, element) {
|
45
45
|
return this.optional(element) || /^[a-z]+$/i.test(value);
|
@@ -50,296 +50,118 @@ jQuery.validator.addMethod("nowhitespace", function(value, element) {
|
|
50
50
|
}, "No white space please");
|
51
51
|
|
52
52
|
jQuery.validator.addMethod("ziprange", function(value, element) {
|
53
|
-
return this.optional(element) || /^90[2-5]\d\{2
|
53
|
+
return this.optional(element) || /^90[2-5]\d\{2}-\d{4}$/.test(value);
|
54
54
|
}, "Your ZIP-code must be in the range 902xx-xxxx to 905-xx-xxxx");
|
55
55
|
|
56
|
-
jQuery.validator.addMethod("zipcodeUS", function(value, element) {
|
57
|
-
return this.optional(element) || /\d{5}-\d{4}$|^\d{5}$/.test(value);
|
58
|
-
}, "The specified US ZIP Code is invalid");
|
59
|
-
|
60
56
|
jQuery.validator.addMethod("integer", function(value, element) {
|
61
57
|
return this.optional(element) || /^-?\d+$/.test(value);
|
62
58
|
}, "A positive or negative non-decimal number please");
|
63
59
|
|
64
60
|
/**
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
jQuery.validator.addMethod(
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
61
|
+
* Return true, if the value is a valid vehicle identification number (VIN).
|
62
|
+
*
|
63
|
+
* Works with all kind of text inputs.
|
64
|
+
*
|
65
|
+
* @example <input type="text" size="20" name="VehicleID" class="{required:true,vinUS:true}" />
|
66
|
+
* @desc Declares a required input element whose value must be a valid vehicle identification number.
|
67
|
+
*
|
68
|
+
* @name jQuery.validator.methods.vinUS
|
69
|
+
* @type Boolean
|
70
|
+
* @cat Plugins/Validate/Methods
|
71
|
+
*/
|
72
|
+
jQuery.validator.addMethod(
|
73
|
+
"vinUS",
|
74
|
+
function(v){
|
75
|
+
if (v.length != 17)
|
76
|
+
return false;
|
77
|
+
var i, n, d, f, cd, cdv;
|
78
|
+
var LL = ["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"];
|
79
|
+
var VL = [1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9];
|
80
|
+
var FL = [8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2];
|
81
|
+
var rs = 0;
|
82
|
+
for(i = 0; i < 17; i++){
|
83
|
+
f = FL[i];
|
84
|
+
d = v.slice(i,i+1);
|
85
|
+
if(i == 8){
|
86
|
+
cdv = d;
|
87
|
+
}
|
88
|
+
if(!isNaN(d)){
|
89
|
+
d *= f;
|
90
|
+
}
|
91
|
+
else{
|
92
|
+
for(n = 0; n < LL.length; n++){
|
93
|
+
if(d.toUpperCase() === LL[n]){
|
94
|
+
d = VL[n];
|
95
|
+
d *= f;
|
96
|
+
if(isNaN(cdv) && n == 8){
|
97
|
+
cdv = LL[n];
|
98
|
+
}
|
99
|
+
break;
|
100
|
+
}
|
101
|
+
}
|
102
|
+
}
|
103
|
+
rs += d;
|
104
104
|
}
|
105
|
-
rs
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
return true;
|
113
|
-
}
|
114
|
-
return false;
|
115
|
-
}, "The specified vehicle identification number (VIN) is invalid.");
|
105
|
+
cd = rs % 11;
|
106
|
+
if(cd == 10){cd = "X";}
|
107
|
+
if(cd == cdv){return true;}
|
108
|
+
return false;
|
109
|
+
},
|
110
|
+
"The specified vehicle identification number (VIN) is invalid."
|
111
|
+
);
|
116
112
|
|
117
113
|
/**
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
jQuery.validator.addMethod(
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
var
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
114
|
+
* Return true, if the value is a valid date, also making this formal check dd/mm/yyyy.
|
115
|
+
*
|
116
|
+
* @example jQuery.validator.methods.date("01/01/1900")
|
117
|
+
* @result true
|
118
|
+
*
|
119
|
+
* @example jQuery.validator.methods.date("01/13/1990")
|
120
|
+
* @result false
|
121
|
+
*
|
122
|
+
* @example jQuery.validator.methods.date("01.01.1900")
|
123
|
+
* @result false
|
124
|
+
*
|
125
|
+
* @example <input name="pippo" class="{dateITA:true}" />
|
126
|
+
* @desc Declares an optional input element whose value must be a valid date.
|
127
|
+
*
|
128
|
+
* @name jQuery.validator.methods.dateITA
|
129
|
+
* @type Boolean
|
130
|
+
* @cat Plugins/Validate/Methods
|
131
|
+
*/
|
132
|
+
jQuery.validator.addMethod(
|
133
|
+
"dateITA",
|
134
|
+
function(value, element) {
|
135
|
+
var check = false;
|
136
|
+
var re = /^\d{1,2}\/\d{1,2}\/\d{4}$/;
|
137
|
+
if( re.test(value)){
|
138
|
+
var adata = value.split('/');
|
139
|
+
var gg = parseInt(adata[0],10);
|
140
|
+
var mm = parseInt(adata[1],10);
|
141
|
+
var aaaa = parseInt(adata[2],10);
|
142
|
+
var xdata = new Date(aaaa,mm-1,gg);
|
143
|
+
if ( ( xdata.getFullYear() == aaaa ) && ( xdata.getMonth () == mm - 1 ) && ( xdata.getDate() == gg ) )
|
144
|
+
check = true;
|
145
|
+
else
|
146
|
+
check = false;
|
147
|
+
} else
|
148
148
|
check = false;
|
149
|
-
|
150
|
-
}
|
151
|
-
|
152
|
-
|
153
|
-
return this.optional(element) || check;
|
154
|
-
}, "Please enter a correct date");
|
155
|
-
|
156
|
-
/**
|
157
|
-
* IBAN is the international bank account number.
|
158
|
-
* It has a country - specific format, that is checked here too
|
159
|
-
*/
|
160
|
-
jQuery.validator.addMethod("iban", function(value, element) {
|
161
|
-
// some quick simple tests to prevent needless work
|
162
|
-
if (this.optional(element)) {
|
163
|
-
return true;
|
164
|
-
}
|
165
|
-
if (!(/^([a-zA-Z0-9]{4} ){2,8}[a-zA-Z0-9]{1,4}|[a-zA-Z0-9]{12,34}$/.test(value))) {
|
166
|
-
return false;
|
167
|
-
}
|
168
|
-
|
169
|
-
// check the country code and find the country specific format
|
170
|
-
var iban = value.replace(/ /g,'').toUpperCase(); // remove spaces and to upper case
|
171
|
-
var countrycode = iban.substring(0,2);
|
172
|
-
var bbancountrypatterns = {
|
173
|
-
'AL': "\\d{8}[\\dA-Z]{16}",
|
174
|
-
'AD': "\\d{8}[\\dA-Z]{12}",
|
175
|
-
'AT': "\\d{16}",
|
176
|
-
'AZ': "[\\dA-Z]{4}\\d{20}",
|
177
|
-
'BE': "\\d{12}",
|
178
|
-
'BH': "[A-Z]{4}[\\dA-Z]{14}",
|
179
|
-
'BA': "\\d{16}",
|
180
|
-
'BR': "\\d{23}[A-Z][\\dA-Z]",
|
181
|
-
'BG': "[A-Z]{4}\\d{6}[\\dA-Z]{8}",
|
182
|
-
'CR': "\\d{17}",
|
183
|
-
'HR': "\\d{17}",
|
184
|
-
'CY': "\\d{8}[\\dA-Z]{16}",
|
185
|
-
'CZ': "\\d{20}",
|
186
|
-
'DK': "\\d{14}",
|
187
|
-
'DO': "[A-Z]{4}\\d{20}",
|
188
|
-
'EE': "\\d{16}",
|
189
|
-
'FO': "\\d{14}",
|
190
|
-
'FI': "\\d{14}",
|
191
|
-
'FR': "\\d{10}[\\dA-Z]{11}\\d{2}",
|
192
|
-
'GE': "[\\dA-Z]{2}\\d{16}",
|
193
|
-
'DE': "\\d{18}",
|
194
|
-
'GI': "[A-Z]{4}[\\dA-Z]{15}",
|
195
|
-
'GR': "\\d{7}[\\dA-Z]{16}",
|
196
|
-
'GL': "\\d{14}",
|
197
|
-
'GT': "[\\dA-Z]{4}[\\dA-Z]{20}",
|
198
|
-
'HU': "\\d{24}",
|
199
|
-
'IS': "\\d{22}",
|
200
|
-
'IE': "[\\dA-Z]{4}\\d{14}",
|
201
|
-
'IL': "\\d{19}",
|
202
|
-
'IT': "[A-Z]\\d{10}[\\dA-Z]{12}",
|
203
|
-
'KZ': "\\d{3}[\\dA-Z]{13}",
|
204
|
-
'KW': "[A-Z]{4}[\\dA-Z]{22}",
|
205
|
-
'LV': "[A-Z]{4}[\\dA-Z]{13}",
|
206
|
-
'LB': "\\d{4}[\\dA-Z]{20}",
|
207
|
-
'LI': "\\d{5}[\\dA-Z]{12}",
|
208
|
-
'LT': "\\d{16}",
|
209
|
-
'LU': "\\d{3}[\\dA-Z]{13}",
|
210
|
-
'MK': "\\d{3}[\\dA-Z]{10}\\d{2}",
|
211
|
-
'MT': "[A-Z]{4}\\d{5}[\\dA-Z]{18}",
|
212
|
-
'MR': "\\d{23}",
|
213
|
-
'MU': "[A-Z]{4}\\d{19}[A-Z]{3}",
|
214
|
-
'MC': "\\d{10}[\\dA-Z]{11}\\d{2}",
|
215
|
-
'MD': "[\\dA-Z]{2}\\d{18}",
|
216
|
-
'ME': "\\d{18}",
|
217
|
-
'NL': "[A-Z]{4}\\d{10}",
|
218
|
-
'NO': "\\d{11}",
|
219
|
-
'PK': "[\\dA-Z]{4}\\d{16}",
|
220
|
-
'PS': "[\\dA-Z]{4}\\d{21}",
|
221
|
-
'PL': "\\d{24}",
|
222
|
-
'PT': "\\d{21}",
|
223
|
-
'RO': "[A-Z]{4}[\\dA-Z]{16}",
|
224
|
-
'SM': "[A-Z]\\d{10}[\\dA-Z]{12}",
|
225
|
-
'SA': "\\d{2}[\\dA-Z]{18}",
|
226
|
-
'RS': "\\d{18}",
|
227
|
-
'SK': "\\d{20}",
|
228
|
-
'SI': "\\d{15}",
|
229
|
-
'ES': "\\d{20}",
|
230
|
-
'SE': "\\d{20}",
|
231
|
-
'CH': "\\d{5}[\\dA-Z]{12}",
|
232
|
-
'TN': "\\d{20}",
|
233
|
-
'TR': "\\d{5}[\\dA-Z]{17}",
|
234
|
-
'AE': "\\d{3}\\d{16}",
|
235
|
-
'GB': "[A-Z]{4}\\d{14}",
|
236
|
-
'VG': "[\\dA-Z]{4}\\d{16}"
|
237
|
-
};
|
238
|
-
var bbanpattern = bbancountrypatterns[countrycode];
|
239
|
-
// As new countries will start using IBAN in the
|
240
|
-
// future, we only check if the countrycode is known.
|
241
|
-
// This prevents false negatives, while almost all
|
242
|
-
// false positives introduced by this, will be caught
|
243
|
-
// by the checksum validation below anyway.
|
244
|
-
// Strict checking should return FALSE for unknown
|
245
|
-
// countries.
|
246
|
-
if (typeof bbanpattern !== 'undefined') {
|
247
|
-
var ibanregexp = new RegExp("^[A-Z]{2}\\d{2}" + bbanpattern + "$", "");
|
248
|
-
if (!(ibanregexp.test(iban))) {
|
249
|
-
return false; // invalid country specific format
|
250
|
-
}
|
251
|
-
}
|
252
|
-
|
253
|
-
// now check the checksum, first convert to digits
|
254
|
-
var ibancheck = iban.substring(4,iban.length) + iban.substring(0,4);
|
255
|
-
var ibancheckdigits = "";
|
256
|
-
var leadingZeroes = true;
|
257
|
-
var charAt;
|
258
|
-
for (var i =0; i<ibancheck.length; i++) {
|
259
|
-
charAt = ibancheck.charAt(i);
|
260
|
-
if (charAt !== "0") {
|
261
|
-
leadingZeroes = false;
|
262
|
-
}
|
263
|
-
if (!leadingZeroes) {
|
264
|
-
ibancheckdigits += "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(charAt);
|
265
|
-
}
|
266
|
-
}
|
267
|
-
|
268
|
-
// calculate the result of: ibancheckdigits % 97
|
269
|
-
var cRest = '';
|
270
|
-
var cOperator = '';
|
271
|
-
for (var p=0; p<ibancheckdigits.length; p++) {
|
272
|
-
var cChar = ibancheckdigits.charAt(p);
|
273
|
-
cOperator = '' + cRest + '' + cChar;
|
274
|
-
cRest = cOperator % 97;
|
275
|
-
}
|
276
|
-
return cRest === 1;
|
277
|
-
}, "Please specify a valid IBAN");
|
149
|
+
return this.optional(element) || check;
|
150
|
+
},
|
151
|
+
"Please enter a correct date"
|
152
|
+
);
|
278
153
|
|
279
154
|
jQuery.validator.addMethod("dateNL", function(value, element) {
|
280
|
-
|
281
|
-
}, "
|
282
|
-
|
283
|
-
/**
|
284
|
-
* Dutch phone numbers have 10 digits (or 11 and start with +31).
|
285
|
-
*/
|
286
|
-
jQuery.validator.addMethod("phoneNL", function(value, element) {
|
287
|
-
return this.optional(element) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(value);
|
288
|
-
}, "Please specify a valid phone number.");
|
289
|
-
|
290
|
-
jQuery.validator.addMethod("mobileNL", function(value, element) {
|
291
|
-
return this.optional(element) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(value);
|
292
|
-
}, "Please specify a valid mobile number");
|
293
|
-
|
294
|
-
jQuery.validator.addMethod("postalcodeNL", function(value, element) {
|
295
|
-
return this.optional(element) || /^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(value);
|
296
|
-
}, "Please specify a valid postal code");
|
297
|
-
|
298
|
-
/*
|
299
|
-
* Dutch bank account numbers (not 'giro' numbers) have 9 digits
|
300
|
-
* and pass the '11 check'.
|
301
|
-
* We accept the notation with spaces, as that is common.
|
302
|
-
* acceptable: 123456789 or 12 34 56 789
|
303
|
-
*/
|
304
|
-
jQuery.validator.addMethod("bankaccountNL", function(value, element) {
|
305
|
-
if (this.optional(element)) {
|
306
|
-
return true;
|
307
|
-
}
|
308
|
-
if (!(/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(value))) {
|
309
|
-
return false;
|
310
|
-
}
|
311
|
-
// now '11 check'
|
312
|
-
var account = value.replace(/ /g,''); // remove spaces
|
313
|
-
var sum = 0;
|
314
|
-
var len = account.length;
|
315
|
-
for (var pos=0; pos<len; pos++) {
|
316
|
-
var factor = len - pos;
|
317
|
-
var digit = account.substring(pos, pos+1);
|
318
|
-
sum = sum + factor * digit;
|
319
|
-
}
|
320
|
-
return sum % 11 === 0;
|
321
|
-
}, "Please specify a valid bank account number");
|
322
|
-
|
323
|
-
/**
|
324
|
-
* Dutch giro account numbers (not bank numbers) have max 7 digits
|
325
|
-
*/
|
326
|
-
jQuery.validator.addMethod("giroaccountNL", function(value, element) {
|
327
|
-
return this.optional(element) || /^[0-9]{1,7}$/.test(value);
|
328
|
-
}, "Please specify a valid giro account number");
|
329
|
-
|
330
|
-
jQuery.validator.addMethod("bankorgiroaccountNL", function(value, element) {
|
331
|
-
return this.optional(element) ||
|
332
|
-
($.validator.methods["bankaccountNL"].call(this, value, element)) ||
|
333
|
-
($.validator.methods["giroaccountNL"].call(this, value, element));
|
334
|
-
}, "Please specify a valid bank or giro account number");
|
335
|
-
|
155
|
+
return this.optional(element) || /^\d\d?[\.\/-]\d\d?[\.\/-]\d\d\d?\d?$/.test(value);
|
156
|
+
}, "Vul hier een geldige datum in."
|
157
|
+
);
|
336
158
|
|
337
159
|
jQuery.validator.addMethod("time", function(value, element) {
|
338
|
-
return this.optional(element) || /^([01]\d|2[0-3])(:[0-5]\d){
|
160
|
+
return this.optional(element) || /^([01]\d|2[0-3])(:[0-5]\d){0,2}$/.test(value);
|
339
161
|
}, "Please enter a valid time, between 00:00 and 23:59");
|
340
162
|
jQuery.validator.addMethod("time12h", function(value, element) {
|
341
|
-
return this.optional(element) || /^((0?[1-9]|1[012])(:[0-5]\d){
|
342
|
-
}, "Please enter a valid time
|
163
|
+
return this.optional(element) || /^((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))$/i.test(value);
|
164
|
+
}, "Please enter a valid time, between 00:00 am and 12:00 pm");
|
343
165
|
|
344
166
|
/**
|
345
167
|
* matches US phone number format
|
@@ -348,8 +170,10 @@ jQuery.validator.addMethod("time12h", function(value, element) {
|
|
348
170
|
* allows '-' or ' ' as a separator and allows parens around area code
|
349
171
|
* some people may want to put a '1' in front of their number
|
350
172
|
*
|
351
|
-
* 1(212)-999-2345
|
352
|
-
*
|
173
|
+
* 1(212)-999-2345
|
174
|
+
* or
|
175
|
+
* 212 999 2344
|
176
|
+
* or
|
353
177
|
* 212-999-0983
|
354
178
|
*
|
355
179
|
* but not
|
@@ -358,42 +182,21 @@ jQuery.validator.addMethod("time12h", function(value, element) {
|
|
358
182
|
* 212 123 4567
|
359
183
|
*/
|
360
184
|
jQuery.validator.addMethod("phoneUS", function(phone_number, element) {
|
361
|
-
|
185
|
+
phone_number = phone_number.replace(/\s+/g, "");
|
362
186
|
return this.optional(element) || phone_number.length > 9 &&
|
363
|
-
phone_number.match(/^(
|
187
|
+
phone_number.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/);
|
364
188
|
}, "Please specify a valid phone number");
|
365
189
|
|
366
190
|
jQuery.validator.addMethod('phoneUK', function(phone_number, element) {
|
367
|
-
|
368
|
-
|
369
|
-
phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/);
|
191
|
+
return this.optional(element) || phone_number.length > 9 &&
|
192
|
+
phone_number.match(/^(\(?(0|\+44)[1-9]{1}\d{1,4}?\)?\s?\d{3,4}\s?\d{3,4})$/);
|
370
193
|
}, 'Please specify a valid phone number');
|
371
194
|
|
372
195
|
jQuery.validator.addMethod('mobileUK', function(phone_number, element) {
|
373
|
-
|
374
|
-
|
375
|
-
phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[45789]\d{2}|624)\s?\d{3}\s?\d{3})$/);
|
196
|
+
return this.optional(element) || phone_number.length > 9 &&
|
197
|
+
phone_number.match(/^((0|\+44)7(5|6|7|8|9){1}\d{2}\s?\d{6})$/);
|
376
198
|
}, 'Please specify a valid mobile number');
|
377
199
|
|
378
|
-
//Matches UK landline + mobile, accepting only 01-3 for landline or 07 for mobile to exclude many premium numbers
|
379
|
-
jQuery.validator.addMethod('phonesUK', function(phone_number, element) {
|
380
|
-
phone_number = phone_number.replace(/\(|\)|\s+|-/g,'');
|
381
|
-
return this.optional(element) || phone_number.length > 9 &&
|
382
|
-
phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[45789]\d{8}|624\d{6})))$/);
|
383
|
-
}, 'Please specify a valid uk phone number');
|
384
|
-
// On the above three UK functions, do the following server side processing:
|
385
|
-
// Compare original input with this RegEx pattern:
|
386
|
-
// ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$
|
387
|
-
// Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0'
|
388
|
-
// Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2.
|
389
|
-
// A number of very detailed GB telephone number RegEx patterns can also be found at:
|
390
|
-
// http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers
|
391
|
-
|
392
|
-
// Matches UK postcode. Does not match to UK Channel Islands that have their own postcodes (non standard UK)
|
393
|
-
jQuery.validator.addMethod('postcodeUK', function(value, element) {
|
394
|
-
return this.optional(element) || /^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(value);
|
395
|
-
}, 'Please specify a valid UK postcode');
|
396
|
-
|
397
200
|
// TODO check if value starts with <, otherwise don't try stripping anything
|
398
201
|
jQuery.validator.addMethod("strippedminlength", function(value, element, param) {
|
399
202
|
return jQuery(value).text().length >= param;
|
@@ -406,71 +209,63 @@ jQuery.validator.addMethod("email2", function(value, element, param) {
|
|
406
209
|
|
407
210
|
// same as url, but TLD is optional
|
408
211
|
jQuery.validator.addMethod("url2", function(value, element, param) {
|
409
|
-
return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(
|
212
|
+
return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);
|
410
213
|
}, jQuery.validator.messages.url);
|
411
214
|
|
412
215
|
// NOTICE: Modified version of Castle.Components.Validator.CreditCardValidator
|
413
216
|
// Redistributed under the the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0
|
414
217
|
// Valid Types: mastercard, visa, amex, dinersclub, enroute, discover, jcb, unknown, all (overrides all other settings)
|
415
218
|
jQuery.validator.addMethod("creditcardtypes", function(value, element, param) {
|
416
|
-
|
219
|
+
|
220
|
+
if (/[^0-9-]+/.test(value))
|
417
221
|
return false;
|
418
|
-
}
|
419
222
|
|
420
223
|
value = value.replace(/\D/g, "");
|
421
224
|
|
422
225
|
var validTypes = 0x0000;
|
423
226
|
|
424
|
-
if (param.mastercard)
|
227
|
+
if (param.mastercard)
|
425
228
|
validTypes |= 0x0001;
|
426
|
-
|
427
|
-
if (param.visa) {
|
229
|
+
if (param.visa)
|
428
230
|
validTypes |= 0x0002;
|
429
|
-
|
430
|
-
if (param.amex) {
|
231
|
+
if (param.amex)
|
431
232
|
validTypes |= 0x0004;
|
432
|
-
|
433
|
-
if (param.dinersclub) {
|
233
|
+
if (param.dinersclub)
|
434
234
|
validTypes |= 0x0008;
|
435
|
-
|
436
|
-
if (param.enroute) {
|
235
|
+
if (param.enroute)
|
437
236
|
validTypes |= 0x0010;
|
438
|
-
|
439
|
-
if (param.discover) {
|
237
|
+
if (param.discover)
|
440
238
|
validTypes |= 0x0020;
|
441
|
-
|
442
|
-
if (param.jcb) {
|
239
|
+
if (param.jcb)
|
443
240
|
validTypes |= 0x0040;
|
444
|
-
|
445
|
-
if (param.unknown) {
|
241
|
+
if (param.unknown)
|
446
242
|
validTypes |= 0x0080;
|
447
|
-
|
448
|
-
if (param.all) {
|
243
|
+
if (param.all)
|
449
244
|
validTypes = 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040 | 0x0080;
|
450
|
-
|
451
|
-
if (validTypes & 0x0001 && /^(
|
452
|
-
return value.length
|
245
|
+
|
246
|
+
if (validTypes & 0x0001 && /^(51|52|53|54|55)/.test(value)) { //mastercard
|
247
|
+
return value.length == 16;
|
453
248
|
}
|
454
249
|
if (validTypes & 0x0002 && /^(4)/.test(value)) { //visa
|
455
|
-
return value.length
|
250
|
+
return value.length == 16;
|
456
251
|
}
|
457
|
-
if (validTypes & 0x0004 && /^(
|
458
|
-
return value.length
|
252
|
+
if (validTypes & 0x0004 && /^(34|37)/.test(value)) { //amex
|
253
|
+
return value.length == 15;
|
459
254
|
}
|
460
|
-
if (validTypes & 0x0008 && /^(
|
461
|
-
return value.length
|
255
|
+
if (validTypes & 0x0008 && /^(300|301|302|303|304|305|36|38)/.test(value)) { //dinersclub
|
256
|
+
return value.length == 14;
|
462
257
|
}
|
463
|
-
if (validTypes & 0x0010 && /^(
|
464
|
-
return value.length
|
258
|
+
if (validTypes & 0x0010 && /^(2014|2149)/.test(value)) { //enroute
|
259
|
+
return value.length == 15;
|
465
260
|
}
|
466
261
|
if (validTypes & 0x0020 && /^(6011)/.test(value)) { //discover
|
467
|
-
return value.length
|
262
|
+
return value.length == 16;
|
468
263
|
}
|
469
264
|
if (validTypes & 0x0040 && /^(3)/.test(value)) { //jcb
|
470
|
-
return value.length
|
265
|
+
return value.length == 16;
|
471
266
|
}
|
472
267
|
if (validTypes & 0x0040 && /^(2131|1800)/.test(value)) { //jcb
|
473
|
-
return value.length
|
268
|
+
return value.length == 15;
|
474
269
|
}
|
475
270
|
if (validTypes & 0x0080) { //unknown
|
476
271
|
return true;
|
@@ -479,139 +274,27 @@ jQuery.validator.addMethod("creditcardtypes", function(value, element, param) {
|
|
479
274
|
}, "Please enter a valid credit card number.");
|
480
275
|
|
481
276
|
jQuery.validator.addMethod("ipv4", function(value, element, param) {
|
482
|
-
|
277
|
+
return this.optional(element) || /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i.test(value);
|
483
278
|
}, "Please enter a valid IP v4 address.");
|
484
279
|
|
485
280
|
jQuery.validator.addMethod("ipv6", function(value, element, param) {
|
486
|
-
|
281
|
+
return this.optional(element) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(value);
|
487
282
|
}, "Please enter a valid IP v6 address.");
|
488
283
|
|
489
284
|
/**
|
490
|
-
* Return true if the field value matches the given format RegExp
|
491
|
-
*
|
492
|
-
* @example jQuery.validator.methods.pattern("AR1004",element,/^AR\d{4}$/)
|
493
|
-
* @result true
|
494
|
-
*
|
495
|
-
* @example jQuery.validator.methods.pattern("BR1004",element,/^AR\d{4}$/)
|
496
|
-
* @result false
|
497
|
-
*
|
498
|
-
* @name jQuery.validator.methods.pattern
|
499
|
-
* @type Boolean
|
500
|
-
* @cat Plugins/Validate/Methods
|
501
|
-
*/
|
285
|
+
* Return true if the field value matches the given format RegExp
|
286
|
+
*
|
287
|
+
* @example jQuery.validator.methods.pattern("AR1004",element,/^AR\d{4}$/)
|
288
|
+
* @result true
|
289
|
+
*
|
290
|
+
* @example jQuery.validator.methods.pattern("BR1004",element,/^AR\d{4}$/)
|
291
|
+
* @result false
|
292
|
+
*
|
293
|
+
* @name jQuery.validator.methods.pattern
|
294
|
+
* @type Boolean
|
295
|
+
* @cat Plugins/Validate/Methods
|
296
|
+
*/
|
502
297
|
jQuery.validator.addMethod("pattern", function(value, element, param) {
|
503
|
-
|
504
|
-
return true;
|
505
|
-
}
|
506
|
-
if (typeof param === 'string') {
|
507
|
-
param = new RegExp('^(?:' + param + ')$');
|
508
|
-
}
|
509
|
-
return param.test(value);
|
298
|
+
return this.optional(element) || param.test(value);
|
510
299
|
}, "Invalid format.");
|
511
300
|
|
512
|
-
|
513
|
-
/*
|
514
|
-
* Lets you say "at least X inputs that match selector Y must be filled."
|
515
|
-
*
|
516
|
-
* The end result is that neither of these inputs:
|
517
|
-
*
|
518
|
-
* <input class="productinfo" name="partnumber">
|
519
|
-
* <input class="productinfo" name="description">
|
520
|
-
*
|
521
|
-
* ...will validate unless at least one of them is filled.
|
522
|
-
*
|
523
|
-
* partnumber: {require_from_group: [1,".productinfo"]},
|
524
|
-
* description: {require_from_group: [1,".productinfo"]}
|
525
|
-
*
|
526
|
-
*/
|
527
|
-
jQuery.validator.addMethod("require_from_group", function(value, element, options) {
|
528
|
-
var validator = this;
|
529
|
-
var selector = options[1];
|
530
|
-
var validOrNot = $(selector, element.form).filter(function() {
|
531
|
-
return validator.elementValue(this);
|
532
|
-
}).length >= options[0];
|
533
|
-
|
534
|
-
if(!$(element).data('being_validated')) {
|
535
|
-
var fields = $(selector, element.form);
|
536
|
-
fields.data('being_validated', true);
|
537
|
-
fields.valid();
|
538
|
-
fields.data('being_validated', false);
|
539
|
-
}
|
540
|
-
return validOrNot;
|
541
|
-
}, jQuery.format("Please fill at least {0} of these fields."));
|
542
|
-
|
543
|
-
/*
|
544
|
-
* Lets you say "either at least X inputs that match selector Y must be filled,
|
545
|
-
* OR they must all be skipped (left blank)."
|
546
|
-
*
|
547
|
-
* The end result, is that none of these inputs:
|
548
|
-
*
|
549
|
-
* <input class="productinfo" name="partnumber">
|
550
|
-
* <input class="productinfo" name="description">
|
551
|
-
* <input class="productinfo" name="color">
|
552
|
-
*
|
553
|
-
* ...will validate unless either at least two of them are filled,
|
554
|
-
* OR none of them are.
|
555
|
-
*
|
556
|
-
* partnumber: {skip_or_fill_minimum: [2,".productinfo"]},
|
557
|
-
* description: {skip_or_fill_minimum: [2,".productinfo"]},
|
558
|
-
* color: {skip_or_fill_minimum: [2,".productinfo"]}
|
559
|
-
*
|
560
|
-
*/
|
561
|
-
jQuery.validator.addMethod("skip_or_fill_minimum", function(value, element, options) {
|
562
|
-
var validator = this,
|
563
|
-
numberRequired = options[0],
|
564
|
-
selector = options[1];
|
565
|
-
var numberFilled = $(selector, element.form).filter(function() {
|
566
|
-
return validator.elementValue(this);
|
567
|
-
}).length;
|
568
|
-
var valid = numberFilled >= numberRequired || numberFilled === 0;
|
569
|
-
|
570
|
-
if(!$(element).data('being_validated')) {
|
571
|
-
var fields = $(selector, element.form);
|
572
|
-
fields.data('being_validated', true);
|
573
|
-
fields.valid();
|
574
|
-
fields.data('being_validated', false);
|
575
|
-
}
|
576
|
-
return valid;
|
577
|
-
}, jQuery.format("Please either skip these fields or fill at least {0} of them."));
|
578
|
-
|
579
|
-
// Accept a value from a file input based on a required mimetype
|
580
|
-
jQuery.validator.addMethod("accept", function(value, element, param) {
|
581
|
-
// Split mime on commas in case we have multiple types we can accept
|
582
|
-
var typeParam = typeof param === "string" ? param.replace(/\s/g, '').replace(/,/g, '|') : "image/*",
|
583
|
-
optionalValue = this.optional(element),
|
584
|
-
i, file;
|
585
|
-
|
586
|
-
// Element is optional
|
587
|
-
if (optionalValue) {
|
588
|
-
return optionalValue;
|
589
|
-
}
|
590
|
-
|
591
|
-
if ($(element).attr("type") === "file") {
|
592
|
-
// If we are using a wildcard, make it regex friendly
|
593
|
-
typeParam = typeParam.replace(/\*/g, ".*");
|
594
|
-
|
595
|
-
// Check if the element has a FileList before checking each file
|
596
|
-
if (element.files && element.files.length) {
|
597
|
-
for (i = 0; i < element.files.length; i++) {
|
598
|
-
file = element.files[i];
|
599
|
-
|
600
|
-
// Grab the mimetype from the loaded file, verify it matches
|
601
|
-
if (!file.type.match(new RegExp( ".?(" + typeParam + ")$", "i"))) {
|
602
|
-
return false;
|
603
|
-
}
|
604
|
-
}
|
605
|
-
}
|
606
|
-
}
|
607
|
-
|
608
|
-
// Either return true because we've validated each file, or because the
|
609
|
-
// browser does not support element.files and the FileList feature
|
610
|
-
return true;
|
611
|
-
}, jQuery.format("Please enter a value with a valid mimetype."));
|
612
|
-
|
613
|
-
// Older "accept" file extension method. Old docs: http://docs.jquery.com/Plugins/Validation/Methods/accept
|
614
|
-
jQuery.validator.addMethod("extension", function(value, element, param) {
|
615
|
-
param = typeof param === "string" ? param.replace(/,/g, '|') : "png|jpe?g|gif";
|
616
|
-
return this.optional(element) || value.match(new RegExp(".(" + param + ")$", "i"));
|
617
|
-
}, jQuery.format("Please enter a value with a valid extension."));
|