Hi all,

Forgive me if this has an obvious solution; I haven't found it yet. On my site, I use another javascript that is called in body onload. Of course, this means that the added script by FUpload in window.onload isn't run. Now, I tried copying the FUpload generated javascript into a function in my first piece of script and then called it on load, but of course that's tied to a particular sessionID so stops working (also, it means I'm calling nonexistant things on a bunch of pages). And, of course, moving my other script to window.onload has the same problem; onload is being called twice thus only one script runs.

Is there a call I can put into body onload that will use / recreate the generated javascript at the top of page? Or if not, is there some other solution?

(Note: just because of the warning box, I'm using Firefox 3.0.10, but of course the problem appears in (all?) other browsers)

Thanks, for any help, I've been puzzling over how to make this work for a few days now.

Comments

tuffnatty’s picture

subscribing

tuffnatty’s picture

Status: Active » Patch (to be ported)

After this change, the button replacement occurs automatically when Drupal.attachBehaviors() is called.

--- swfupload-settings.tpl.php.orig     2009-03-21 11:32:50.000000000 +0300
+++ swfupload-settings.tpl.php  2009-07-09 12:08:44.000000000 +0400
@@ -8,6 +8,7 @@
         var queue_complete = 0; // contains number of queued and successfully uploaded images
         var count_failed_uploads = 0; // Number of failed uploads

+       Drupal.behaviors.swfupload =
                window.onload = function() {
                        var settings = {
                                flash_url : "<?php print $modulepath; ?>/swfupload/swfupload.swf",
@@ -120,4 +121,4 @@
              if (redirect_url_main == "" && numFilesUploaded > 0)
                fupload_redirect();

-         }
\ No newline at end of file
+         }
grandcat’s picture

I'll check this. Thank you for the patch file!

grandcat’s picture

Version: 6.x-3.0-rc2 » 6.x-3.x-dev
Category: support » bug
Status: Patch (to be ported) » Fixed

Commited to 6.x-3.x. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.