Module

dcp/client-modal

These modules provide the logic for working with the modal templates provided by dcp-client. To maximize flexibility, they each export a config property which states the id of the modal and a list of required ids which this logic depends on. If a suitable modal is found in the page, instead of loading our template modals, we'll simply attach the logic to the provided html.

Author:
  • KC Erb
Guides:

Methods

# async alert(message, message, options)

Parameters:
Name Type Attributes Default Description
message string

The text which will be alerted.

message Object

An instanceof Error whose message will be alerted, and stack trace made available.

options Object
submit string <optional>
"OK"

Text on the submit button.

title string <optional>
""

Text in the title area.

onClose function <optional>

Override default onClose behavior. An instance of modal is handed to the function.

If modal is closed without the form being submitted (submitting the form closes the modal).

# async confirm(message, options) → {boolean}

Parameters:
Name Type Attributes Default Description
message string

The text which will be alerted.

options Object
positive string <optional>
"OK"

Text label of 'positive' button.

negative string <optional>
"Cancel"

Text label of 'negative' button.

title string <optional>
""

Text in the title area.

onClose function <optional>

Override default onClose behavior. An instance of modal is handed to the function.

If modal is closed without the form being submitted (submitting the form closes the modal).

True if the 'positive' button was selected, false if the negative button was.

boolean

# async getKeystoreFile(options, onCloseopt) → {string}

Parameters:
Name Type Attributes Description
options Object

From wallet.get_internal

name string

The name of the keystore type (wallet.get => 'default' and wallet.getId => 'id').

contextId string

An optional, user-defined identifier used for caching keystores. See job.contextId in the compute-api spec.

jobName string

A user-defined job property provided to identify this job.

onClose function <optional>

Override default onClose behavior. An instance of modal is handed to the function.

If modal is closed without the form being submitted (submitting the form closes the modal).

contents of Keystore file

string