ProgressBar

Drupal. ProgressBar

new ProgressBar(id, updateCallback, method, errorCallback)

Source:
A progressbar object. Initialized with the given id. Must be inserted into the DOM afterwards through progressBar.element. Method is the function which will perform the HTTP request to get the progress bar state. Either "GET" or "POST".
Example
pb = new Drupal.ProgressBar('myProgressBar');
some_element.appendChild(pb.element);
Parameters:
Name Type Description
id string The id for the progressbar.
updateCallback function Callback to run on update.
method string HTTP method to use.
errorCallback function Callback to call on error.

Methods

displayError(string)

Source:
Display errors on the page.
Parameters:
Name Type Description
string string The error message to show the user.

sendPing()

Source:
Request progress data from server.

setProgress(percentage, message, label)

Source:
Set the percentage and status message for the progressbar.
Parameters:
Name Type Description
percentage number The progress percentage.
message string The message to show the user.
label string The text for the progressbar label.

startMonitoring(uri, delay)

Source:
Start monitoring progress via Ajax.
Parameters:
Name Type Description
uri string The URI to use for monitoring.
delay number The delay for calling the monitoring URI.

stopMonitoring()

Source:
Stop monitoring progress via Ajax.