Skip to content

hkurhinen/ship-api-front

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ship API front

Jquery plugin to display search results from Ship API

This plugin requires jquery to work and with the bootstrap theme (default), also the bootstrap is required.

You can create your own themes by recreating the templates found from the themes folder.

Check out the live demo

Usage

Include theme (min.) js and (min.) css files from themes/{theme_name}/dist folder and include core js from dist folder.

    $('#ship-search').shipApi({
      url: 'url of Ship API', // Optional, default value: 'https://api.laiva-api.pw/v1'
      size: 10, //How many search results is displayed per page, Optional, default value: 10
      onShipSelect: function(ship, html) {  //Function which is called after user click search result
        var dialog = bootbox.dialog({       //ship: ship object in json format, html: rendered ship object
          title: ship.name,
          message: html
        });
      }
    });

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published