Author: konstantin.mishin
Date: 2010-12-03 09:30:15 -0500 (Fri, 03 Dec 2010)
New Revision: 20356
Modified:
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js
Log:
RF-9496
Modified:
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js
===================================================================
---
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js 2010-12-03
14:29:57 UTC (rev 20355)
+++
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js 2010-12-03
14:30:15 UTC (rev 20356)
@@ -31,9 +31,9 @@
NEW: "new",
UPLOADING: "uploading",
DONE: "done",
- SIZE_EXCEEDED: "size_exceeded",
+ SIZE_EXCEEDED: "sizeExceeded",
STOPPED: "stopped",
- SERVER_ERROR: "server_error"
+ SERVER_ERROR: "serverError"
};
var pressButton = function(event) {
@@ -51,9 +51,15 @@
name: "FileUpload",
items: [],
-
submitedItems: [],
+ doneLabel: "Done",
+ sizeExceededLabel: "File size is exceeded",
+ stoppedLabel: "",
+ serverErrorLabel: "Server error",
+ clearLabel: "Clear",
+ deleteLabel: "Delete",
+
init: function(id, options) {
this.id = id;
jQuery.extend(this, options);
@@ -179,12 +185,12 @@
this.loadableItem = null;
this.__updateButtons();
var items = [];
+ for (var i in this.submitedItems) {
+ items.push(this.submitedItems[i].model);
+ }
for (var i in this.items) {
items.push(this.items[i].model);
}
- for (var i in this.submitedItems) {
- items.push(this.submitedItems[i].model);
- }
richfaces.Event.fire(this.element, "onuploadcomplete", items);
}
}
@@ -227,7 +233,7 @@
this.state = this.label.nextAll(".rf-fu-itm-st:first");
this.link = leftArea.next().children("a");
this.label.html(this.model.name);
- this.link.html("Delete");
+ this.link.html(this.fileUpload["deleteLabel"]);
this.link.click(jQuery.proxy(this.removeOrStop, this));
return this.element;
},
@@ -260,8 +266,8 @@
this.fileUpload.hiddenContainer.append(this.fileUpload.progressBarElement.detach());
}
this.input.remove();
- this.state.html(state == ITEM_STATE.DONE ? "Done" : "File size
exceeded");
- this.link.html("Clear");
+ this.state.html(this.fileUpload[state + "Label"]);
+ this.link.html(this.fileUpload["clearLabel"]);
this.model.state = state;
}
});
Show replies by date