12 this.fileProgressID = file.id;
18 this.fileProgressWrapper = document.getElementById(this.fileProgressID);
19 if (!this.fileProgressWrapper) {
20 this.fileProgressWrapper = document.createElement(
"div");
21 this.fileProgressWrapper.className =
"progressWrapper";
22 this.fileProgressWrapper.id = this.fileProgressID;
24 this.fileProgressElement = document.createElement(
"div");
25 this.fileProgressElement.className =
"progressContainer";
27 var progressCancel = document.createElement(
"a");
28 progressCancel.className =
"progressCancel";
29 progressCancel.href =
"#";
30 progressCancel.style.visibility =
"hidden";
31 progressCancel.appendChild(document.createTextNode(
" "));
33 var progressText = document.createElement(
"div");
34 progressText.className =
"progressName";
35 progressText.appendChild(document.createTextNode(file.name));
37 var progressBar = document.createElement(
"div");
38 progressBar.className =
"progressBarInProgress";
40 var progressStatus = document.createElement(
"div");
41 progressStatus.className =
"progressBarStatus";
42 progressStatus.innerHTML =
" ";
44 this.fileProgressElement.appendChild(progressCancel);
45 this.fileProgressElement.appendChild(progressText);
46 this.fileProgressElement.appendChild(progressStatus);
47 this.fileProgressElement.appendChild(progressBar);
49 this.fileProgressWrapper.appendChild(this.fileProgressElement);
51 document.getElementById(targetID).appendChild(this.fileProgressWrapper);
53 this.fileProgressElement = this.fileProgressWrapper.firstChild;
57 this.height = this.fileProgressWrapper.offsetHeight;
64 this.fileProgressElement[
"FP_TIMER"] = timer;
67 return this.fileProgressElement[
"FP_TIMER"] || null;
71 this.fileProgressElement.className =
"progressContainer";
73 this.fileProgressElement.childNodes[2].innerHTML =
" ";
74 this.fileProgressElement.childNodes[2].className =
"progressBarStatus";
76 this.fileProgressElement.childNodes[3].className =
"progressBarInProgress";
77 this.fileProgressElement.childNodes[3].style.width =
"0%";
83 this.fileProgressElement.className =
"progressContainer green";
84 this.fileProgressElement.childNodes[3].className =
"progressBarInProgress";
85 this.fileProgressElement.childNodes[3].style.width = percentage +
"%";
90 this.fileProgressElement.className =
"progressContainer blue";
91 this.fileProgressElement.childNodes[3].className =
"progressBarComplete";
92 this.fileProgressElement.childNodes[3].style.width =
"";
95 this.
setTimer(setTimeout(
function () {
100 this.fileProgressElement.className =
"progressContainer red";
101 this.fileProgressElement.childNodes[3].className =
"progressBarError";
102 this.fileProgressElement.childNodes[3].style.width =
"";
105 this.
setTimer(setTimeout(
function () {
110 this.fileProgressElement.className =
"progressContainer";
111 this.fileProgressElement.childNodes[3].className =
"progressBarError";
112 this.fileProgressElement.childNodes[3].style.width =
"";
115 this.
setTimer(setTimeout(
function () {
120 this.fileProgressElement.childNodes[2].innerHTML = status;
124 FileProgress.prototype.toggleCancel =
function (show, swfUploadInstance) {
125 this.fileProgressElement.childNodes[0].style.visibility = show ?
"visible" :
"hidden";
126 if (swfUploadInstance) {
127 var fileID = this.fileProgressID;
128 this.fileProgressElement.childNodes[0].onclick =
function () {
129 swfUploadInstance.cancelUpload(fileID);
141 if (this.fileProgressWrapper.filters) {
143 this.fileProgressWrapper.filters.item(
"DXImageTransform.Microsoft.Alpha").opacity = 100;
146 this.fileProgressWrapper.style.filter =
"progid:DXImageTransform.Microsoft.Alpha(opacity=100)";
149 this.fileProgressWrapper.style.opacity = 1;
152 this.fileProgressWrapper.style.height =
"";
154 this.height = this.fileProgressWrapper.offsetHeight;
156 this.fileProgressWrapper.style.display =
"";
163 var reduceOpacityBy = 15;
164 var reduceHeightBy = 4;
167 if (this.opacity > 0) {
168 this.opacity -= reduceOpacityBy;
169 if (this.opacity < 0) {
173 if (this.fileProgressWrapper.filters) {
175 this.fileProgressWrapper.filters.item(
"DXImageTransform.Microsoft.Alpha").opacity = this.opacity;
178 this.fileProgressWrapper.style.filter =
"progid:DXImageTransform.Microsoft.Alpha(opacity=" + this.opacity +
")";
181 this.fileProgressWrapper.style.opacity = this.opacity / 100;
185 if (this.height > 0) {
186 this.height -= reduceHeightBy;
187 if (this.height < 0) {
191 this.fileProgressWrapper.style.height = this.height +
"px";
194 if (this.height > 0 || this.opacity > 0) {
196 this.
setTimer(setTimeout(
function () {
200 this.fileProgressWrapper.style.display =
"none";