This patch provide new feature for ahah.
Example:

$form['wrapper']['wrapper_process']['submit'] = array(
'#type' => 'submit',
'#value' => t('Attach'),
'#id' => 'attach',
'#ahah' => array(
'path' => 'mymodule/upload_js',
'wrapper' => 'mymodule-wrapper-process',
'method' => 'replace',
'effect' => 'slide',
'progress' => array('type' => 'wrapper', 'update_callback' => 'mymodule_upload', 'interval' => 1000, 'url' => 'mymodule/uploadstatus_js/', 'wrapper' => 'mymodule-wrapper-process'),
),
);

Where:
mymodule-wrapper-process -

mymodule_upload - javascript. For example:

function mymodule_upload(wrapper,answer) {
var div = document.createElement('div');

div.className = 'progress';
$(div).html('

'+
'

'+
'

 

');
$('div.filled', div).css('width', answer.percentage +'%');
$('div.percentage', div).html(answer.percentage +'%');
$('div.message', div).html(answer.message);
$(wrapper).empty();
$(wrapper).append(div);

}

So, every 'interval' your javascript will be called by ahah and you can customize progress output and put it into defined div.

CommentFileSizeAuthor
wrapper.patch2.8 KBgor

Comments

stokito’s picture

I am don't think that this is very need. Maybe make it as a module?

gor’s picture

I am don't think that it is possible.

lilou’s picture

Version: 6.2 » 7.x-dev

Feature request go to CVS/HEAD.

dawehner’s picture

Ahah is replaced by #ajax

damien tournoud’s picture

Status: Needs work » Closed (won't fix)

Either I'm totally missing the point, or this has been possible all along (see for example, the upload progress indicator of FileField on Drupal 6).