BootstrapBooklet - HopefulLlama/Bootstrap-Booklet GitHub Wiki

Constructors

Parameters Data Types Summaries
container String A jQuery style selector to reference a div element on the HTML page, e.g.: "#booklet".

Actions on Construction

  • Sets own id property to the value of global variable _bookletCounter;
  • Increments _bookletCounter
  • Sets own container property the parameter container
  • Sets own contents property to a new Contents instance
  • Sets own pages to new empty array
  • Sets own pagination property to a new Pagination instance
  • Sets own pageCounter property to 0

Field Summary

Property Data Type Summary
id Integer Set on creation and should not be modified. See Global. Used to uniquely identify this booklet on the HTML page. Also used in combination with its children's ID to uniquely identify child elements.
container String Should be passed in as a parameter, and no logical reason to be changed after instantiation.
contents Object: Contents Creates an instance of Contents on creation. See Contents.
pages Array‹Page› Empty by default. Should not be manipulated directly. Instead use this.addPage(title, bodyHTML).
pagination Object: Pagination Creates an instance of Pagination on creation. See Pagination.
panelClasses String Defaults to "panel-info". This specifies a string of CSS classes to apply to the panels of this booklet.
pageCounter Integer Defaults to 0. Should not be manipulated. Keeps a counter to assign unique ID numbers to the pages it owns. Incremented per page creation.

Function Summary

Function Parameters Return Type Summary
addPage
  1. String: title
  2. String: bodyHTML
void The title parameter refers to the title to be given to the page. The bodyHTML refers to a HTML string which will act as the body of the page. This creates a Page objects, and pushes it to the pages array. This also increments the pageCounter.
generate void Generates a HTML string, based on its own properties and scope, and injects this into the container's inner HTML.
⚠️ **GitHub.com Fallback** ⚠️