Giter Site home page Giter Site logo

triple-seat's Introduction

This is a replacement javascript file for Triple Seat reservation system. To use, place triple-seat.js on your server. Then replace the script element tag that Triple Seat provided, using triple-seat.js as the source, and copying the query string (the part of the src attribute after the ? character) to the new script tag. So instead of this

<script src="https://api.tripleseat.com/v1/leads/ts_script.js?lead_form_id=foo&public_key=bar"></script>

use

<script id="triple-seat-script" src="triple-seat.js?lead_form_id=foo&public_key=bar"></script>

Note that "foo" and "bar" in the example url above must be replaced with the values from the script element you were using. Also, make sure to include the id attribute on the tag; the form will not load without it.

Why replace the javascript file that Triple Seat provides?

The form that Triple Seat provides has numerous problems that this script tries to rectify:

  • it uses html5 input types (time, date, and number) instead of generic text inputs
  • it only loads jquery datepicker on clients that don't support native date inputs; that means it doesn't load jquery-ui resources unless they're actually needed, decreasing payload and improving speed
  • it uses native time inputs in supporting browsers; for those that don't, it uses simple select elements instead of timepicker inputs
  • it uses its own functions for client-side validation instead of native html5 form constraints like the "required" attribute
  • it uses a mere 50 lines of css instead of the 231 in Triple Seat's form, and looks better
  • it does not rely on table markup for presentation
  • it is adaptable to small devices "out of the box", no additional code needed
  • it allows some customization via simple configuration variables to set minimum time, date, etc.

triple-seat's People

Contributors

btrem avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.