spree 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of spree might be problematic. Click here for more details.
- data/CHANGELOG +457 -425
- data/{README.markdown → README.md} +4 -0
- data/Rakefile +2 -2
- data/app/controllers/admin/adjustments_controller.rb +8 -9
- data/app/controllers/admin/checkouts_controller.rb +10 -2
- data/app/controllers/admin/line_items_controller.rb +0 -1
- data/app/controllers/admin/payments_controller.rb +8 -7
- data/app/controllers/admin/shipments_controller.rb +1 -1
- data/app/controllers/checkouts_controller.rb +16 -5
- data/app/controllers/spree/base_controller.rb +2 -2
- data/app/helpers/admin/navigation_helper.rb +1 -1
- data/app/helpers/checkouts_helper.rb +1 -1
- data/app/helpers/products_helper.rb +1 -1
- data/app/helpers/taxons_helper.rb +1 -1
- data/app/models/address.rb +9 -0
- data/app/models/checkout.rb +13 -7
- data/app/models/creditcard.rb +2 -2
- data/app/models/model_cache_cleaner.rb +13 -0
- data/app/models/order.rb +6 -8
- data/app/models/payment.rb +18 -17
- data/app/models/payment_method.rb +2 -2
- data/app/models/product.rb +1 -2
- data/app/models/return_authorization.rb +3 -1
- data/app/models/shipping_method.rb +16 -6
- data/app/models/zone.rb +34 -3
- data/config/database.yml +4 -21
- data/config/environment.rb +6 -6
- data/config/environments/test.rb +1 -0
- data/config/locales/en_spree.yml +10 -9
- data/db/migrate/20100624110730_add_display_to_shipping_methods.rb +9 -0
- data/db/migrate/20100624123336_rename_payment_method_display.rb +9 -0
- data/db/sample/orders.yml +3 -3
- data/db/sample/payments.rb +6 -5
- data/db/sample/products.rb +2 -2
- data/db/schema.rb +9 -27
- data/lib/easy_role_requirement_system.rb +1 -1
- data/lib/generators/extension/extension_generator.rb +7 -22
- data/lib/generators/extension/templates/functional_test.rb +1 -1
- data/lib/generators/extension/templates/tasks.rake +2 -2
- data/lib/generators/extension_controller/extension_controller_generator.rb +1 -1
- data/lib/generators/extension_model/extension_model_generator.rb +1 -1
- data/lib/generators/instance/instance_generator.rb +24 -24
- data/lib/generators/instance/templates/instance_generate +1 -1
- data/lib/generators/theme/theme_generator.rb +6 -10
- data/lib/plugins/extension_patches/lib/asset_copy.rb +2 -2
- data/lib/spree.rb +1 -1
- data/lib/spree/initializer.rb +15 -15
- data/lib/spree/search.rb +1 -1
- data/lib/tasks/cucumber.rake +1 -1
- data/lib/tasks/extensions.rake +6 -6
- data/lib/tasks/framework.rake +1 -1
- data/lib/tasks/instance.rake +6 -6
- data/lib/validation_group.rb +16 -16
- data/script/extension +2 -2
- data/test/functional/products_controller_test.rb +13 -0
- data/test/test_helper.rb +1 -1
- data/test/unit/checkout_test.rb +18 -9
- data/vendor/extensions/README +1 -1
- data/vendor/extensions/api/Rakefile +2 -2
- data/vendor/extensions/api/lib/tasks/api_extension_tasks.rake +2 -2
- data/vendor/extensions/overview_dashboard/Rakefile +2 -2
- data/vendor/extensions/overview_dashboard/app/views/admin/overview/index.html.erb +5 -5
- data/vendor/extensions/overview_dashboard/lib/tasks/overview_dashboard_extension_tasks.rake +2 -2
- data/vendor/extensions/payment_gateway/Rakefile +2 -2
- data/vendor/extensions/payment_gateway/app/models/gateway/authorize_net_cim.rb +6 -2
- data/vendor/extensions/payment_gateway/app/models/gateway/braintree.rb +88 -0
- data/vendor/extensions/payment_gateway/config/locales/en.yml +2 -1
- data/vendor/extensions/payment_gateway/lib/active_merchant/billing/authorize_net_cim.rb +4 -2
- data/vendor/extensions/payment_gateway/lib/spree/payment_gateway.rb +1 -1
- data/vendor/extensions/payment_gateway/lib/tasks/payment_gateway_extension_tasks.rake +2 -2
- data/vendor/extensions/payment_gateway/payment_gateway_extension.rb +1 -0
- data/vendor/extensions/payment_gateway/test/unit/authorize_net_cim_test.rb +2 -1
- data/vendor/extensions/payment_gateway/test/unit/braintree_test.rb +200 -0
- data/vendor/extensions/theme_default/Rakefile +2 -2
- data/vendor/extensions/theme_default/app/stylesheets/_buttons.less +7 -2
- data/vendor/extensions/theme_default/app/stylesheets/_colors.less +1 -1
- data/vendor/extensions/theme_default/app/stylesheets/_layout.less +7 -2
- data/vendor/extensions/theme_default/app/views/admin/payment_methods/_form.html.erb +3 -4
- data/vendor/extensions/theme_default/app/views/admin/payment_methods/index.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/shared/_additional_field.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/shared/_calculator_fields.html.erb +6 -6
- data/vendor/extensions/theme_default/app/views/admin/shared/_configuration_menu.html.erb +13 -13
- data/vendor/extensions/theme_default/app/views/admin/shared/_product_tabs.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/shipping_methods/_form.html.erb +6 -0
- data/vendor/extensions/theme_default/app/views/admin/shipping_methods/index.html.erb +2 -0
- data/vendor/extensions/theme_default/app/views/checkouts/_address.html.erb +7 -9
- data/vendor/extensions/theme_default/app/views/checkouts/_payment.html.erb +4 -4
- data/vendor/extensions/theme_default/app/views/checkouts/_summary.html.erb +4 -4
- data/vendor/extensions/theme_default/app/views/layouts/admin.html.erb +36 -35
- data/vendor/extensions/theme_default/app/views/products/_thumbnails.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/shared/_head.html.erb +2 -2
- data/vendor/extensions/theme_default/app/views/shared/_products.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/states/index.js.erb +1 -1
- data/vendor/extensions/theme_default/lib/tasks/theme_default_extension_tasks.rake +2 -2
- data/vendor/extensions/theme_default/public/favicon.ico +0 -0
- data/vendor/extensions/theme_default/public/images/admin/bg/header.png +0 -0
- data/vendor/extensions/theme_default/public/javascripts/calculator.js +3 -1
- data/vendor/extensions/theme_default/public/javascripts/checkout.js +44 -18
- data/vendor/extensions/theme_default/public/stylesheets/admin/admin.css +29 -24
- data/vendor/extensions/theme_default/public/stylesheets/screen.css +9 -7
- data/vendor/plugins/attribute_fu/init.rb +2 -2
- data/vendor/plugins/delegate_belongs_to/spec/spec_helper.rb +1 -1
- data/vendor/plugins/jrails/install.rb +1 -1
- data/vendor/plugins/jrails/lib/tasks/jrails.rake +2 -2
- data/vendor/plugins/jrails_auto_complete/install.rb +1 -1
- data/vendor/plugins/jrails_auto_complete/uninstall.rb +1 -1
- data/vendor/plugins/open_id_authentication/lib/open_id_authentication.rb +1 -1
- metadata +59 -659
- data/lib/generators/extension/templates/RSpecRakefile +0 -137
- data/lib/generators/extension/templates/spec.opts +0 -6
- data/lib/generators/extension/templates/spec_helper.rb +0 -37
- data/lib/generators/extension_controller/templates/controller_spec.rb +0 -23
- data/lib/generators/extension_controller/templates/helper_spec.rb +0 -11
- data/lib/generators/extension_controller/templates/view_spec.rb +0 -12
- data/lib/generators/extension_model/templates/model_spec.rb +0 -11
- data/lib/tasks/rspec.rake +0 -182
- data/public/images/add-to-cart.png +0 -0
- data/public/images/admin/bg/active-tab.png +0 -0
- data/public/images/admin/bg/admin_tab_back.png +0 -0
- data/public/images/admin/bg/admin_tab_selected_back.png +0 -0
- data/public/images/admin/bg/content-back-blue.png +0 -0
- data/public/images/admin/bg/content-back-green.png +0 -0
- data/public/images/admin/bg/content-back.png +0 -0
- data/public/images/admin/bg/flash-error.png +0 -0
- data/public/images/admin/bg/flash-notice.png +0 -0
- data/public/images/admin/bg/green-stripes.gif +0 -0
- data/public/images/admin/bg/green-stripes.png +0 -0
- data/public/images/admin/bg/grid_header_back.png +0 -0
- data/public/images/admin/bg/grid_header_back_green.png +0 -0
- data/public/images/admin/bg/header-bg.png +0 -0
- data/public/images/admin/bg/header_bg.jpg +0 -0
- data/public/images/admin/bg/menu-current.png +0 -0
- data/public/images/admin/bg/red-stripes.gif +0 -0
- data/public/images/admin/bg/red-stripes.png +0 -0
- data/public/images/admin/bg/spree_50.png +0 -0
- data/public/images/admin/bg/subnav-divider.png +0 -0
- data/public/images/admin/bg/subnav.png +0 -0
- data/public/images/admin/bg/tab-back.png +0 -0
- data/public/images/admin/buttons/blue/left_01.png +0 -0
- data/public/images/admin/buttons/blue/right_01.png +0 -0
- data/public/images/admin/buttons/drag-handle-green.png +0 -0
- data/public/images/admin/buttons/green/left_01.png +0 -0
- data/public/images/admin/buttons/green/right_01.png +0 -0
- data/public/images/admin/buttons/left_01.png +0 -0
- data/public/images/admin/buttons/left_01_small.png +0 -0
- data/public/images/admin/buttons/orange/left_03.png +0 -0
- data/public/images/admin/buttons/orange/right_03.png +0 -0
- data/public/images/admin/buttons/right_01.png +0 -0
- data/public/images/admin/buttons/right_01_small.png +0 -0
- data/public/images/admin/icons/16x16/1.png +0 -0
- data/public/images/admin/icons/16x16/10.png +0 -0
- data/public/images/admin/icons/16x16/2.png +0 -0
- data/public/images/admin/icons/16x16/3.png +0 -0
- data/public/images/admin/icons/16x16/4.png +0 -0
- data/public/images/admin/icons/16x16/5.png +0 -0
- data/public/images/admin/icons/16x16/6.png +0 -0
- data/public/images/admin/icons/16x16/7.png +0 -0
- data/public/images/admin/icons/16x16/8.png +0 -0
- data/public/images/admin/icons/16x16/9.png +0 -0
- data/public/images/admin/icons/32x32/1.png +0 -0
- data/public/images/admin/icons/32x32/10.png +0 -0
- data/public/images/admin/icons/32x32/11.png +0 -0
- data/public/images/admin/icons/32x32/2.png +0 -0
- data/public/images/admin/icons/32x32/3.png +0 -0
- data/public/images/admin/icons/32x32/4.png +0 -0
- data/public/images/admin/icons/32x32/5.png +0 -0
- data/public/images/admin/icons/32x32/6.png +0 -0
- data/public/images/admin/icons/32x32/7.png +0 -0
- data/public/images/admin/icons/32x32/8.png +0 -0
- data/public/images/admin/icons/32x32/9.png +0 -0
- data/public/images/admin/icons/accept.png +0 -0
- data/public/images/admin/icons/add.gif +0 -0
- data/public/images/admin/icons/add.png +0 -0
- data/public/images/admin/icons/arrow-down.gif +0 -0
- data/public/images/admin/icons/cross.png +0 -0
- data/public/images/admin/icons/delete.gif +0 -0
- data/public/images/admin/icons/delete.png +0 -0
- data/public/images/admin/icons/drag.gif +0 -0
- data/public/images/admin/icons/edit.gif +0 -0
- data/public/images/admin/icons/edit.png +0 -0
- data/public/images/admin/icons/email.png +0 -0
- data/public/images/admin/icons/error.png +0 -0
- data/public/images/admin/icons/exclamation.png +0 -0
- data/public/images/admin/icons/feed.png +0 -0
- data/public/images/admin/icons/pdf.png +0 -0
- data/public/images/admin/icons/reorder.gif +0 -0
- data/public/images/admin/icons/search.gif +0 -0
- data/public/images/admin/icons/send-email.png +0 -0
- data/public/images/admin/icons/stop.png +0 -0
- data/public/images/admin/icons/tick.png +0 -0
- data/public/images/admin/icons/up.gif +0 -0
- data/public/images/admin/icons/xls.png +0 -0
- data/public/images/admin/tabs/off-left.png +0 -0
- data/public/images/admin/tabs/off-right.png +0 -0
- data/public/images/admin/tabs/on-left.png +0 -0
- data/public/images/admin/tabs/on-right.png +0 -0
- data/public/images/ajax_loader.gif +0 -0
- data/public/images/amex_cid.gif +0 -0
- data/public/images/bg-button-hover.png +0 -0
- data/public/images/bg-button-pressed.png +0 -0
- data/public/images/bg-button.gif +0 -0
- data/public/images/bg-button.png +0 -0
- data/public/images/blue/left_01.png +0 -0
- data/public/images/blue/right_01.png +0 -0
- data/public/images/body-back.png +0 -0
- data/public/images/bottom_shine.png +0 -0
- data/public/images/breadcrumb.gif +0 -0
- data/public/images/button-dark-hover.png +0 -0
- data/public/images/button-dark.png +0 -0
- data/public/images/buttons/bg-button-hover.png +0 -0
- data/public/images/buttons/bg-button-pressed.png +0 -0
- data/public/images/buttons/bg-button.gif +0 -0
- data/public/images/buttons/bg-button.png +0 -0
- data/public/images/buttons/blue/left_01.png +0 -0
- data/public/images/buttons/blue/right_01.png +0 -0
- data/public/images/buttons/button-dark-hover.png +0 -0
- data/public/images/buttons/button-dark.png +0 -0
- data/public/images/buttons/drag-handle-green.png +0 -0
- data/public/images/buttons/green/left_01.png +0 -0
- data/public/images/buttons/green/right_01.png +0 -0
- data/public/images/buttons/left_01.png +0 -0
- data/public/images/buttons/left_01_small.png +0 -0
- data/public/images/buttons/orange/left_03.png +0 -0
- data/public/images/buttons/orange/right_03.png +0 -0
- data/public/images/buttons/right_01.png +0 -0
- data/public/images/buttons/right_01_small.png +0 -0
- data/public/images/buttons/sxsw-ribbon-v1.png +0 -0
- data/public/images/buttons/top-shine.png +0 -0
- data/public/images/calendar_date_select/calendar.gif +0 -0
- data/public/images/cart-empty.png +0 -0
- data/public/images/cart-empty_x32.png +0 -0
- data/public/images/cart-full.png +0 -0
- data/public/images/cart-full_x32.png +0 -0
- data/public/images/checkout.png +0 -0
- data/public/images/creditcard.gif +0 -0
- data/public/images/datepicker/backstripes.gif +0 -0
- data/public/images/datepicker/bg_header.jpg +0 -0
- data/public/images/datepicker/bullet1.gif +0 -0
- data/public/images/datepicker/bullet2.gif +0 -0
- data/public/images/datepicker/cal.gif +0 -0
- data/public/images/datepicker/gradient-e5e5e5-ffffff.gif +0 -0
- data/public/images/discover_cid.gif +0 -0
- data/public/images/drag-handle-green.png +0 -0
- data/public/images/flags/ad.png +0 -0
- data/public/images/flags/ae.png +0 -0
- data/public/images/flags/af.png +0 -0
- data/public/images/flags/ag.png +0 -0
- data/public/images/flags/ai.png +0 -0
- data/public/images/flags/al.png +0 -0
- data/public/images/flags/am.png +0 -0
- data/public/images/flags/an.png +0 -0
- data/public/images/flags/ao.png +0 -0
- data/public/images/flags/ar.png +0 -0
- data/public/images/flags/as.png +0 -0
- data/public/images/flags/at.png +0 -0
- data/public/images/flags/au.png +0 -0
- data/public/images/flags/aw.png +0 -0
- data/public/images/flags/ax.png +0 -0
- data/public/images/flags/az.png +0 -0
- data/public/images/flags/ba.png +0 -0
- data/public/images/flags/bb.png +0 -0
- data/public/images/flags/bd.png +0 -0
- data/public/images/flags/be.png +0 -0
- data/public/images/flags/bf.png +0 -0
- data/public/images/flags/bg.png +0 -0
- data/public/images/flags/bh.png +0 -0
- data/public/images/flags/bi.png +0 -0
- data/public/images/flags/bj.png +0 -0
- data/public/images/flags/bm.png +0 -0
- data/public/images/flags/bn.png +0 -0
- data/public/images/flags/bo.png +0 -0
- data/public/images/flags/br.png +0 -0
- data/public/images/flags/bs.png +0 -0
- data/public/images/flags/bt.png +0 -0
- data/public/images/flags/bv.png +0 -0
- data/public/images/flags/bw.png +0 -0
- data/public/images/flags/by.png +0 -0
- data/public/images/flags/bz.png +0 -0
- data/public/images/flags/ca.png +0 -0
- data/public/images/flags/catalonia.png +0 -0
- data/public/images/flags/cc.png +0 -0
- data/public/images/flags/cd.png +0 -0
- data/public/images/flags/cf.png +0 -0
- data/public/images/flags/cg.png +0 -0
- data/public/images/flags/ch.png +0 -0
- data/public/images/flags/ci.png +0 -0
- data/public/images/flags/ck.png +0 -0
- data/public/images/flags/cl.png +0 -0
- data/public/images/flags/cm.png +0 -0
- data/public/images/flags/cn.png +0 -0
- data/public/images/flags/co.png +0 -0
- data/public/images/flags/cr.png +0 -0
- data/public/images/flags/cs.png +0 -0
- data/public/images/flags/cu.png +0 -0
- data/public/images/flags/cv.png +0 -0
- data/public/images/flags/cx.png +0 -0
- data/public/images/flags/cy.png +0 -0
- data/public/images/flags/cz.png +0 -0
- data/public/images/flags/da.png +0 -0
- data/public/images/flags/de.png +0 -0
- data/public/images/flags/de_CH.png +0 -0
- data/public/images/flags/dj.png +0 -0
- data/public/images/flags/dm.png +0 -0
- data/public/images/flags/do.png +0 -0
- data/public/images/flags/dz.png +0 -0
- data/public/images/flags/ec.png +0 -0
- data/public/images/flags/ee.png +0 -0
- data/public/images/flags/eg.png +0 -0
- data/public/images/flags/eh.png +0 -0
- data/public/images/flags/england.png +0 -0
- data/public/images/flags/er.png +0 -0
- data/public/images/flags/es.png +0 -0
- data/public/images/flags/et.png +0 -0
- data/public/images/flags/europeanunion.png +0 -0
- data/public/images/flags/fam.png +0 -0
- data/public/images/flags/fi.png +0 -0
- data/public/images/flags/fj.png +0 -0
- data/public/images/flags/fk.png +0 -0
- data/public/images/flags/fm.png +0 -0
- data/public/images/flags/fo.png +0 -0
- data/public/images/flags/fr.png +0 -0
- data/public/images/flags/ga.png +0 -0
- data/public/images/flags/gb.png +0 -0
- data/public/images/flags/gd.png +0 -0
- data/public/images/flags/ge.png +0 -0
- data/public/images/flags/gf.png +0 -0
- data/public/images/flags/gh.png +0 -0
- data/public/images/flags/gi.png +0 -0
- data/public/images/flags/gl.png +0 -0
- data/public/images/flags/gm.png +0 -0
- data/public/images/flags/gn.png +0 -0
- data/public/images/flags/gp.png +0 -0
- data/public/images/flags/gq.png +0 -0
- data/public/images/flags/gr.png +0 -0
- data/public/images/flags/gs.png +0 -0
- data/public/images/flags/gt.png +0 -0
- data/public/images/flags/gu.png +0 -0
- data/public/images/flags/gw.png +0 -0
- data/public/images/flags/gy.png +0 -0
- data/public/images/flags/hk.png +0 -0
- data/public/images/flags/hm.png +0 -0
- data/public/images/flags/hn.png +0 -0
- data/public/images/flags/hr.png +0 -0
- data/public/images/flags/ht.png +0 -0
- data/public/images/flags/hu.png +0 -0
- data/public/images/flags/id.png +0 -0
- data/public/images/flags/ie.png +0 -0
- data/public/images/flags/il.png +0 -0
- data/public/images/flags/in.png +0 -0
- data/public/images/flags/io.png +0 -0
- data/public/images/flags/iq.png +0 -0
- data/public/images/flags/ir.png +0 -0
- data/public/images/flags/is.png +0 -0
- data/public/images/flags/it.png +0 -0
- data/public/images/flags/jm.png +0 -0
- data/public/images/flags/jo.png +0 -0
- data/public/images/flags/jp.png +0 -0
- data/public/images/flags/ke.png +0 -0
- data/public/images/flags/kg.png +0 -0
- data/public/images/flags/kh.png +0 -0
- data/public/images/flags/ki.png +0 -0
- data/public/images/flags/km.png +0 -0
- data/public/images/flags/kn.png +0 -0
- data/public/images/flags/kp.png +0 -0
- data/public/images/flags/kr.png +0 -0
- data/public/images/flags/kw.png +0 -0
- data/public/images/flags/ky.png +0 -0
- data/public/images/flags/kz.png +0 -0
- data/public/images/flags/la.png +0 -0
- data/public/images/flags/lb.png +0 -0
- data/public/images/flags/lc.png +0 -0
- data/public/images/flags/li.png +0 -0
- data/public/images/flags/lk.png +0 -0
- data/public/images/flags/lr.png +0 -0
- data/public/images/flags/ls.png +0 -0
- data/public/images/flags/lt.png +0 -0
- data/public/images/flags/lu.png +0 -0
- data/public/images/flags/lv.png +0 -0
- data/public/images/flags/ly.png +0 -0
- data/public/images/flags/ma.png +0 -0
- data/public/images/flags/mc.png +0 -0
- data/public/images/flags/md.png +0 -0
- data/public/images/flags/me.png +0 -0
- data/public/images/flags/mg.png +0 -0
- data/public/images/flags/mh.png +0 -0
- data/public/images/flags/mk.png +0 -0
- data/public/images/flags/ml.png +0 -0
- data/public/images/flags/mm.png +0 -0
- data/public/images/flags/mn.png +0 -0
- data/public/images/flags/mo.png +0 -0
- data/public/images/flags/mp.png +0 -0
- data/public/images/flags/mq.png +0 -0
- data/public/images/flags/mr.png +0 -0
- data/public/images/flags/ms.png +0 -0
- data/public/images/flags/mt.png +0 -0
- data/public/images/flags/mu.png +0 -0
- data/public/images/flags/mv.png +0 -0
- data/public/images/flags/mw.png +0 -0
- data/public/images/flags/mx.png +0 -0
- data/public/images/flags/my.png +0 -0
- data/public/images/flags/mz.png +0 -0
- data/public/images/flags/na.png +0 -0
- data/public/images/flags/nc.png +0 -0
- data/public/images/flags/ne.png +0 -0
- data/public/images/flags/nf.png +0 -0
- data/public/images/flags/ng.png +0 -0
- data/public/images/flags/ni.png +0 -0
- data/public/images/flags/nl.png +0 -0
- data/public/images/flags/no.png +0 -0
- data/public/images/flags/np.png +0 -0
- data/public/images/flags/nr.png +0 -0
- data/public/images/flags/nu.png +0 -0
- data/public/images/flags/nz.png +0 -0
- data/public/images/flags/om.png +0 -0
- data/public/images/flags/pa.png +0 -0
- data/public/images/flags/pe.png +0 -0
- data/public/images/flags/pf.png +0 -0
- data/public/images/flags/pg.png +0 -0
- data/public/images/flags/ph.png +0 -0
- data/public/images/flags/pk.png +0 -0
- data/public/images/flags/pl.png +0 -0
- data/public/images/flags/pm.png +0 -0
- data/public/images/flags/pn.png +0 -0
- data/public/images/flags/pr.png +0 -0
- data/public/images/flags/ps.png +0 -0
- data/public/images/flags/pt.png +0 -0
- data/public/images/flags/pw.png +0 -0
- data/public/images/flags/py.png +0 -0
- data/public/images/flags/qa.png +0 -0
- data/public/images/flags/re.png +0 -0
- data/public/images/flags/ro.png +0 -0
- data/public/images/flags/rs.png +0 -0
- data/public/images/flags/ru.png +0 -0
- data/public/images/flags/rw.png +0 -0
- data/public/images/flags/sa.png +0 -0
- data/public/images/flags/sb.png +0 -0
- data/public/images/flags/sc.png +0 -0
- data/public/images/flags/scotland.png +0 -0
- data/public/images/flags/sd.png +0 -0
- data/public/images/flags/se.png +0 -0
- data/public/images/flags/sg.png +0 -0
- data/public/images/flags/sh.png +0 -0
- data/public/images/flags/si.png +0 -0
- data/public/images/flags/sj.png +0 -0
- data/public/images/flags/sk.png +0 -0
- data/public/images/flags/sl.png +0 -0
- data/public/images/flags/sm.png +0 -0
- data/public/images/flags/sn.png +0 -0
- data/public/images/flags/so.png +0 -0
- data/public/images/flags/sr.png +0 -0
- data/public/images/flags/st.png +0 -0
- data/public/images/flags/sv.png +0 -0
- data/public/images/flags/sy.png +0 -0
- data/public/images/flags/sz.png +0 -0
- data/public/images/flags/tc.png +0 -0
- data/public/images/flags/td.png +0 -0
- data/public/images/flags/tf.png +0 -0
- data/public/images/flags/tg.png +0 -0
- data/public/images/flags/th.png +0 -0
- data/public/images/flags/tj.png +0 -0
- data/public/images/flags/tk.png +0 -0
- data/public/images/flags/tl.png +0 -0
- data/public/images/flags/tm.png +0 -0
- data/public/images/flags/tn.png +0 -0
- data/public/images/flags/to.png +0 -0
- data/public/images/flags/tr.png +0 -0
- data/public/images/flags/tt.png +0 -0
- data/public/images/flags/tv.png +0 -0
- data/public/images/flags/tw.png +0 -0
- data/public/images/flags/tz.png +0 -0
- data/public/images/flags/ua.png +0 -0
- data/public/images/flags/ug.png +0 -0
- data/public/images/flags/um.png +0 -0
- data/public/images/flags/us.png +0 -0
- data/public/images/flags/uy.png +0 -0
- data/public/images/flags/uz.png +0 -0
- data/public/images/flags/va.png +0 -0
- data/public/images/flags/vc.png +0 -0
- data/public/images/flags/ve.png +0 -0
- data/public/images/flags/vg.png +0 -0
- data/public/images/flags/vi.png +0 -0
- data/public/images/flags/vn.png +0 -0
- data/public/images/flags/vu.png +0 -0
- data/public/images/flags/wales.png +0 -0
- data/public/images/flags/wf.png +0 -0
- data/public/images/flags/ws.png +0 -0
- data/public/images/flags/ye.png +0 -0
- data/public/images/flags/yt.png +0 -0
- data/public/images/flags/za.png +0 -0
- data/public/images/flags/zm.png +0 -0
- data/public/images/flags/zw.png +0 -0
- data/public/images/green/left_01.png +0 -0
- data/public/images/green/right_01.png +0 -0
- data/public/images/grid.png +0 -0
- data/public/images/left_01.png +0 -0
- data/public/images/left_01_small.png +0 -0
- data/public/images/master_cid.jpg +0 -0
- data/public/images/menu-current.png +0 -0
- data/public/images/menu-hover.png +0 -0
- data/public/images/noimage/mini.jpg +0 -0
- data/public/images/noimage/product.jpg +0 -0
- data/public/images/noimage/small.jpg +0 -0
- data/public/images/openid-inputicon.gif +0 -0
- data/public/images/orange/left_03.png +0 -0
- data/public/images/orange/right_03.png +0 -0
- data/public/images/progress.gif +0 -0
- data/public/images/rails.png +0 -0
- data/public/images/right_01.png +0 -0
- data/public/images/right_01_small.png +0 -0
- data/public/images/separator.png +0 -0
- data/public/images/shadow-top.png +0 -0
- data/public/images/shadow_top.png +0 -0
- data/public/images/spinner.gif +0 -0
- data/public/images/spree.jpg +0 -0
- data/public/images/spree/progress.gif +0 -0
- data/public/images/spree/spinner.gif +0 -0
- data/public/images/spree/spree.jpg +0 -0
- data/public/images/step-progress/completed-completed.gif +0 -0
- data/public/images/step-progress/completed-current.gif +0 -0
- data/public/images/step-progress/completed-first.gif +0 -0
- data/public/images/step-progress/current-first.gif +0 -0
- data/public/images/step-progress/current-incomplete.gif +0 -0
- data/public/images/step-progress/current-right.gif +0 -0
- data/public/images/step-progress/incomplete-incomplete.gif +0 -0
- data/public/images/step-progress/incomplete-right.gif +0 -0
- data/public/images/steps/1.png +0 -0
- data/public/images/steps/1_small.png +0 -0
- data/public/images/steps/2.png +0 -0
- data/public/images/steps/2_small.png +0 -0
- data/public/images/steps/3.png +0 -0
- data/public/images/steps/3_small.png +0 -0
- data/public/images/steps/4.png +0 -0
- data/public/images/steps/4_small.png +0 -0
- data/public/images/steps/5.png +0 -0
- data/public/images/steps/5_small.png +0 -0
- data/public/images/steps/6.png +0 -0
- data/public/images/steps/6_small.png +0 -0
- data/public/images/sxsw-ribbon-v1.png +0 -0
- data/public/images/tab_bottom.gif +0 -0
- data/public/images/tile-header.png +0 -0
- data/public/images/tile-slider.png +0 -0
- data/public/images/top-shine.png +0 -0
- data/public/images/tree-nav-icons/bullet.gif +0 -0
- data/public/images/tree-nav-icons/minus.gif +0 -0
- data/public/images/tree-nav-icons/plus.gif +0 -0
- data/public/images/tree-nav-icons/treeview-loading.gif +0 -0
- data/public/images/tree-nav-icons/treeview-sprite.gif +0 -0
- data/public/images/update.png +0 -0
- data/public/images/visa_cid.gif +0 -0
- data/public/images/wrapper-back-2.png +0 -0
- data/public/images/wrapper-back.png +0 -0
- data/public/images/yui-menubaritem_submenuindicator.png +0 -0
- data/public/images/yui-menubaritem_submenuindicator_disabled.png +0 -0
- data/public/images/yui-menuitem_checkbox.png +0 -0
- data/public/images/yui-menuitem_checkbox_disabled.png +0 -0
- data/public/images/yui-menuitem_submenuindicator.png +0 -0
- data/public/images/yui-menuitem_submenuindicator_disabled.png +0 -0
- data/public/images/yui-sprite.png +0 -0
- data/public/javascripts/additional-methods.js +0 -236
- data/public/javascripts/admin/address_states.js +0 -25
- data/public/javascripts/admin/checkouts/edit.js +0 -129
- data/public/javascripts/admin/orders/edit.js +0 -96
- data/public/javascripts/admin/orders/edit_form.js +0 -17
- data/public/javascripts/admin/payments/new.js +0 -9
- data/public/javascripts/admin/unobtrusive_handlers.js +0 -15
- data/public/javascripts/calculator.js +0 -13
- data/public/javascripts/checkout.js +0 -65
- data/public/javascripts/dashboard.js +0 -143
- data/public/javascripts/datepicker.js +0 -1445
- data/public/javascripts/gateway.js +0 -13
- data/public/javascripts/jqPlot/excanvas.min.js +0 -1
- data/public/javascripts/jqPlot/jquery.jqplot.min.js +0 -14
- data/public/javascripts/jqPlot/plugins/jqplot.canvasAxisLabelRenderer.min.js +0 -14
- data/public/javascripts/jqPlot/plugins/jqplot.canvasAxisTickRenderer.min.js +0 -14
- data/public/javascripts/jqPlot/plugins/jqplot.canvasTextRenderer.min.js +0 -14
- data/public/javascripts/jqPlot/plugins/jqplot.categoryAxisRenderer.min.js +0 -14
- data/public/javascripts/jqPlot/plugins/jqplot.dateAxisRenderer.min.js +0 -14
- data/public/javascripts/jqPlot/plugins/jqplot.highlighter.min.js +0 -14
- data/public/javascripts/jqPlot/plugins/jqplot.pieRenderer.min.js +0 -14
- data/public/javascripts/jquery-1.3.2.min.js +0 -19
- data/public/javascripts/jquery-and-plugins.js +0 -36
- data/public/javascripts/jquery-ui.js +0 -188
- data/public/javascripts/jquery.alerts/images/help.gif +0 -0
- data/public/javascripts/jquery.alerts/images/important.gif +0 -0
- data/public/javascripts/jquery.alerts/images/info.gif +0 -0
- data/public/javascripts/jquery.alerts/images/title.gif +0 -0
- data/public/javascripts/jquery.alerts/jquery.alerts.css +0 -57
- data/public/javascripts/jquery.alerts/jquery.alerts.js +0 -235
- data/public/javascripts/jquery.alerts/jquery.alerts.spree.css +0 -30
- data/public/javascripts/jquery.autocomplete.min.js +0 -13
- data/public/javascripts/jquery.js +0 -19
- data/public/javascripts/jquery.suggest.js +0 -276
- data/public/javascripts/jquery.template.js +0 -255
- data/public/javascripts/jquery.validate.min.js +0 -16
- data/public/javascripts/jrails.autocomplete.js +0 -274
- data/public/javascripts/jrails.js +0 -1
- data/public/javascripts/jsTree/jquery.tree.js +0 -2058
- data/public/javascripts/jsTree/plugins/jquery.tree.contextmenu.js +0 -129
- data/public/javascripts/jsTree/themes/apple/bg.jpg +0 -0
- data/public/javascripts/jsTree/themes/apple/dot_for_ie.gif +0 -0
- data/public/javascripts/jsTree/themes/apple/icons.png +0 -0
- data/public/javascripts/jsTree/themes/apple/style.css +0 -34
- data/public/javascripts/jsTree/themes/apple/throbber.gif +0 -0
- data/public/javascripts/lang/af.js +0 -40
- data/public/javascripts/lang/ar.js +0 -50
- data/public/javascripts/lang/de.js +0 -40
- data/public/javascripts/lang/du.js +0 -40
- data/public/javascripts/lang/en.js +0 -42
- data/public/javascripts/lang/es.js +0 -41
- data/public/javascripts/lang/fi.js +0 -40
- data/public/javascripts/lang/fr.js +0 -44
- data/public/javascripts/lang/gr.js +0 -40
- data/public/javascripts/lang/he.js +0 -49
- data/public/javascripts/lang/it.js +0 -13
- data/public/javascripts/lang/nl.js +0 -40
- data/public/javascripts/lang/no.js +0 -40
- data/public/javascripts/lang/pt.js +0 -50
- data/public/javascripts/lang/ro.js +0 -40
- data/public/javascripts/lang/ru.js +0 -40
- data/public/javascripts/lang/sp.js +0 -40
- data/public/javascripts/lang/sv.js +0 -41
- data/public/javascripts/lang/ua.js +0 -40
- data/public/javascripts/localization/messages_cn.js +0 -24
- data/public/javascripts/localization/messages_cs.js +0 -23
- data/public/javascripts/localization/messages_da.js +0 -21
- data/public/javascripts/localization/messages_de.js +0 -21
- data/public/javascripts/localization/messages_es.js +0 -24
- data/public/javascripts/localization/messages_fr.js +0 -23
- data/public/javascripts/localization/messages_hu.js +0 -21
- data/public/javascripts/localization/messages_it.js +0 -26
- data/public/javascripts/localization/messages_kk.js +0 -23
- data/public/javascripts/localization/messages_nl.js +0 -23
- data/public/javascripts/localization/messages_no.js +0 -23
- data/public/javascripts/localization/messages_pl.js +0 -23
- data/public/javascripts/localization/messages_ptbr.js +0 -30
- data/public/javascripts/localization/messages_ro.js +0 -24
- data/public/javascripts/localization/messages_ru.js +0 -23
- data/public/javascripts/localization/messages_se.js +0 -23
- data/public/javascripts/localization/messages_sk.js +0 -21
- data/public/javascripts/localization/messages_tr.js +0 -24
- data/public/javascripts/localization/messages_tw.js +0 -24
- data/public/javascripts/localization/messages_ua.js +0 -24
- data/public/javascripts/nested-attribute.js +0 -25
- data/public/javascripts/open_id.js +0 -15
- data/public/javascripts/product.js +0 -49
- data/public/javascripts/spree.js +0 -53
- data/public/javascripts/taxonomy.js +0 -196
- data/public/javascripts/zone.js +0 -40
- data/public/stylesheets/admin/admin-forms.css +0 -159
- data/public/stylesheets/admin/admin-reset.css +0 -67
- data/public/stylesheets/admin/admin-tables.css +0 -39
- data/public/stylesheets/admin/admin-typography.css +0 -117
- data/public/stylesheets/admin/admin.css +0 -571
- data/public/stylesheets/admin/dashboard.css +0 -143
- data/public/stylesheets/admin/edit_checkouts.css +0 -57
- data/public/stylesheets/admin/edit_orders.css +0 -65
- data/public/stylesheets/admin/grids.css +0 -314
- data/public/stylesheets/admin/reset-fonts-grids-2-6-0.css +0 -7
- data/public/stylesheets/admin/yui-includes.css +0 -14
- data/public/stylesheets/datepicker.css +0 -263
- data/public/stylesheets/jquery.autocomplete.css +0 -48
- data/public/stylesheets/scaffold.css +0 -54
- data/public/stylesheets/screen.css +0 -1194
- data/script/autospec +0 -5
- data/script/breakpointer +0 -3
- data/script/performance/request +0 -3
- data/script/spec +0 -5
- data/script/spec_server +0 -125
- data/spec/controllers/admin/configurations_controller_spec.rb +0 -9
- data/spec/controllers/admin/mail_settings_controller_spec.rb +0 -24
- data/spec/controllers/admin/shipping_categories_controller_spec.rb +0 -10
- data/spec/controllers/admin/shipping_methods_controller_spec.rb +0 -10
- data/spec/controllers/countries_controller_spec.rb +0 -24
- data/spec/controllers/orders_controller_spec.rb +0 -35
- data/spec/controllers/products_controller_spec.rb +0 -16
- data/spec/controllers/states_controller_spec.rb +0 -18
- data/spec/controllers/taxons_controller_spec.rb +0 -18
- data/spec/fixtures/app_configurations.yml +0 -7
- data/spec/fixtures/countries.yml +0 -3
- data/spec/fixtures/gateways.yml +0 -8
- data/spec/fixtures/preferences.yml +0 -15
- data/spec/fixtures/roles.yml +0 -2
- data/spec/fixtures/states.yml +0 -2
- data/spec/fixtures/tax_categories.yml +0 -4
- data/spec/fixtures/users.yml +0 -5
- data/spec/fixtures/zone_members.yml +0 -7
- data/spec/fixtures/zones.yml +0 -4
- data/spec/lib/easy_role_requirement_system_spec.rb +0 -140
- data/spec/models/address_spec.rb +0 -79
- data/spec/models/app_configuration_spec.rb +0 -13
- data/spec/models/creditcard_payment_spec.rb +0 -17
- data/spec/models/creditcard_spec.rb +0 -43
- data/spec/models/inventory_unit_spec.rb +0 -18
- data/spec/models/option_type_spec.rb +0 -36
- data/spec/models/option_value_spec.rb +0 -39
- data/spec/models/order_spec.rb +0 -207
- data/spec/models/payment_sepc.rb +0 -29
- data/spec/models/product_option_type_spec.rb +0 -38
- data/spec/models/product_property_spec.rb +0 -29
- data/spec/models/property_spec.rb +0 -37
- data/spec/models/prototype_spec.rb +0 -35
- data/spec/models/shipment_spec.rb +0 -8
- data/spec/models/shipping_category_spec.rb +0 -8
- data/spec/models/shipping_order_spec.rb +0 -113
- data/spec/models/tax_category_spec.rb +0 -11
- data/spec/models/taxon_spec.rb +0 -50
- data/spec/models/taxonomy_spec.rb +0 -37
- data/spec/models/zone_member_spec.rb +0 -5
- data/spec/models/zone_spec.rb +0 -137
- data/spec/rcov.opts +0 -2
- data/spec/spec.opts +0 -4
- data/spec/spec_helper.rb +0 -79
- data/vendor/extensions/overview_dashboard/spec/spec.opts +0 -6
- data/vendor/extensions/overview_dashboard/spec/spec_helper.rb +0 -37
- data/vendor/extensions/payment_gateway/spec/helpers/admin/gateways_helper_spec.rb +0 -6
- data/vendor/extensions/payment_gateway/spec/models/creditcard_spec.rb +0 -15
- data/vendor/extensions/payment_gateway/spec/models/gateway_spec.rb +0 -11
- data/vendor/extensions/payment_gateway/spec/models/order_spec.rb +0 -45
- data/vendor/extensions/payment_gateway/spec/spec.opts +0 -6
- data/vendor/extensions/payment_gateway/spec/spec_helper.rb +0 -37
- data/vendor/extensions/theme_default/spec/spec.opts +0 -6
- data/vendor/extensions/theme_default/spec/spec_helper.rb +0 -37
@@ -1,255 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* jQuery Templates
|
3
|
-
*
|
4
|
-
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
5
|
-
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
6
|
-
*
|
7
|
-
* Written by: Stan Lemon <stanlemon@mac.com>
|
8
|
-
*
|
9
|
-
* Based off of the Ext.Template library, available at:
|
10
|
-
* http://www.extjs.com
|
11
|
-
*
|
12
|
-
* This library provides basic templating functionality, allowing for macro-based
|
13
|
-
* templates within jQuery.
|
14
|
-
*
|
15
|
-
* Basic Usage:
|
16
|
-
*
|
17
|
-
* var t = $.template('<div id="foo">Hello ${name}, how are you ${question}? I am ${me:substr(0,10)}</div>');
|
18
|
-
*
|
19
|
-
* $(selector).append( t , {
|
20
|
-
* name: 'Stan',
|
21
|
-
* question: 'feeling',
|
22
|
-
* me: 'doing quite well myself, thank you very much!'
|
23
|
-
* });
|
24
|
-
*
|
25
|
-
* Requires: jQuery 1.2+
|
26
|
-
*
|
27
|
-
*
|
28
|
-
* @todo Add callbacks to the DOM manipulation methods, so that events can be bound
|
29
|
-
* to template nodes after creation.
|
30
|
-
*/
|
31
|
-
(function($){
|
32
|
-
|
33
|
-
/**
|
34
|
-
* Create a New Template
|
35
|
-
*/
|
36
|
-
$.template = function(html, options) {
|
37
|
-
return new $.template.instance(html, options);
|
38
|
-
};
|
39
|
-
|
40
|
-
/**
|
41
|
-
* Template constructor - Creates a new template instance.
|
42
|
-
*
|
43
|
-
* @param html The string of HTML to be used for the template.
|
44
|
-
* @param options An object of configurable options. Currently
|
45
|
-
* you can toggle compile as a boolean value and set a custom
|
46
|
-
* template regular expression on the property regx by
|
47
|
-
* specifying the key of the regx to use from the regx object.
|
48
|
-
*/
|
49
|
-
$.template.instance = function(html, options) {
|
50
|
-
// If a custom regular expression has been set, grab it from the regx object
|
51
|
-
if ( options && options['regx'] ) options.regx = this.regx[ options.regx ];
|
52
|
-
|
53
|
-
this.options = $.extend({
|
54
|
-
compile: false,
|
55
|
-
regx: this.regx.standard
|
56
|
-
}, options || {});
|
57
|
-
|
58
|
-
this.html = html;
|
59
|
-
|
60
|
-
if (this.options.compile) {
|
61
|
-
this.compile();
|
62
|
-
}
|
63
|
-
this.isTemplate = true;
|
64
|
-
};
|
65
|
-
|
66
|
-
/**
|
67
|
-
* Regular Expression for Finding Variables
|
68
|
-
*
|
69
|
-
* The default pattern looks for variables in JSP style, the form of: ${variable}
|
70
|
-
* There are also regular expressions available for ext-style variables and
|
71
|
-
* jTemplate style variables.
|
72
|
-
*
|
73
|
-
* You can add your own regular expressions for variable ussage by doing.
|
74
|
-
* $.extend({ $.template.re , {
|
75
|
-
* myvartype: /...../g
|
76
|
-
* }
|
77
|
-
*
|
78
|
-
* Then when creating a template do:
|
79
|
-
* var t = $.template("<div>...</div>", { regx: 'myvartype' });
|
80
|
-
*/
|
81
|
-
$.template.regx = $.template.instance.prototype.regx = {
|
82
|
-
jsp: /\$\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,
|
83
|
-
ext: /\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,
|
84
|
-
jtemplates: /\{\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}\}/g
|
85
|
-
};
|
86
|
-
|
87
|
-
/**
|
88
|
-
* Set the standard regular expression to be used.
|
89
|
-
*/
|
90
|
-
$.template.regx.standard = $.template.regx.jsp;
|
91
|
-
|
92
|
-
/**
|
93
|
-
* Variable Helper Methods
|
94
|
-
*
|
95
|
-
* This is a collection of methods which can be used within the variable syntax, ie:
|
96
|
-
* ${variable:substr(0,30)} Which would only print a substring, 30 characters in length
|
97
|
-
* begining at the first character for the variable named "variable".
|
98
|
-
*
|
99
|
-
* A basic substring helper is provided as an example of how you can define helpers.
|
100
|
-
* To add more helpers simply do:
|
101
|
-
* $.extend( $.template.helpers , {
|
102
|
-
* sampleHelper: function() { ... }
|
103
|
-
* });
|
104
|
-
*/
|
105
|
-
$.template.helpers = $.template.instance.prototype.helpers = {
|
106
|
-
substr : function(value, start, length){
|
107
|
-
return String(value).substr(start, length);
|
108
|
-
}
|
109
|
-
};
|
110
|
-
|
111
|
-
|
112
|
-
/**
|
113
|
-
* Template Instance Methods
|
114
|
-
*/
|
115
|
-
$.extend( $.template.instance.prototype, {
|
116
|
-
|
117
|
-
/**
|
118
|
-
* Apply Values to a Template
|
119
|
-
*
|
120
|
-
* This is the macro-work horse of the library, it receives an object
|
121
|
-
* and the properties of that objects are assigned to the template, where
|
122
|
-
* the variables in the template represent keys within the object itself.
|
123
|
-
*
|
124
|
-
* @param values An object of properties mapped to template variables
|
125
|
-
*/
|
126
|
-
apply: function(values) {
|
127
|
-
if (this.options.compile) {
|
128
|
-
return this.compiled(values);
|
129
|
-
} else {
|
130
|
-
var tpl = this;
|
131
|
-
var fm = this.helpers;
|
132
|
-
|
133
|
-
var fn = function(m, name, format, args) {
|
134
|
-
if (format) {
|
135
|
-
if (format.substr(0, 5) == "this."){
|
136
|
-
return tpl.call(format.substr(5), values[name], values);
|
137
|
-
} else {
|
138
|
-
if (args) {
|
139
|
-
// quoted values are required for strings in compiled templates,
|
140
|
-
// but for non compiled we need to strip them
|
141
|
-
// quoted reversed for jsmin
|
142
|
-
var re = /^\s*['"](.*)["']\s*$/;
|
143
|
-
args = args.split(',');
|
144
|
-
|
145
|
-
for(var i = 0, len = args.length; i < len; i++) {
|
146
|
-
args[i] = args[i].replace(re, "$1");
|
147
|
-
}
|
148
|
-
args = [values[name]].concat(args);
|
149
|
-
} else {
|
150
|
-
args = [values[name]];
|
151
|
-
}
|
152
|
-
|
153
|
-
return fm[format].apply(fm, args);
|
154
|
-
}
|
155
|
-
} else {
|
156
|
-
return values[name] !== undefined ? values[name] : "";
|
157
|
-
}
|
158
|
-
};
|
159
|
-
|
160
|
-
return this.html.replace(this.options.regx, fn);
|
161
|
-
}
|
162
|
-
},
|
163
|
-
|
164
|
-
/**
|
165
|
-
* Compile a template for speedier usage
|
166
|
-
*/
|
167
|
-
compile: function() {
|
168
|
-
var sep = $.browser.mozilla ? "+" : ",";
|
169
|
-
var fm = this.helpers;
|
170
|
-
|
171
|
-
var fn = function(m, name, format, args){
|
172
|
-
if (format) {
|
173
|
-
args = args ? ',' + args : "";
|
174
|
-
|
175
|
-
if (format.substr(0, 5) != "this.") {
|
176
|
-
format = "fm." + format + '(';
|
177
|
-
} else {
|
178
|
-
format = 'this.call("'+ format.substr(5) + '", ';
|
179
|
-
args = ", values";
|
180
|
-
}
|
181
|
-
} else {
|
182
|
-
args= ''; format = "(values['" + name + "'] == undefined ? '' : ";
|
183
|
-
}
|
184
|
-
return "'"+ sep + format + "values['" + name + "']" + args + ")"+sep+"'";
|
185
|
-
};
|
186
|
-
|
187
|
-
var body;
|
188
|
-
|
189
|
-
if ($.browser.mozilla) {
|
190
|
-
body = "this.compiled = function(values){ return '" +
|
191
|
-
this.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.options.regx, fn) +
|
192
|
-
"';};";
|
193
|
-
} else {
|
194
|
-
body = ["this.compiled = function(values){ return ['"];
|
195
|
-
body.push(this.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.options.regx, fn));
|
196
|
-
body.push("'].join('');};");
|
197
|
-
body = body.join('');
|
198
|
-
}
|
199
|
-
eval(body);
|
200
|
-
return this;
|
201
|
-
}
|
202
|
-
});
|
203
|
-
|
204
|
-
|
205
|
-
/**
|
206
|
-
* Save a reference in this local scope to the original methods which we're
|
207
|
-
* going to overload.
|
208
|
-
**/
|
209
|
-
var $_old = {
|
210
|
-
domManip: $.fn.domManip,
|
211
|
-
text: $.fn.text,
|
212
|
-
html: $.fn.html
|
213
|
-
};
|
214
|
-
|
215
|
-
/**
|
216
|
-
* Overwrite the domManip method so that we can use things like append() by passing a
|
217
|
-
* template object and macro parameters.
|
218
|
-
*/
|
219
|
-
$.fn.domManip = function( args, table, reverse, callback ) {
|
220
|
-
if (args[0].isTemplate) {
|
221
|
-
// Apply the template and it's arguments...
|
222
|
-
args[0] = args[0].apply( args[1] );
|
223
|
-
// Get rid of the arguements, we don't want to pass them on
|
224
|
-
delete args[1];
|
225
|
-
}
|
226
|
-
|
227
|
-
// Call the original method
|
228
|
-
var r = $_old.domManip.apply(this, arguments);
|
229
|
-
|
230
|
-
return r;
|
231
|
-
};
|
232
|
-
|
233
|
-
/**
|
234
|
-
* Overwrite the html() method
|
235
|
-
*/
|
236
|
-
$.fn.html = function( value , o ) {
|
237
|
-
if (value && value.isTemplate) var value = value.apply( o );
|
238
|
-
|
239
|
-
var r = $_old.html.apply(this, [value]);
|
240
|
-
|
241
|
-
return r;
|
242
|
-
};
|
243
|
-
|
244
|
-
/**
|
245
|
-
* Overwrite the text() method
|
246
|
-
*/
|
247
|
-
$.fn.text = function( value , o ) {
|
248
|
-
if (value && value.isTemplate) var value = value.apply( o );
|
249
|
-
|
250
|
-
var r = $_old.text.apply(this, [value]);
|
251
|
-
|
252
|
-
return r;
|
253
|
-
};
|
254
|
-
|
255
|
-
})(jQuery);
|
@@ -1,16 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* jQuery validation plug-in 1.5.5
|
3
|
-
*
|
4
|
-
* http://bassistance.de/jquery-plugins/jquery-plugin-validation/
|
5
|
-
* http://docs.jquery.com/Plugins/Validation
|
6
|
-
*
|
7
|
-
* Copyright (c) 2006 - 2008 Jörn Zaefferer
|
8
|
-
*
|
9
|
-
* $Id: jquery.validate.js 6403 2009-06-17 14:27:16Z joern.zaefferer $
|
10
|
-
*
|
11
|
-
* Dual licensed under the MIT and GPL licenses:
|
12
|
-
* http://www.opensource.org/licenses/mit-license.php
|
13
|
-
* http://www.gnu.org/licenses/gpl.html
|
14
|
-
*/
|
15
|
-
(function($){$.extend($.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return;}var validator=$.data(this[0],'validator');if(validator){return validator;}validator=new $.validator(options,this[0]);$.data(this[0],'validator',validator);if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){validator.cancelSubmit=true;});if(validator.settings.submitHandler){this.find("input, button").filter(":submit").click(function(){validator.submitButton=this;});}this.submit(function(event){if(validator.settings.debug)event.preventDefault();function handle(){if(validator.settings.submitHandler){if(validator.submitButton){var hidden=$("<input type='hidden'/>").attr("name",validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm);}validator.settings.submitHandler.call(validator,validator.currentForm);if(validator.submitButton){hidden.remove();}return false;}return true;}if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();}if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;}return handle();}else{validator.focusInvalid();return false;}});}return validator;},valid:function(){if($(this[0]).is('form')){return this.validate().form();}else{var valid=true;var validator=$(this[0].form).validate();this.each(function(){valid&=validator.element(this);});return valid;}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value);$element.removeAttr(value);});return result;},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,'validator').settings;var staticRules=settings.rules;var existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));staticRules[element.name]=existingRules;if(argument.messages)settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages);break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;}var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];});return filtered;}}var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data);}return data;}});$.extend($.expr[":"],{blank:function(a){return!$.trim(a.value);},filled:function(a){return!!$.trim(a.value);},unchecked:function(a){return!a.checked;}});$.validator=function(options,form){this.settings=$.extend({},$.validator.defaults,options);this.currentForm=form;this.init();};$.validator.format=function(source,params){if(arguments.length==1)return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args);};if(arguments.length>2&¶ms.constructor!=Array){params=$.makeArray(arguments).slice(1);}if(params.constructor!=Array){params=[params];}$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n);});return source;};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass);this.errorsFor(element).hide();}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element);}},onclick:function(element){if(element.name in this.submitted)this.element(element);},highlight:function(element,errorClass,validClass){$(element).addClass(errorClass).removeClass(validClass);},unhighlight:function(element,errorClass,validClass){$(element).removeClass(errorClass).addClass(validClass);}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",dateDE:"Bitte geben Sie ein gültiges Datum ein.",number:"Please enter a valid number.",numberDE:"Bitte geben Sie eine Nummer ein.",digits:"Please enter only digits",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key;});});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value);});function delegate(event){var validator=$.data(this[0].form,"validator");validator.settings["on"+event.type]&&validator.settings["on"+event.type].call(validator,this[0]);}$(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",delegate).delegate("click",":radio, :checkbox",delegate);if(this.settings.invalidHandler)$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler);},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid())$(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);}return this.valid();},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);this.currentElements=$(element);var result=this.check(element);if(result){delete this.invalid[element.name];}else{this.invalid[element.name]=true;}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);}this.showErrors();return result;},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]});}this.successList=$.grep(this.successList,function(element){return!(element.name in errors);});}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if($.fn.resetForm)$(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0;for(var i in obj)count++;return count;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus();}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name==lastActive.name;}).length==1&&lastActive;},elements:function(){var validator=this,rulesCache={};return $([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules()))return false;rulesCache[this.name]=true;return true;});},clean:function(selector){return $(selector)[0];},errors:function(){return $(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.formSubmitted=false;this.currentElements=$([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name)[0];}var rules=$(element).rules();var dependencyMismatch=false;for(method in rules){var rule={method:method,parameters:rules[method]};try{var result=$.validator.methods[method].call(this,element.value.replace(/\r/g,""),element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue;}dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;}if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id
|
16
|
-
+", check the '"+rule.method+"' method");throw e;}}if(dependencyMismatch)return;if(this.objectLength(rules))this.successList.push(element);return true;},customMetaMessage:function(element,method){if(!$.metadata)return;var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method];},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method]);},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined)return arguments[i];}return undefined;},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),this.customMetaMessage(element,method),!this.settings.ignoreTitle&&element.title||undefined,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>");},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method);if(typeof message=="function")message=message.call(this,rule.parameters,element);this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper)toToggle=toToggle.add(toToggle.parent(this.settings.wrapper));return toToggle;},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass);this.showLabel(error.element,error.message);}if(this.errorList.length){this.toShow=this.toShow.add(this.containers);}if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}}if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return $(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message);}else{label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();}if(!this.labelContainer.append(label).length)this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element);}if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label);}this.toShow=this.toShow.add(label);},errorsFor:function(element){return this.errors().filter("[for='"+this.idOrName(element)+"']");},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},checkable:function(element){return/radio|checkbox/i.test(element.type);},findByName:function(name){var form=this.currentForm;return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null;});},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case'select':return $("option:selected",element).length;case'input':if(this.checkable(element))return this.findByName(element.name).filter(':checked').length;}return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param,element){return param;},"string":function(param,element){return!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){return!$.validator.methods.required.call(this,$.trim(element.value),element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();}else if(!valid&&this.pendingRequest==0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",previous={old:null,valid:true,message:this.defaultMessage(element,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className);},classRules:function(element){var rules={};var classes=$(element).attr('class');classes&&$.each(classes.split(' '),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this]);}});return rules;},attributeRules:function(element){var rules={};var $element=$(element);for(method in $.validator.methods){var value=$element.attr(method);if(value){rules[method]=value;}}if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;}return rules;},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,'validator').settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata();},staticRules:function(element){var rules={};var validator=$.data(element.form,'validator');if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{};}return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;}if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;}if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules[prop];}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter;});$.each(['minlength','maxlength','min','max'],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(['rangelength','range'],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;}if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}}if(rules.messages){delete rules.messages}return rules;},normalizeRule:function(data){if(typeof data=="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;}return data;},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message||$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element))return"dependency-mismatch";switch(element.nodeName.toLowerCase()){case'select':var options=$("option:selected",element);return options.length>0&&(element.type=="select-multiple"||($.browser.msie&&!(options[0].attributes['value'].specified)?options[0].text:options[0].value).length>0);case'input':if(this.checkable(element))return this.getLength(value,element)>0;default:return $.trim(value).length>0;}},remote:function(value,element,param){if(this.optional(element))return"dependency-mismatch";var previous=this.previousValue(element);if(!this.settings.messages[element.name])this.settings.messages[element.name]={};this.settings.messages[element.name].remote=typeof previous.message=="function"?previous.message(value):previous.message;param=typeof param=="string"&&{url:param}||param;if(previous.old!==value){previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){var valid=response===true;if(valid){var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors();}else{var errors={};errors[element.name]=previous.message=response||validator.defaultMessage(element,"remote");validator.showErrors(errors);}previous.valid=valid;validator.stopRequest(element,valid);}},param));return"pending";}else if(this.pending[element.name]){return"pending";}return previous.valid;},minlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)>=param;},maxlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)<=param;},rangelength:function(value,element,param){var length=this.getLength($.trim(value),element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},min:function(value,element,param){return this.optional(element)||value>=param;},max:function(value,element,param){return this.optional(element)||value<=param;},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([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])))\.?$/i.test(value);},url:function(value,element){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);},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value));},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);},dateDE:function(value,element){return this.optional(element)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(value);},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);},numberDE:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},creditcard:function(value,element){if(this.optional(element))return"dependency-mismatch";if(/[^0-9-]+/.test(value))return false;var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9)nDigit-=9;}nCheck+=nDigit;bEven=!bEven;}return(nCheck%10)==0;},accept:function(value,element,param){param=typeof param=="string"?param.replace(/,/g,'|'):"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"));},equalTo:function(value,element,param){return value==$(param).val();}}});$.format=$.validator.format;})(jQuery);;(function($){var ajax=$.ajax;var pendingRequests={};$.ajax=function(settings){settings=$.extend(settings,$.extend({},$.ajaxSettings,settings));var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}return(pendingRequests[port]=ajax.apply(this,arguments));}return ajax.apply(this,arguments);};})(jQuery);;(function($){$.each({focus:'focusin',blur:'focusout'},function(original,fix){$.event.special[fix]={setup:function(){if($.browser.msie)return false;this.addEventListener(original,$.event.special[fix].handler,true);},teardown:function(){if($.browser.msie)return false;this.removeEventListener(original,$.event.special[fix].handler,true);},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments);}};});$.extend($.fn,{delegate:function(type,delegate,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments);}});},triggerEvent:function(type,target){return this.triggerHandler(type,[$.event.fix({type:type,target:target})]);}})})(jQuery);
|
@@ -1,274 +0,0 @@
|
|
1
|
-
(function($) {
|
2
|
-
function stopEvent(e) {
|
3
|
-
e.preventDefault();
|
4
|
-
e.stopPropagation();
|
5
|
-
e.stopped = true;
|
6
|
-
}
|
7
|
-
|
8
|
-
function getFirstDifferencePos(newS, oldS) {
|
9
|
-
var boundary = Math.min(newS.length, oldS.length);
|
10
|
-
for (var index = 0; index < boundary; ++index)
|
11
|
-
if (newS[index] != oldS[index]) return index;
|
12
|
-
return boundary;
|
13
|
-
}
|
14
|
-
|
15
|
-
var AutoComplete = function(element, update, url, options) {
|
16
|
-
var autocomplete = this;
|
17
|
-
|
18
|
-
this.element = element;
|
19
|
-
this.url = url;
|
20
|
-
this.update = update;
|
21
|
-
this.hasFocus = false;
|
22
|
-
this.changed = false;
|
23
|
-
this.active = false;
|
24
|
-
this.index = 0;
|
25
|
-
this.entryCount = 0;
|
26
|
-
this.oldElementValue = this.element.value;
|
27
|
-
this.observer = null;
|
28
|
-
this.options = $.extend({
|
29
|
-
paramName: this.element.name,
|
30
|
-
type: 'GET',
|
31
|
-
tokens: [],
|
32
|
-
frequency: 0.4,
|
33
|
-
minChars: 1,
|
34
|
-
onShow: function(element, update) {
|
35
|
-
if (!update.style.position || update.style.position == 'absolute') {
|
36
|
-
var position = $(element).position();
|
37
|
-
$(update).css({
|
38
|
-
position: 'absolute',
|
39
|
-
left: position.left + 'px',
|
40
|
-
top: $(element).outerHeight() + position.top + 'px',
|
41
|
-
width: $(element).outerWidth() + 'px'
|
42
|
-
});
|
43
|
-
}
|
44
|
-
$(update).fadeIn();
|
45
|
-
},
|
46
|
-
onHide: function(element, update) {
|
47
|
-
$(update).fadeOut();
|
48
|
-
}
|
49
|
-
}, options);
|
50
|
-
|
51
|
-
if (typeof(this.options.tokens) == 'string') {
|
52
|
-
this.options.tokens = new Array(this.options.tokens);
|
53
|
-
}
|
54
|
-
if (!$.inArray("\n", this.options.tokens)) {
|
55
|
-
this.options.tokens.push("\n");
|
56
|
-
}
|
57
|
-
|
58
|
-
$(this.update).hide();
|
59
|
-
$(this.element).attr('autocomplete', 'off')
|
60
|
-
.blur(function(e) { autocomplete.onBlur(e); })
|
61
|
-
.keypress(function(e) { autocomplete.onKeyPress(e); });
|
62
|
-
}
|
63
|
-
$.extend(AutoComplete.prototype, {
|
64
|
-
show: function() {
|
65
|
-
if ($(this.update).not(':visible')) this.options.onShow(this.element, this.update);
|
66
|
-
},
|
67
|
-
hide: function() {
|
68
|
-
this.stopIndicator();
|
69
|
-
if ($(this.update).is(':visible')) this.options.onHide(this.element, this.update);
|
70
|
-
},
|
71
|
-
startIndicator: function() {
|
72
|
-
if (this.options.indicator) $('#' + this.options.indicator).show();
|
73
|
-
},
|
74
|
-
stopIndicator: function() {
|
75
|
-
if (this.options.indicator) $('#' + this.options.indicator).hide();
|
76
|
-
},
|
77
|
-
onKeyPress: function(e) {
|
78
|
-
var autocomplete = this;
|
79
|
-
|
80
|
-
if (this.active) {
|
81
|
-
switch (e.keyCode) {
|
82
|
-
case 9: // tab
|
83
|
-
case 13: // return
|
84
|
-
this.selectEntry();
|
85
|
-
stopEvent(e);
|
86
|
-
case 27: // esc
|
87
|
-
this.hide();
|
88
|
-
this.active = false;
|
89
|
-
stopEvent(e);
|
90
|
-
case 37: // left
|
91
|
-
case 39: // right
|
92
|
-
return;
|
93
|
-
case 38: // up
|
94
|
-
this.markPrevious();
|
95
|
-
this.render();
|
96
|
-
stopEvent(e);
|
97
|
-
return;
|
98
|
-
case 40: // down
|
99
|
-
this.markNext();
|
100
|
-
this.render();
|
101
|
-
stopEvent(e);
|
102
|
-
return;
|
103
|
-
}
|
104
|
-
}
|
105
|
-
else if (e.keyCode == 9 || e.keyCode == 13) return;
|
106
|
-
|
107
|
-
this.changed = this.hasFocus = true;
|
108
|
-
if (this.observer) clearTimeout(this.observer);
|
109
|
-
this.observer = setTimeout(function() { autocomplete.onObserverEvent(); }, this.frequency * 1000);
|
110
|
-
},
|
111
|
-
activate: function() {
|
112
|
-
this.changed = false;
|
113
|
-
this.hasFocus = true;
|
114
|
-
this.getUpdatedChoices();
|
115
|
-
},
|
116
|
-
onHover: function(e) {
|
117
|
-
if (this.index != e.target.autocompleteIndex) {
|
118
|
-
this.index = e.target.autocompleteIndex;
|
119
|
-
this.render();
|
120
|
-
}
|
121
|
-
stopEvent(e);
|
122
|
-
},
|
123
|
-
onClick: function(e) {
|
124
|
-
this.index = e.target.autocompleteIndex;
|
125
|
-
this.selectEntry();
|
126
|
-
this.hide();
|
127
|
-
},
|
128
|
-
onBlur: function(e) {
|
129
|
-
var autocomplete = this;
|
130
|
-
setTimeout(function() { autocomplete.hide(); }, 250);
|
131
|
-
this.active = this.hasFocus = false;
|
132
|
-
},
|
133
|
-
render: function() {
|
134
|
-
if (this.entryCount > 0) {
|
135
|
-
for (var i = 0; i < this.entryCount; ++i) {
|
136
|
-
$(this.getEntry(i))[this.index == i ? 'addClass' : 'removeClass']('selected');
|
137
|
-
}
|
138
|
-
if (this.hasFocus) {
|
139
|
-
this.show();
|
140
|
-
this.active = true;
|
141
|
-
}
|
142
|
-
}
|
143
|
-
else {
|
144
|
-
this.active = false;
|
145
|
-
this.hide();
|
146
|
-
}
|
147
|
-
},
|
148
|
-
markPrevious: function() {
|
149
|
-
if (this.index > 0) --this.index;
|
150
|
-
else this.index = this.entryCount - 1;
|
151
|
-
},
|
152
|
-
markNext: function() {
|
153
|
-
if (this.index < this.entryCount - 1) ++this.index;
|
154
|
-
else this.index = 0;
|
155
|
-
},
|
156
|
-
getEntry: function(i) {
|
157
|
-
return $(this.update.firstChild).children('li').get(i);
|
158
|
-
},
|
159
|
-
getCurrentEntry: function() {
|
160
|
-
return this.getEntry(this.index);
|
161
|
-
},
|
162
|
-
selectEntry: function() {
|
163
|
-
this.active = false;
|
164
|
-
this.updateElement(this.getCurrentEntry());
|
165
|
-
},
|
166
|
-
updateElement: function(element) {
|
167
|
-
if (this.options.updateElement) {
|
168
|
-
this.options.updateElement(element);
|
169
|
-
return;
|
170
|
-
}
|
171
|
-
|
172
|
-
var value = $.trim(this.options.select ?
|
173
|
-
$('.' + this.options.select, element).text() :
|
174
|
-
$(element).text());
|
175
|
-
|
176
|
-
var bounds = this.getTokenBounds();
|
177
|
-
if (bounds[0] != -1) {
|
178
|
-
var newValue = this.element.value.substr(0, bounds[0]);
|
179
|
-
var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/);
|
180
|
-
if (whitespace) newValue += whitespace[0];
|
181
|
-
this.element.value = newValue + value + this.element.value.substr(bounds[1]);
|
182
|
-
}
|
183
|
-
else {
|
184
|
-
this.element.value = value;
|
185
|
-
}
|
186
|
-
|
187
|
-
this.oldElementValue = $(this.element).focus().val();
|
188
|
-
|
189
|
-
if (this.options.afterUpdateElement) this.options.afterUpdateElement(this.element, element);
|
190
|
-
},
|
191
|
-
updateChoices: function(choices) {
|
192
|
-
if (!this.changed && this.hasFocus) {
|
193
|
-
$(this.update).html($.trim(choices));
|
194
|
-
var i = 0, autocomplete = this;
|
195
|
-
this.entryCount = $(this.update.firstChild).children('li').each(function() {
|
196
|
-
this.autocompleteIndex = i++;
|
197
|
-
autocomplete.addObservers(this);
|
198
|
-
}).length;
|
199
|
-
}
|
200
|
-
|
201
|
-
this.stopIndicator();
|
202
|
-
this.index = 0;
|
203
|
-
|
204
|
-
if (this.entryCount == 1 && this.options.autoSelect) {
|
205
|
-
this.selectEntry();
|
206
|
-
this.hide();
|
207
|
-
}
|
208
|
-
else {
|
209
|
-
this.render();
|
210
|
-
}
|
211
|
-
},
|
212
|
-
addObservers: function(element) {
|
213
|
-
var autocomplete = this;
|
214
|
-
$(element)
|
215
|
-
.mouseover(function(e) { autocomplete.onHover(e); })
|
216
|
-
.click(function(e) { autocomplete.onClick(e); });
|
217
|
-
},
|
218
|
-
onObserverEvent: function() {
|
219
|
-
this.changed = false;
|
220
|
-
this.tokenBounds = null;
|
221
|
-
if (this.getToken().length >= this.options.minChars) {
|
222
|
-
this.getUpdatedChoices();
|
223
|
-
}
|
224
|
-
else {
|
225
|
-
this.active = false;
|
226
|
-
this.hide();
|
227
|
-
}
|
228
|
-
this.oldElementValue = this.element.value;
|
229
|
-
},
|
230
|
-
getToken: function() {
|
231
|
-
var bounds = this.getTokenBounds();
|
232
|
-
return $.trim(this.element.value.substring(bounds[0], bounds[1]));
|
233
|
-
},
|
234
|
-
getTokenBounds: function() {
|
235
|
-
if (null != this.tokenBounds) return this.tokenBounds;
|
236
|
-
var value = $.trim(this.element.value);
|
237
|
-
if (!value.length) return [-1, 0];
|
238
|
-
var diff = getFirstDifferencePos(value, this.oldElementValue);
|
239
|
-
var offset = (diff == this.oldElementValue.length ? 1 : 0);
|
240
|
-
var prevTokenPos = -1, nextTokenPos = value.length;
|
241
|
-
for (var tp = null, index = 0, l = this.options.tokens.length; index < l; ++index) {
|
242
|
-
tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1);
|
243
|
-
if (tp > prevTokenPos) prevTokenPos = tp;
|
244
|
-
tp = value.indexOf(this.options.tokens[index], diff + offset);
|
245
|
-
if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp;
|
246
|
-
}
|
247
|
-
return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]);
|
248
|
-
},
|
249
|
-
getUpdatedChoices: function() {
|
250
|
-
this.startIndicator();
|
251
|
-
|
252
|
-
var autocomplete = this, entry = encodeURIComponent(this.options.paramName) + '=' + encodeURIComponent(this.getToken());
|
253
|
-
this.options.data = this.options.callback ? this.options.callback(this.element, entry) : entry;
|
254
|
-
|
255
|
-
if (this.options.defaultParams) this.options.data += '&' + this.options.defaultParams;
|
256
|
-
var ajaxOptions = $.extend({}, this.options, {
|
257
|
-
url: this.url,
|
258
|
-
success: function(data, status) {
|
259
|
-
autocomplete.updateChoices(data);
|
260
|
-
}
|
261
|
-
});
|
262
|
-
$.ajax(ajaxOptions);
|
263
|
-
}
|
264
|
-
});
|
265
|
-
|
266
|
-
$.fn.autocomplete = function(options) {
|
267
|
-
var update = $('#' + options.update).get(0), url = options.url;
|
268
|
-
options.update = options.url = undefined;
|
269
|
-
this.filter(':text').each(function() {
|
270
|
-
new AutoComplete(this, update, url, options);
|
271
|
-
});
|
272
|
-
return this;
|
273
|
-
}
|
274
|
-
})(jQuery);
|