[Checkins] SVN: z3c.widget/trunk/ - bugfix: browse butten will now be enabled after cancel was clicked in

Bernd Roessl bernd.roessl at lovelysystems.com
Wed Sep 5 06:56:29 EDT 2007


Log message for revision 79477:
  - bugfix: browse butten will now be enabled after cancel was clicked in
    the open file dialog
  - do not set the progessbar to 100% before the upload was started
  - bugfix: files will not be uploaded if no limit was set
  
  

Changed:
  U   z3c.widget/trunk/CHANGES.txt
  U   z3c.widget/trunk/flash/fla/upload.fla
  U   z3c.widget/trunk/flash/src/z3c/widget/flashupload/baseskin/Upload.as
  U   z3c.widget/trunk/setup.py
  U   z3c.widget/trunk/src/z3c/widget/flashupload/resources/upload.js
  U   z3c.widget/trunk/src/z3c/widget/flashupload/resources/upload.swf

-=-
Modified: z3c.widget/trunk/CHANGES.txt
===================================================================
--- z3c.widget/trunk/CHANGES.txt	2007-09-05 09:47:46 UTC (rev 79476)
+++ z3c.widget/trunk/CHANGES.txt	2007-09-05 10:56:28 UTC (rev 79477)
@@ -3,6 +3,15 @@
 ======================
 
 
+2007/09/05 0.1.5
+================
+
+ - bugfix: browse butten will now be enabled after cancel was clicked in
+   the open file dialog
+ - do not set the progessbar to 100% before the upload was started
+ - bugfix: files will not be uploaded if no limit was set
+
+
 2007/09/05 0.1.4
 ================
 

Modified: z3c.widget/trunk/flash/fla/upload.fla
===================================================================
(Binary files differ)

Modified: z3c.widget/trunk/flash/src/z3c/widget/flashupload/baseskin/Upload.as
===================================================================
--- z3c.widget/trunk/flash/src/z3c/widget/flashupload/baseskin/Upload.as	2007-09-05 09:47:46 UTC (rev 79476)
+++ z3c.widget/trunk/flash/src/z3c/widget/flashupload/baseskin/Upload.as	2007-09-05 10:56:28 UTC (rev 79477)
@@ -285,14 +285,18 @@
         the ticket holds some security information which 
         are required for the upload
     */
-    public function loadNextTicket():Void{
-
+    public function loadNextTicket():Void
+    {
         // we want to have a 100% bar, even if onProgress was never
         // fired because the file was so small that onProgress was
         // never fired
-        this.updateFileProgress(100);
+        // UPDATE: seems like we don't want a 100% progress bar,
+        // so set it to 0
         
-        if (file_array.length == 0){
+        this.updateFileProgress(0);
+
+        if (file_array.length == 0)
+        {
             log("all files uploaded.");
 			// all files uploaded. Fire JavaScript Event
 			js_command_queue.push("javascript:z3cFlashUploadOnUploadCompleteFEvent()");
@@ -301,7 +305,8 @@
 			    info_mc.filename_txt.text = upload_complete_str;
 			else
 			    info_mc.filename_txt.text = files_loaded + " " + upload_partial_str;
-			    
+			
+			this.updateFileProgress(100);
             this.updateOverallProgress(100);
             return;
         }
@@ -323,7 +328,7 @@
     {        
         file = FileReference(file_array.pop());
         
-        if (file.size > maxSize * 1000)
+        if (maxSize && (file.size > maxSize * 1000))
         {
             files_not_loaded++;
             scrollbox_mc.setHeadline(files_not_loaded + " " + not_uploaded_str);
@@ -417,6 +422,7 @@
 
     public function onCancel(file:FileReference):Void{
         log("onCancel");
+		js_command_queue.push("javascript:z3cFlashUploadEnableBrowseButton()");
 		js_command_queue.push("javascript:z3cFlashUploadOnCancelFEvent()");
     }
     
Modified: z3c.widget/trunk/setup.py
===================================================================
--- z3c.widget/trunk/setup.py	2007-09-05 09:47:46 UTC (rev 79476)
+++ z3c.widget/trunk/setup.py	2007-09-05 10:56:28 UTC (rev 79477)
@@ -2,7 +2,7 @@
 from setuptools import setup, find_packages
 
 setup(name='z3c.widget',
-      version='0.1.4',
+      version='0.1.5',
       author = "Zope Community",
       author_email = "zope3-dev at zope.org",
       description = "Additional Zope3 Widgets",

Modified: z3c.widget/trunk/src/z3c/widget/flashupload/resources/upload.js
===================================================================
--- z3c.widget/trunk/src/z3c/widget/flashupload/resources/upload.js	2007-09-05 09:47:46 UTC (rev 79476)
+++ z3c.widget/trunk/src/z3c/widget/flashupload/resources/upload.js	2007-09-05 10:56:28 UTC (rev 79477)
@@ -7,6 +7,11 @@
     }
 }
 
+function z3cFlashUploadEnableBrowseButton(){
+    document.getElementById("flash.start.browsing").style.visibility = "visible";
+    document.getElementById("flash.start.browsing").disabled = false;
+}
+
 function z3cFlashUploadDisableBrowseButton(){
     document.getElementById("flash.start.browsing").style.visibility = "hidden";
     document.getElementById("flash.start.browsing").disabled = "disabled";
@@ -30,6 +35,7 @@
     called when the user presses the cancel button while browsing
 */
 function z3cFlashUploadOnCancelFEvent(){
+
     if (typeof(z3cFlashUploadOnCancelEvent) =="function"){
         z3cFlashUploadOnCancelEvent();
     }

Modified: z3c.widget/trunk/src/z3c/widget/flashupload/resources/upload.swf
===================================================================
(Binary files differ)



More information about the Checkins mailing list