Skip to content

hkurhinen/ship-api-front

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 

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