### Eclipse Workspace Patch 1.0
#P fluid-components
Index: src/webapp/fluid-components/html/templates/Uploader.html
===================================================================
--- src/webapp/fluid-components/html/templates/Uploader.html	(revision 6796)
+++ src/webapp/fluid-components/html/templates/Uploader.html	(working copy)
@@ -105,7 +105,7 @@
                                 </tr>
 
                         </table>
-                        <div class="total-progress">&nbsp;</div>
+                        <div class="flc-uploader-totalProgress fl-uploader-totalProgress-complete">&nbsp;</div>
                     </div>
                 </div>
                 
Index: src/webapp/fluid-components/js/fluid/uploader/DemoUploadManager.js
===================================================================
--- src/webapp/fluid-components/js/fluid/uploader/DemoUploadManager.js	(revision 6795)
+++ src/webapp/fluid-components/js/fluid/uploader/DemoUploadManager.js	(working copy)
@@ -93,6 +93,8 @@
     var stopDemo = function (that) {
         var file = that.demoState.currentFile;
         file.filestatus = fluid.uploader.fileStatusConstants.CANCELLED;
+        that.queue.shouldStop = true;
+        
         // In SWFUpload's world, pausing is a combinination of an UPLOAD_STOPPED error and a complete.
         that.events.onFileError.fire(file, 
                                      fluid.uploader.errorConstants.UPLOAD_STOPPED, 
Index: src/webapp/fluid-components/js/fluid/uploader/Progress.js
===================================================================
--- src/webapp/fluid-components/js/fluid/uploader/Progress.js	(revision 6795)
+++ src/webapp/fluid-components/js/fluid/uploader/Progress.js	(working copy)
@@ -152,6 +152,7 @@
         that.ariaElement = that.locate("ariaElement");
         
         that.indicator.width(that.options.minWidth);
+
         that.storedPercent = 0;
                 
         // initialize ARIA
Index: src/webapp/fluid-components/js/fluid/uploader/FileQueue.js
===================================================================
--- src/webapp/fluid-components/js/fluid/uploader/FileQueue.js	(revision 6795)
+++ src/webapp/fluid-components/js/fluid/uploader/FileQueue.js	(working copy)
@@ -41,6 +41,12 @@
             return (file.filestatus === fluid.uploader.fileStatusConstants.QUEUED || file.filestatus === fluid.uploader.fileStatusConstants.CANCELLED);
         });
     };
+    
+    var getErroredFiles = function (that) {
+        return filterFiles(that.files, function (file) {
+            return (file.filestatus === fluid.uploader.fileStatusConstants.ERROR);
+        });
+    };
 
     var removeFile = function (that, file) {
         // Remove the file from the collection and tell the world about it.
@@ -93,6 +99,10 @@
             return getReadyFiles(that);
         };
         
+        that.getErroredFiles = function () {
+            return getErroredFiles(that);
+        };
+        
         that.sizeOfReadyFiles = function () {
             return fluid.fileQueue.sizeOfFiles(that.getReadyFiles());
         };
@@ -137,7 +147,7 @@
         that.start = function () {
             that.queue.setupCurrentBatch();
             that.queue.isUploading = true;
-            that.queue.stopUploadOnFileComplete = false;
+            that.queue.shouldStop = false;
             that.events.onUploadStart.fire(that.queue.currentBatch.files); 
         };
         
@@ -146,7 +156,7 @@
             that.queue.currentBatch.bytesUploadedForFile = 0;
             that.queue.currentBatch.previousBytesUploadedForFile = 0; 
         };
-        
+                
         that.finishFile = function (file) {
             var batch = that.queue.currentBatch;
             batch.numFilesCompleted++;
@@ -154,7 +164,7 @@
         };
         
         that.shouldUploadNextFile = function () {
-            return !that.queue.stopUploadOnFileComplete && that.queue.isUploading && that.queue.currentBatch.numFilesCompleted < that.queue.currentBatch.files.length;
+            return !that.queue.shouldStop && that.queue.isUploading && that.queue.currentBatch.numFilesCompleted < that.queue.currentBatch.files.length;
         };
         
         that.complete = function () {
Index: src/webapp/fluid-components/js/fluid/uploader/Uploader.js
===================================================================
--- src/webapp/fluid-components/js/fluid/uploader/Uploader.js	(revision 6796)
+++ src/webapp/fluid-components/js/fluid/uploader/Uploader.js	(working copy)
@@ -242,6 +242,7 @@
         var errorMsg = that.options.strings.errors[errorType];
         that.locate("errorText", errorRow).text(errorMsg);
         fileRow.after(errorRow);
+        that.scroller.scrollTo(errorRow);
     };
     
     var showErrorForFile = function (that, file, error) {
@@ -412,6 +413,11 @@
 
 (function ($, fluid) {
     
+    var fileOrFiles = function (that, numFiles) {
+        return (numFiles === 1) ? that.options.strings.progress.singleFile : 
+                                  that.options.strings.progress.pluralFiles;
+    };
+    
     var enableElement = function (that, elm) {
         elm.removeAttr("disabled");
         elm.removeClass(that.options.styles.dim);
@@ -430,6 +436,13 @@
         elm.addClass(that.options.styles.hidden);
     };
     
+    var setTotalProgressStyle = function (that, didError) {
+        didError = didError || false;
+        var indicator = that.totalProgress.indicator;
+        indicator.toggleClass(that.options.styles.totalProgress, !didError);
+        indicator.toggleClass(that.options.styles.totalProgressError, didError);
+    };
+    
     var setStateEmpty = function (that) {
         disableElement(that, that.locate("uploadButton"));
         
@@ -445,8 +458,6 @@
         enableElement(that, that.locate("browseButton"));
         hideElement(that, that.locate("pauseButton"));
         showElement(that, that.locate("uploadButton"));
-        // commented out for JIRA FLUID-2351 to be revisted during 1.0 bug parade
-        // that.locate("totalFileProgressBar").addClass(that.options.styles.completed);
     };
 
     var setStateLoaded = function (that) {
@@ -456,24 +467,24 @@
         enableElement(that, that.locate("uploadButton"));
         enableElement(that, that.locate("browseButton"));
         hideElement(that, that.locate("instructions"));
+        that.totalProgress.hide();
     };
     
     var setStateUploading = function (that) {
+        that.totalProgress.hide(false, false);
+        setTotalProgressStyle(that);
         hideElement(that, that.locate("uploadButton"));
         disableElement(that, that.locate("browseButton"));
         enableElement(that, that.locate("pauseButton"));
         showElement(that, that.locate("pauseButton"));
         that.locate(that.options.focusWithEvent.afterUploadStart).focus();
-        // commented out for JIRA FLUID-2351 to be revisted during 1.0 bug parade
-        // that.locate("totalFileProgressBar").removeClass(that.options.styles.completed);
     };    
     
     var renderUploadTotalMessage = function (that) {
         // Render template for the total file status message.
         var numReadyFiles = that.uploadManager.queue.getReadyFiles().length;
         var bytesReadyFiles = that.uploadManager.queue.sizeOfReadyFiles();
-        var fileLabelStr = (numReadyFiles === 1) ? that.options.strings.progress.singleFile : 
-                                                   that.options.strings.progress.pluralFiles;
+        var fileLabelStr = fileOrFiles(that, numReadyFiles);
                                                    
         var totalStateStr = fluid.stringTemplate(that.options.strings.progress.toUploadLabel, {
             fileCount: numReadyFiles, 
@@ -486,25 +497,47 @@
     var updateTotalProgress = function (that) {
         var batch = that.uploadManager.queue.currentBatch;
         var totalPercent = fluid.uploader.derivePercent(batch.totalBytesUploaded, batch.totalBytes);
-             
+        var numFilesInBatch = batch.files.length;
+        var fileLabelStr = fileOrFiles(that, numFilesInBatch);
+        
         var totalProgressStr = fluid.stringTemplate(that.options.strings.progress.totalProgressLabel, {
             curFileN: batch.fileIdx + 1, 
-            totalFilesN: batch.files.length, 
+            totalFilesN: numFilesInBatch, 
+            fileLabel: fileLabelStr,
             currBytes: fluid.uploader.formatFileSize(batch.totalBytesUploaded), 
             totalBytes: fluid.uploader.formatFileSize(batch.totalBytes)
         });  
         that.totalProgress.update(totalPercent, totalProgressStr);
     };
+    
+    var updateTotalAtCompletion = function (that) {
+        var numErroredFiles = that.uploadManager.queue.getErroredFiles().length;
+        var numTotalFiles = that.uploadManager.queue.files.length;
+        var fileLabelStr = fileOrFiles(that, numTotalFiles);
         
-    var hideTotalProgress = function (that) {
-        var uploadedFiles = that.uploadManager.queue.getUploadedFiles();
+        var errorStr = "";
         
+        // if there are errors then change the total progress bar
+        // and set up the errorStr so that we can use it in the totalProgressStr
+        if (numErroredFiles > 0) {
+            var errorLabelString = (numErroredFiles === 1) ? that.options.strings.progress.singleError : 
+                                                             that.options.strings.progress.pluralErrors;
+            setTotalProgressStyle(that, true);
+            errorStr = fluid.stringTemplate(that.options.strings.progress.numberOfErrors, {
+                errorsN: numErroredFiles,
+                errorLabel: errorLabelString
+            });
+        }
+        
         var totalProgressStr = fluid.stringTemplate(that.options.strings.progress.completedLabel, {
-            curFileN: uploadedFiles.length, 
+            curFileN: that.uploadManager.queue.getUploadedFiles().length, 
+            totalFilesN: numTotalFiles,
+            errorString: errorStr,
+            fileLabel: fileLabelStr,
             totalCurrBytes: fluid.uploader.formatFileSize(that.uploadManager.queue.sizeOfUploadedFiles())
         });
+        
         that.totalProgress.update(100, totalProgressStr);
-        that.totalProgress.hide();
     };
    
     var bindDOMEvents = function (that) {
@@ -537,19 +570,18 @@
         renderUploadTotalMessage(that);
     };
     
-    var updateStateAfterError = function (that) {
-        // add specific total error styling here
-        that.totalProgress.hide();
-        setStateLoaded(that);
+    var updateStateAfterPause = function (that) {
+        // do nothing, moved to afterUploadComplete
     };
     
     var updateStateAfterCompletion = function (that) {
-        hideTotalProgress(that);
+        var userPaused = that.uploadManager.queue.shouldStop;
         if (that.uploadManager.queue.getReadyFiles().length === 0) {
             setStateDone(that);
         } else {
             setStateLoaded(that);
         }
+        updateTotalAtCompletion(that);
     };
     
     var bindModelEvents = function (that) {
@@ -573,9 +605,13 @@
             updateTotalProgress(that); 
         });
         
+        that.events.onFileSuccess.addListener(function () {
+            updateTotalProgress(that); 
+        });
+        
         that.events.onFileError.addListener(function (file, error, message) {
             if (error === fluid.uploader.errorConstants.UPLOAD_STOPPED) {
-                updateStateAfterError(that);
+                updateStateAfterPause(that);
             }
         });
 
@@ -694,10 +730,10 @@
             options: {
                 selectors: {
                     progressBar: ".fl-scroller-table-foot",
-                    displayElement: ".total-progress", 
+                    displayElement: ".flc-uploader-totalProgress", 
                     label: ".total-file-progress",
-                    indicator: ".total-progress",
-                    ariaElement: ".total-progress"
+                    indicator: ".flc-uploader-totalProgress",
+                    ariaElement: ".flc-uploader-totalProgress"
                 }
             }
         },
@@ -726,7 +762,8 @@
             disabled: "disabled",
             hidden: "hidden",
             dim: "dim",
-            completed: "fl-footer-completed"
+            totalProgress: "fl-uploader-totalProgress-complete",
+            totalProgressError: "fl-uploader-totalProgress-errored"
         },
         
         events: {
@@ -748,12 +785,14 @@
 
         strings: {
             progress: {
-                pausedLabel: "Paused at: %curFileN of %totalFilesN files (%currBytes of %totalBytes)",
                 toUploadLabel: "To upload: %fileCount %fileLabel (%totalBytes)", 
-                totalProgressLabel: "Uploading: %curFileN of %totalFilesN files (%currBytes of %totalBytes)", 
-                completedLabel: "Uploaded: %curFileN files (%totalCurrBytes)",
+                totalProgressLabel: "Uploading: %curFileN of %totalFilesN %fileLabel (%currBytes of %totalBytes)", 
+                completedLabel: "Uploaded: %curFileN of %totalFilesN %fileLabel (%totalCurrBytes)%errorString",
+                numberOfErrors: ", %errorsN %errorLabel",
                 singleFile: "file",
-                pluralFiles: "files"
+                pluralFiles: "files",
+                singleError: "error",
+                pluralErrors: "errors"
             },
             buttons: {
                 browse: "Browse Files",
Index: src/webapp/fluid-components/js/fluid/uploader/SWFUploadManager.js
===================================================================
--- src/webapp/fluid-components/js/fluid/uploader/SWFUploadManager.js	(revision 6795)
+++ src/webapp/fluid-components/js/fluid/uploader/SWFUploadManager.js	(working copy)
@@ -46,7 +46,7 @@
             
             // Do our best to make the Flash movie as accessible as possib
             fluid.tabindex(flashMovie, 0);
-            flashMovie.attr("role","button");
+            flashMovie.attr("role", "button");
             flashMovie.attr("alt", "Browse files button");
             
             if (that.isTransparent) {
@@ -225,7 +225,7 @@
             if (that.queueManager.shouldUploadNextFile()) {
                 that.swfUploader.startUpload();
             } else {
-                if (that.queueManager.queue.stopUploadOnFileComplete) {
+                if (that.queueManager.queue.shouldStop) {
                     that.swfUploader.stopUpload();
                 }
                 that.queueManager.complete();
@@ -254,7 +254,7 @@
      */
     
     var stopUpload = function (that) {
-        that.queue.stopUploadOnFileComplete = true;
+        that.queue.shouldStop = true;
         that.events.onUploadStop.fire();
     };
         
@@ -288,6 +288,7 @@
         });
         
         that.events.onFileError.addListener(function (file, error) {
+            that.queue.currentBatch.totalBytesUploaded += file.size;
             if (error === fluid.uploader.errorConstants.UPLOAD_STOPPED) {
                 that.queue.isUploading = false;
             } else if (that.queue.isUploading) {
Index: src/webapp/fluid-components/css/fluid.components.uploader.css
===================================================================
--- src/webapp/fluid-components/css/fluid.components.uploader.css	(revision 6800)
+++ src/webapp/fluid-components/css/fluid.components.uploader.css	(working copy)
@@ -154,6 +154,10 @@
     color: #666;
 }
 
+.fl-footer-completed, .fl-footer-error { 
+    
+}
+
 .fl-footer-completed {
     background-image: url('../images/progress/gradient-total-green.png');
     background-attachment: scroll;
@@ -383,7 +387,7 @@
 
 /* PROGRESS */
 
-.file-progress, .total-progress {
+.file-progress, .fl-uploader-totalProgress-complete, .fl-uploader-totalProgress-errored {
     position: absolute;
     display: none;
     background-attachment: scroll;
@@ -405,15 +409,26 @@
     display: none;
 }
 
-.total-progress {
+.fl-uploader-totalProgress-complete, .fl-uploader-totalProgress-errored {
     top: 0;
     height: 100%;
+    width:76%;
+} 
+
+.fl-uploader-totalProgress-complete {
     background-image: url('../images/progress/gradient-total-green.png');
     border-right: 1px solid #9FCE7F;
     background-color: #BDBFC1;
-    width:76%;
 }
 
+.fl-uploader-totalProgress-errored {
+    background-image: url('../images/progress/gradient-total-yellow.png');
+    border-right: 1px solid #E8C81C;
+    background-color: #F6ECA0;
+}
+
+
+
 /* Hidden SWF for Flash 9*/
 
 .fl-uploader-flash9-container {
