Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Latest commit

 

History

History
115 lines (98 loc) · 12 KB

plugins.core.preferences.manager.panel.md

File metadata and controls

115 lines (98 loc) · 12 KB

docs » plugins.core.preferences.manager.panel


CommandPost Preferences Panel.

API Overview

API Documentation

Constructors

Signature plugins.core.preferences.manager.panel.new(priority, id) -> cp.core.preferences.manager.panel
Type Constructor
Description Constructs a new panel with the specified priority and ID.
Parameters
  • priority - Defines the order in which the panel appears.
  • id - The unique ID for the panel.
  • webview - The webview the panel is attached to.

Methods

Signature plugins.core.preferences.manager.panel:addButton(params) -> panel
Type Method
Description Adds a button to the panel.
Parameters
  • params - The list of parameters.
Returns
  • The same panel.
Notes
  • The params table may contain: id - (optional) the unique ID for the button. If none is provided, one is generated. value - The value of the button. This is sent to the onclick function. label - The text label for the button. Defaults to the value if not provided. width - The width of the button in pixels. ** onclick - the function to execute when the button is clicked. The function should have the signature of function(id, value), where id is the id of the button that was clicked, and value is the value of the button.
Signature plugins.core.preferences.manager.panel:addCheckbox(priority, params) -> panel
Type Method
Description Adds a checkbox to the panel with the specified priority and params.
Parameters
  • priority - The priority number for the checkbox.
  • params - The set of parameters for the checkbox.
Returns
  • The panel.Notes:
  • The params can contain the following fields: id - (optional) The unique ID. If none is provided, one will be generated. name - (optional) The name of the checkbox field. label - (optional) The text label to display after the checkbox. onchange - (optional) a function that will get called when the checkbox value changes. It will be passed two parameters, id and params, the latter of which is a table containing the value and checked values of the checkbox. ** class - (optional) the CSS class list to apply to the checkbox.
Notes
  • The params can contain the following fields: id - (optional) The unique ID. If none is provided, one will be generated. name - (optional) The name of the checkbox field. label - (optional) The text label to display after the checkbox. onchange - (optional) a function that will get called when the checkbox value changes. It will be passed two parameters, id and params, the latter of which is a table containing the value and checked values of the checkbox. ** class - (optional) the CSS class list to apply to the checkbox.
Signature plugins.core.preferences.manager.panel:addContent(priority, content[, escaped]) -> panel
Type Method
Description Adds the specified content to the panel, with the specified priority order.
Parameters
  • priority - the priority order of the content.
  • content - a value that can be converted to a string.
  • escaped - if true, the content will be escaped.
Returns
  • The panel.
Signature plugins.core.preferences.manager.panel:addHandler(event, id, handlerFn, keys) -> none
Type Method
Description Gets a handler from an Handler ID
Parameters
  • event - The event
  • id - the Handler ID
  • handlerFn - The Handler function
  • keys - Keys
Returns
  • None
Signature plugins.core.preferences.manager.panel:addHeading(text) -> panel
Type Method
Description Adds a heading to the panel
Parameters
  • text - The text of the heading as a string
Returns
  • The panel object.
Signature plugins.core.preferences.manager.panel:addParagraph(content[, escaped[, class]]) -> panel
Type Method
Description Adds a Paragraph to the panel
Parameters
  • content - The content as a string
  • escaped - Whether or not the HTML should be escaped as a boolean. Defaults to true for simple text.
  • class - The class as a string
Returns
  • The panel object.
Signature plugins.core.preferences.manager.panel:addPassword(params) -> panel
Type Method
Description Adds a password text-box to the panel.
Parameters
  • params - A table of parameters
Returns
  • The panel object.
Signature plugins.core.preferences.manager.panel:addSelect(params) -> panel
Type Method
Description Adds a select to the panel.
Parameters
  • priority - Priority of the item as number.
  • params - A table of parameters
Returns
  • The panel object.
Signature plugins.core.preferences.manager.panel:addTextbox(params) -> panel
Type Method
Description Adds a text-box to the panel
Parameters
  • params - A table of parameters
Returns
  • The panel object.
Signature plugins.core.preferences.manager.panel:getToolbarItem() -> table
Type Method
Description Gets the Tool Bar as a table
Parameters
  • None
Returns
  • The toolbar item as a table.