On Fri, Sep 10, 2010 at 12:34 PM, abhi <ab...@littlewiki.in> wrote:
>
> On Sep 8, 5:23 pm, Sami Dalouche <sami.dalou...@gmail.com> wrote:
>>
>> OK, great ! Please do not hesitate to post if you need help regarding
>> which sections of the code need to be changed.
>>
> This is what I did:
> I added an extra class variable, uploadMultiple and in line 127:
> http://bit.ly/d3snjb
> this.uploadUnitContainer = new
> multiplefileuploader.widget.UploadUnitContainer(params,
> this.fileUploadContainer , this.uploadActionsContainer);
> if (!this.uploadMultiple){
>
> dijit.byId(this.uploadUnitContainer._uploadActions.id).destroy()
> }
>
> It's more of a hack and I think the proper way would be in
> uploadActions.js
>>
>>
Both MultipleFileUploader and UploadActions are widgets that we try to
keep free of business logic.
The responsibility of these components is to manage the display /
templates and bind the events to the right
business logic.
So, my guess would be that :
- MultipleFileUploader could have an additional variable that stores
the maximum number of upload units
that we want to allow. (I guess a number of more flexible than a
boolean indicating whether we want single/multiple mode)
- UploadUnitContainer.supportsAdditionalUploadUnits() could be created
to check the max-number-of-units
and inform whether it is allowed to create a new upload unit. This
method could be called in UploadActions to
hide the button when no more additionalUploadUnits can be created.
- UploadUnitContainer.createUploadUnit() could be a good place to
check the max-number-of-units logic
(and throw an exception if max has been reached ?)
before creating a new upload unit. (not strictly necessary if the
button is not displayed, but this would make the logic
more defensive.
What do you think ?
>>
>> > > 3) We cant cancel an ongoing upload in javascript. The only way to do it is
>> > > to add a flash abstraction. As this uploader is full javascript, we dont
>> > > have the possibility to cancel an upload.
>>
> I see that you are using a dojo.io.iframe for the real upload. Is it
> not possible to have a deferred.cancel() on that to cancel an upload ?
> I have never used io.iframe but is it possible ?
>> > Ok
>> > > 4) OnError is fired when an error occurs (http://github.com/samokk/multiplefileuploader/blob/master/src/multipl...)
>>
>> > What I also meant was the widget itself must not write it out in the
>> > DOM(in bold red color) if the operation failed but instead just raise
>> > an exception or call onError.
>>
>
From what I remember, It seemed like cancelling was not working at
all. Florent, as you experimented a few things on that, can you give
us more details about the issues you faced ?
sami
Do not hesitate to create a fork on github, so that we can easily see
your commits, instead of copy-pasting the code snippets here.
regards,
Sami Dalouche