Index: branches/RC/core/admin_templates/js/uploader.js
===================================================================
diff -u -r8929 -r9334
--- branches/RC/core/admin_templates/js/uploader.js (.../uploader.js) (revision 8929)
+++ branches/RC/core/admin_templates/js/uploader.js (.../uploader.js) (revision 9334)
@@ -15,13 +15,15 @@
{
var holder = document.createElement('DIV');
document.body.appendChild(holder);
-
+
+ document.getElementById($form_name).style.display = 'block';
+
// moving out progress div to overcome loosing of flash object after setting opacity
-
this.div = document.getElementById(this.id+'_progress');
var clone = this.div.cloneNode(true);
this.div.parentNode.removeChild(this.div)
this.div = document.body.appendChild(clone);
+ this.IconPath = this.params.IconPath ? this.params.IconPath : '../cmseditor/editor/images';
this.filename = document.getElementById(this.id+'_progress_filename');
this.progress = document.getElementById(this.id+'_progress_progress');
@@ -37,38 +39,38 @@
this.swf.setAttribute('style', '');
this.swf.addVariable("uploadScript", '');
this.swf.addVariable("maxFiles", escape(this.params.multiple));
- this.swf.addVariable("allowedFilesize", escape(this.params.allowedFilesize));
- this.swf.addVariable("allowedFiletypes", escape(this.params.allowedFiletypes));
- this.swf.addVariable("allowedFiletypesDescription", escape(this.params.allowedFiletypesDescription));
+ this.swf.addVariable("allowedFilesize", escape(this.params.allowedFilesize));
+ this.swf.addVariable("allowedFiletypes", escape(this.params.allowedFiletypes));
+ this.swf.addVariable("allowedFiletypesDescription", escape(this.params.allowedFiletypesDescription));
- this.swf.addVariable("uploadFileQueuedCallback", escape('UploadsManager.FileSelected'));
- this.swf.addVariable("uploadFileStartCallback", escape('UploadsManager.UploadFileStart'));
- this.swf.addVariable("uploadProgressCallback", escape('UploadsManager.UploadProgress'));
- this.swf.addVariable("uploadFileCompleteCallback", escape('UploadsManager.UploadFileComplete'));
- this.swf.addVariable("uploadFileCancelCallback", escape('UploadsManager.FileCancelled'));
- this.swf.addVariable("uploadQueueCompleteCallback", escape('UploadsManager.UploadQueueComplete'));
- this.swf.addVariable("uploadFileErrorCallback", escape('UploadsManager.UploadError'));
- this.swf.addVariable("autoUpload", escape('false'));
-// this.swf.addVariable("flashLoadedCallback", 'flashLoadedCallback');
+ this.swf.addVariable("uploadFileQueuedCallback", escape('UploadsManager.FileSelected'));
+ this.swf.addVariable("uploadFileStartCallback", escape('UploadsManager.UploadFileStart'));
+ this.swf.addVariable("uploadProgressCallback", escape('UploadsManager.UploadProgress'));
+ this.swf.addVariable("uploadFileCompleteCallback", escape('UploadsManager.UploadFileComplete'));
+ this.swf.addVariable("uploadFileCancelCallback", escape('UploadsManager.FileCancelled'));
+ this.swf.addVariable("uploadQueueCompleteCallback", escape('UploadsManager.UploadQueueComplete'));
+ this.swf.addVariable("uploadFileErrorCallback", escape('UploadsManager.UploadError'));
+ this.swf.addVariable("autoUpload", escape('false'));
+// this.swf.addVariable("flashLoadedCallback", 'flashLoadedCallback');
- this.swf.addVariable("uploadScriptCallback", escape('UploadsManager.GetUploadScript'));
- this.swf.addVariable("uploaderId", escape(this.id));
+ this.swf.addVariable("uploadScriptCallback", escape('UploadsManager.GetUploadScript'));
+ this.swf.addVariable("uploaderId", escape(this.id));
this.swf.write(holder);
- this.flash = document.getElementById(this.flash_id);
- /*if (this.flash != null) {
- if(this.flash.PercentLoaded() == 100) {
- alert('done movie: '+this.flash.PercentLoaded());
- }
+ this.flash = document.getElementById(this.flash_id);
+/* if (this.flash != null) {
+ if(this.flash.PercentLoaded() == 100) {
+ alert('done movie: '+this.flash.PercentLoaded());
+ }
}
else {
alert('this.flash is null')
}*/
if (this.params.urls != '') {
- var urls = this.params.urls.split('|');
- var names = this.params.names.split('|');
- var sizes = this.params.sizes.split('|');
- for (var i in urls) {
+ var urls = this.params.urls.split('|');
+ var names = this.params.names.split('|');
+ var sizes = this.params.sizes.split('|');
+ for (var i in urls) {
var a_file = {
id : names[i],
name : names[i],
@@ -78,9 +80,9 @@
}
this.files.push(a_file)
this.files_count++;
- }
- this.UpdateInfo();
- }
+ }
+ this.UpdateInfo();
+ }
}
Uploader.prototype.UpdateInfo = function()
@@ -90,7 +92,7 @@
this.files[f].name.match(/\.([^.]*)$/);
var ext = RegExp.$1;
var icon = ext.match(/^(ai|avi|bmp|cs|dll|doc|dot|exe|fla|gif|htm|html|jpg|js|mdb|mp3|pdf|ppt|rdp|swf|swt|txt|vsd|xls|xml|zip)$/) ? ext : 'default.icon';
- o += '
';
+ o += '
';
if (isset(this.files[f].uploaded)) {
o += ''+this.files[f].name + ' ('+this.FormatSize(this.files[f].size)+') [Delete]
';
}
@@ -225,7 +227,6 @@
Uploader.prototype.UploadProgress = function(file, bytesLoaded)
{
this.cur_file_uploaded = bytesLoaded;
-
var uploaded = this.uploaded+this.cur_file_uploaded;
this.ProgressTime = this.GetMicroTime() - this.StartTime;
@@ -337,6 +338,7 @@
UploadsManager.UploadError = function(errno, file, msg)
{
this.Uploaders[file.uploader_id].RemoveFile(file);
+
if (errno == -10) {
switch (msg.toString()) {
case '403':