ultimix

- Main Page
- Data Structures
- Files
- Examples

- File List
- Globals

Functions | Variables
fileprogress.js File Reference

Go to the source code of this file.

## Functions
function | FileProgress (file, targetID)

## Variables
FileProgress prototype | setTimer
FileProgress prototype | getTimer
FileProgress prototype | reset
FileProgress prototype | setProgress
FileProgress prototype | setComplete
FileProgress prototype | setError
FileProgress prototype | setCancelled
FileProgress prototype | setStatus
FileProgress prototype | toggleCancel
FileProgress prototype | appear
FileProgress prototype | disappear

## Function Documentation

function FileProgress | ( |  | file,
|  |  | targetID
| ) |  |

Definition at line 11 of file fileprogress.js.

{
this.fileProgressID = file.id;
this.opacity = 100;
this.height = 0;
this.fileProgressWrapper = document.getElementById(this.fileProgressID);
if (!this.fileProgressWrapper) {
this.fileProgressWrapper = document.createElement("div");
this.fileProgressWrapper.className = "progressWrapper";
this.fileProgressWrapper.id = this.fileProgressID;
this.fileProgressElement = document.createElement("div");
this.fileProgressElement.className = "progressContainer";
var progressCancel = document.createElement("a");
progressCancel.className = "progressCancel";
progressCancel.href = "#";
progressCancel.style.visibility = "hidden";
progressCancel.appendChild(document.createTextNode(" "));
var progressText = document.createElement("div");
progressText.className = "progressName";
progressText.appendChild(document.createTextNode(file.name));
var progressBar = document.createElement("div");
progressBar.className = "progressBarInProgress";
var progressStatus = document.createElement("div");
progressStatus.className = "progressBarStatus";
progressStatus.innerHTML = "&nbsp;";
this.fileProgressElement.appendChild(progressCancel);
this.fileProgressElement.appendChild(progressText);
this.fileProgressElement.appendChild(progressStatus);
this.fileProgressElement.appendChild(progressBar);
this.fileProgressWrapper.appendChild(this.fileProgressElement);
document.getElementById(targetID).appendChild(this.fileProgressWrapper);
} else {
this.fileProgressElement = this.fileProgressWrapper.firstChild;
this.reset();
}
this.height = this.fileProgressWrapper.offsetHeight;
this.setTimer(null);
}

## Variable Documentation

FileProgress prototype appear

Initial value:
function () {
if (this.getTimer() !== null) {
clearTimeout(this.getTimer());
this.setTimer(null);
}
if (this.fileProgressWrapper.filters) {
try {
this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity = 100;
} catch (e) {
this.fileProgressWrapper.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=100)";
}
} else {
this.fileProgressWrapper.style.opacity = 1;
}
this.fileProgressWrapper.style.height = "";
this.height = this.fileProgressWrapper.offsetHeight;
this.opacity = 100;
this.fileProgressWrapper.style.display = "";
}

Definition at line 135 of file fileprogress.js.

FileProgress prototype disappear

Definition at line 161 of file fileprogress.js.

FileProgress prototype getTimer

Initial value:
function (timer) {
return this.fileProgressElement["FP_TIMER"] || null;
}

Definition at line 66 of file fileprogress.js.

FileProgress prototype reset

Initial value:
function () {
this.fileProgressElement.className = "progressContainer";
this.fileProgressElement.childNodes[2].innerHTML = "&nbsp;";
this.fileProgressElement.childNodes[2].className = "progressBarStatus";
this.fileProgressElement.childNodes[3].className = "progressBarInProgress";
this.fileProgressElement.childNodes[3].style.width = "0%";
this.appear();
}

Definition at line 70 of file fileprogress.js.

FileProgress prototype setCancelled

Initial value:
function () {
this.fileProgressElement.className = "progressContainer";
this.fileProgressElement.childNodes[3].className = "progressBarError";
this.fileProgressElement.childNodes[3].style.width = "";
var oSelf = this;
this.setTimer(setTimeout(function () {
oSelf.disappear();
}, 2000));
}

Definition at line 109 of file fileprogress.js.

FileProgress prototype setComplete

Initial value:
function () {
this.fileProgressElement.className = "progressContainer blue";
this.fileProgressElement.childNodes[3].className = "progressBarComplete";
this.fileProgressElement.childNodes[3].style.width = "";
var oSelf = this;
this.setTimer(setTimeout(function () {
oSelf.disappear();
}, 10000));
}

Definition at line 89 of file fileprogress.js.

FileProgress prototype setError

Initial value:
function () {
this.fileProgressElement.className = "progressContainer red";
this.fileProgressElement.childNodes[3].className = "progressBarError";
this.fileProgressElement.childNodes[3].style.width = "";
var oSelf = this;
this.setTimer(setTimeout(function () {
oSelf.disappear();
}, 5000));
}

Definition at line 99 of file fileprogress.js.

FileProgress prototype setProgress

Initial value:
function (percentage) {
this.fileProgressElement.className = "progressContainer green";
this.fileProgressElement.childNodes[3].className = "progressBarInProgress";
this.fileProgressElement.childNodes[3].style.width = percentage + "%";
this.appear();
}

Definition at line 82 of file fileprogress.js.

FileProgress prototype setStatus

Initial value:
function (status) {
this.fileProgressElement.childNodes[2].innerHTML = status;
}

Definition at line 119 of file fileprogress.js.

FileProgress prototype setTimer

Initial value:
function (timer) {
this.fileProgressElement["FP_TIMER"] = timer;
}

Definition at line 63 of file fileprogress.js.

FileProgress prototype toggleCancel

Initial value:
function (show, swfUploadInstance) {
this.fileProgressElement.childNodes[0].style.visibility = show ? "visible" : "hidden";
if (swfUploadInstance) {
var fileID = this.fileProgressID;
this.fileProgressElement.childNodes[0].onclick = function () {
swfUploadInstance.cancelUpload(fileID);
return false;
};
}
}

Definition at line 124 of file fileprogress.js.