Author: andrei_exadel
Date: 2009-03-26 10:04:39 -0400 (Thu, 26 Mar 2009)
New Revision: 13214
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/fileUpload/fileUploader.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/fileUpload/uploadResult.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/scripts/realworld.js
Log:
ProgressBar for uploader
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/fileUpload/fileUploader.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/fileUpload/uploadResult.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/scripts/realworld.js
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/scripts/realworld.js 2009-03-26
13:32:06 UTC (rev 13213)
+++ trunk/test-applications/realworld2/web/src/main/webapp/scripts/realworld.js 2009-03-26
14:04:39 UTC (rev 13214)
@@ -60,4 +60,18 @@
}
target.value += tag;
}
+}
+
+function updateUploadProgressBarLabel (progressBar, fileUpload) {
+ var c = fileUpload.entries.length;
+ var uploaded = 0;
+ for (var i=0;i<c;i++) {
+ if (fileUpload.entries[i].state == FileUploadEntry.UPLOAD_SUCCESS) {
+ uploaded++;
+ }
+ }
+
+ var value = (c >0) ? 100 * uploaded / c : 0;
+ progressBar.setValue(value);
+ progressBar.setLabel(uploaded + '/' + c + ' completed');
}
\ No newline at end of file