# cp.web.generate

Functions for Generating HTML UI Items


# API Overview

Functions - API calls offered directly by the extension

  • button
  • checkbox
  • dropdown
  • heading
  • javascript
  • setWebviewLabel
  • text

# API Documentation

# Functions

# button

Signature cp.web.generate.button(data, customTrigger, customWidth, customID) -> string
Type Function
Description Generates a HTML Button
Parameters
  • data - Table containing the data you want to display on the Checkbox
  • customTrigger - Custom label used for JavaScript Callback
  • customWidth - Number to set the width of the button to
  • customID - Overrides the random HTML ID
Returns
  • String containing the HTML
Notes None
Examples None
Source src/extensions/cp/web/generate.lua line 141

# checkbox

Signature cp.web.generate.checkbox(data, customTrigger, customID) -> string
Type Function
Description Generates a HTML Checkbox
Parameters
  • data - Table containing the data you want to display on the Checkbox
  • customTrigger - Custom label used for JavaScript Callback
  • customID - Custom ID used for the HTML objects
Returns
  • String containing the HTML
Notes None
Examples None
Source src/extensions/cp/web/generate.lua line 59

# dropdown

Signature cp.web.generate.dropdown(title, data, customTrigger) -> string
Type Function
Description Generates a HTML Dropdown
Parameters
  • title - Title to put in front of the Dropdown. Can be "".
  • data - Table containing the data you want to display on the Checkbox
  • customTrigger - Custom label used for JavaScript Callback
Returns
  • String containing the HTML
Notes None
Examples None
Source src/extensions/cp/web/generate.lua line 183

# heading

Signature cp.web.generate.heading(data) -> string
Type Function
Description Generates a HTML Heading
Parameters
  • data - Table containing the data you want to display on the Checkbox
Returns
  • String containing the HTML
Notes None
Examples None
Source src/extensions/cp/web/generate.lua line 115

# javascript

Signature cp.web.generate.javascript(script, context) -> cp.web.html
Type Function
Description Generates a HTML Heading
Parameters
  • data - Table containing the data you want to display on the Checkbox
  • context - The context
Returns
  • String containing the HTML
Notes None
Examples None
Source src/extensions/cp/web/generate.lua line 98

# setWebviewLabel

Signature cp.web.generate.setWebviewLabel() -> none
Type Function
Description Sets the WebView Label
Parameters
  • value - WebView Label as string
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/web/generate.lua line 46

# text

Signature cp.web.generate.text(data) -> string
Type Function
Description Generates a blank HTML
Parameters
  • data - Table containing the data you want to display.
Returns
  • String containing the HTML
Notes None
Examples None
Source src/extensions/cp/web/generate.lua line 128