Progress bar
Written by quicksketch: http://drupal.org/node/181741#comment-612849
The progress bar indicator is the main component of this patch. Since modules utilizing AHAH will need different approaches, we need to accommodate for all scenarios. Sample displays attached. Here are some code examples of how you would customize the progress bar used with AHAH to your liking:
Example 1. Throbber (default).
<?php
$form['element']['#ahah'] = array(
'path' => 'some/path/js',
'wrapper' => 'wrapper-id',
'progress' => 'throbber', // Optional line, throbber is default.
),
?>Example 2. Throbber with message.
<?php
$form['element']['#ahah'] = array(
'path' => 'some/path/js',
'wrapper' => 'wrapper-id',
'progress' => array('type' => 'throbber', 'message' => t('Please wait...')), // Value is an array if multiple settings are set.
),
?>Example 3. Progress bar.
<?php
$form['element']['#ahah'] = array(
'path' => 'some/path/js',
'wrapper' => 'wrapper-id',
'progress' => 'bar', // A simple bar.
),
?>Example 4. Progress bar with message.
<?php
$form['element']['#ahah'] = array(
'path' => 'some/path/js',
'wrapper' => 'wrapper-id',
'progress' => array('type' => 'bar', 'message' => t('Please wait...')), // Bar with message (upload module, book), gets the t() string out of javascript and makes it customizable.
),
?>Example 5. Progress bar with message and progress indicator.
<?php
$form['element']['#ahah'] = array(
'path' => 'some/path/js',
'wrapper' => 'wrapper-id',
'progress' => array('type' => 'bar', 'message' => t('Please wait...'), 'path' => 'some/path/progress')), // Potentially great for expensive or time-consuming tasks.
),
?>Example 6. No progress indicator at all.
<?php
$form['element']['#ahah'] = array(
'path' => 'some/path/js',
'wrapper' => 'wrapper-id',
'progress' => 'none', // No throbber or bar. Adds nothing to the page, but still disables the changed element during request.
),
?>Result:
