Class: ProgressBar

Drupal.ProgressBar(id, updateCallback, method, errorCallback)

new ProgressBar(id, updateCallback, method, errorCallback)

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".

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.

Source:
Example
pb = new Drupal.ProgressBar('myProgressBar');
some_element.appendChild(pb.element);

Methods

displayError(string)

Display errors on the page.

Parameters:
Name Type Description
string string

The error message to show the user.

Source:

sendPing()

Request progress data from server.

Source:

setProgress(percentage, message, label)

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.

Source:

startMonitoring(uri, delay)

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.

Source:

stopMonitoring()

Stop monitoring progress via Ajax.

Source: