Skip to content

Latest commit

 

History

History
59 lines (47 loc) · 6.54 KB

File metadata and controls

59 lines (47 loc) · 6.54 KB

docs » plugins.core.preferences.manager.panel


CommandPost Preferences Panel.

API Overview

  • Constants - Useful values which cannot be changed
  • DEFAULT_PRIORITY
  • HANDLER_PRIORITY
  • Constructors - API calls which return an object, typically one that offers API methods
  • new
  • Methods - API calls which can only be made on an object returned by a constructor
  • addCheckbox
  • addContent

API Documentation

Constants

Signature plugins.core.preferences.manager.panel.DEFAULT_PRIORITY
Type Constant
Description The default priority for panels.
Signature plugins.core.preferences.manager.panel.HANDLER_PRIORITY
Type Constant
Description The default priority for handler scripts.

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: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, unescaped) -> 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.
  • * unescaped - if true, the content will not be escaped. Defaults to false.
Returns
  • * The panel.