GithubHelp home page GithubHelp logo

sachinkurkute / movie-seat-layout Goto Github PK

View Code? Open in Web Editor NEW
24.0 5.0 8.0 138 KB

Print seat layout for movie, flight (jQuery plugin)

License: MIT License

CSS 2.55% JavaScript 9.45% HTML 88.00%
jquery movie layout seat-picker html

movie-seat-layout's Introduction

seatLayout.js (movie-seat-layout)

Print seat layout for movie, flight and seat selection (jQuery plugin)

Demo : https://sachinkurkute.github.io/movie-seat-layout/src/index.html

Prerequisites

seatLayout.js is jQuery plugin, you need jQuery already installed OR added referense on your page

Installing

Download code from git https://github.com/SachinKurkute/movie-seat-layout

Add seatlayout.js reference below the jQuery plugin.

  <script src="app/lib/jquery.js"></script>
  <script src="bin/seatLayout/seatLayout.min.js"></script>

Your installation is done !

Run and Initialize

Add html element

<div class="movieLayoutContainer"></div>

Initialize


$('.movieLayoutContainer').seatLayout({
      data: {...},    // Movie seat data 
      showActionButtons:true,
      classes : {     // Add class or classes for the component
          doneBtn : '',
          cancelBtn : '',
          row:'',
          area:'',
          screen:'',
          seat:''
      },
      numberOfSeat: 3  // Nuber of seat want to select
})

data :

data (object) This is JavaScript object. It's help to print the seat layout of movie please find the JOSN file, which is help to understand the structure.

numberOfSeat

numberOfSeat (number) Number of seats allow to select

showActionButtons

showActionButtons (bool) Default is true, hide the action button i.e Done and Cancel.

classes

classes (object) set the component wise classes

{
      doneBtn : '', // classes for Done button
      cancelBtn : '', // classes for Cancel button
      row:'',   // classes for each row
      area:'', // Classes for each area
      screen:'',  // Classes for screen 
      seat:'' // Classes for each seat
}

Functions


        $('.selectMove').seatLayout({
            data: seatData,
            showActionButtons:true,
            classes : {
                doneBtn : '',
                cancelBtn : '',
                row:'',
                area:'',
                screen:'',
                seat:''
            },
            numberOfSeat: nuberOfSeat,
            callOnSeatRender: function (Obj) {
                //modify seat object if require and return it;
                return Obj;
            },
            callOnSeatSelect: function (_event, _data, _element) {
                console.log(_event);
                console.log(_data);
                console.log(_element);
            },
            selectionDone: function (_array) {
                console.log(_array);
            },
            cancel: function () {
                return false;
            }
        });
        

callOnSeatRender

callOnSeatRender (function) called every seat rendering this seat object

    callOnSeatRender: function (Obj) {   // Obj (param )is seat object
        //modify seat object if require and return it;
        return Obj;
    }

callOnSeatSelect

callOnSeatSelect (function) Called after selected the seat

    callOnSeatSelect: function (_event, _data, _element) {
        console.log(_event);  // Event
        console.log(_data);  // Data of selected seat with total selected seat property
        console.log(_element); // Selected element i.e. $(this)
    }
    

selectionDone

selectionDone (function) Called after clicked Done button with param Array of selected seat

selectionDone: function (_array) {
    console.log(_array);   // Selected seat array
},

cancel

cancel (function) Called after clicked Cancel button with param Array of selected seat

cancel: function () {
    return false;   // In case preventing the cancel action return false, Otherwise it will null the current object
},

License

This project is licensed under the MIT License - see the LICENSE file for details

movie-seat-layout's People

Contributors

sachinkurkute avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

movie-seat-layout's Issues

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.