LIVVkit

API

Web Frontend

drawNav()

Draws the navigation sidebar by looking at the index.json data and appends the list of resultant pages to the nav div.

drawContent()

Draws content to the page by looking at the name of the page and loading the appropriate dataset.

drawError(data, div)

Build an error message and appends it to the div.

Arguments:
  • data (Object) – The error element data. Determined by having data[“Type”] = “Error”
  • div (string) – The name of the div to draw to. Should be referenced as a string that determines whether it is a class or id (ie include # or .)
drawSummary(data, div)

Build a summary and adds it to the div.

Arguments:
  • data (Object) – The data representing the summary. Determined by data[“Type”] = “Summary”
  • div (string) – The name of the div to draw to. Should be referenced as a string that determines whether it is a class or id (ie include # or .)
drawValSummary(data, div)

Build a validation extension summary and adds it to the div.

Arguments:
  • data (Object) – The data representing the summary. Determined by data[“Type”] = “Summary”
  • div (string) – The name of the div to draw to. Should be referenced as a string that determines whether it is a class or id (ie include # or .)
drawDiff(data, div)

Build a file diff

Arguments:
  • data (Object) – The data representing the table. Determined by data[“Type”] = “Diff”
  • div (string) – The name of the div to draw to. Should be referenced as a string that determines whether it is a class or id (ie include # or .)
drawBitForBit(data, div)

Build a bit for bit table

Arguments:
  • data (Object) – The data representing the table. Determined by data[“Type”] = “Bit for Bit”
  • div (string) – The name of the div to draw to. Should be referenced as a string that determines whether it is a class or id (ie include # or .)
drawGallery(data, div)

Build a gallery

Arguments:
  • data (Object) – The data representing the table. Determined by data[“Type”] = “Gallery”
  • div (string) – The name of the div to draw to. Should be referenced as a string that determines whether it is a class or id (ie include # or .)
drawImage(data, div)

Draw an image

Arguments:
  • data (Object) – The data representing the image. Determined by data[“Type”] = “Image”
  • div (string) – The name of the div to draw to. Should be referenced as a string that determines whether it is a class or id (ie include # or .)
drawLightbox(img_elem, size)

Draw an image thumbnail with a link to open the image in a lightbox

Arguments:
  • img_elem (dictionary) – Dictionary describing the image location, title, album, and caption
  • size (number) – The desired height to draw
Returns:

the html to embed into another element

drawThumbnail(path, size)

Draw an image thumbnail with a link to open in a new tab

Arguments:
  • path (string) – The location of the image to thumbnail-size
  • size (number) – The desired height to draw
Returns:

the html to embed into another element

drawTable(data, div)

Build a table

Arguments:
  • data (Object) – The data representing the table. Determined by data[“Type”] = “Table”
  • div (string) – The name of the div to draw to. Should be referenced as a string that determines whether it is a class or id (ie include # or .)
drawVTable(data, div)

Build a vertical table

Arguments:
  • data (Object) – The data representing the table. Determined by data[“Type”] = “Vertical Table”
  • div (string) – The name of the div to draw to. Should be referenced as a string that determines whether it is a class or id (ie include # or .)
drawVHTable(data, div)

Build a table with horizontal and vertical headers and add it to the div.

Arguments:
  • data (Object) – The data representing the summary. Determined by data[“Type”] = “V-H Table”
  • div (string) – The name of the div to draw to. Should be referenced as a string that determines whether it is a class or id (ie include # or .)
drawHTML(data, div)

Draw HTML element

Arguments:
  • data (Object) – The data representing the html element. Determined by data[“Type”] = “HTML”
  • div (string) – The name of the div to draw to. Should be referenced as a string that determines whether it is a class or id (ie include # or .)
loadJSON(path)

Load a json file into a variable