2008-07-31 16:03:28 +04:00
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
2014-12-17 14:58:32 +03:00
|
|
|
<title>QBT_TR(Download local torrent)QBT_TR</title>
|
2008-07-31 16:03:28 +04:00
|
|
|
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
2014-11-08 17:00:00 +03:00
|
|
|
<link rel="stylesheet" href="css/Window.css" type="text/css" />
|
2008-09-14 14:14:54 +04:00
|
|
|
<script type="text/javascript" src="scripts/mootools-1.2-core-yc.js" charset="utf-8"></script>
|
2009-03-12 16:24:18 +03:00
|
|
|
<script type="text/javascript">
|
2012-07-01 14:23:41 +04:00
|
|
|
|
2012-09-02 22:41:11 +04:00
|
|
|
function stateChangeHandler() {
|
|
|
|
if (this.readyState == this.DONE) {
|
2014-11-05 19:45:31 +03:00
|
|
|
if (this.status == 200) {
|
2012-09-02 22:41:11 +04:00
|
|
|
window.parent.closeWindows();
|
2014-11-05 19:45:31 +03:00
|
|
|
} else {
|
|
|
|
if (this.responseText != "") {
|
|
|
|
alert(this.responseText);
|
|
|
|
} else {
|
2014-12-17 14:58:32 +03:00
|
|
|
alert("QBT_TR(Upload Failed!)QBT_TR");
|
2014-11-05 19:45:31 +03:00
|
|
|
}
|
|
|
|
}
|
2014-11-08 17:00:00 +03:00
|
|
|
$('upload_spinner').style.display = "none";
|
2012-09-02 22:41:11 +04:00
|
|
|
}
|
2009-03-12 16:24:18 +03:00
|
|
|
}
|
2012-07-01 14:23:41 +04:00
|
|
|
|
|
|
|
function uploadFiles(files) {
|
|
|
|
var xhr = new XMLHttpRequest();
|
|
|
|
if (xhr.upload) {
|
|
|
|
// start upload
|
|
|
|
var formData = new FormData();
|
2012-09-02 22:41:11 +04:00
|
|
|
for (var i = 0, file; file = files[i]; ++i)
|
|
|
|
formData.append(file.name, file);
|
|
|
|
xhr.onreadystatechange = stateChangeHandler;
|
|
|
|
xhr.open("POST", "command/upload");
|
|
|
|
// Bypass cache
|
|
|
|
xhr.setRequestHeader("Cache-Control", "no-cache");
|
2012-07-01 14:23:41 +04:00
|
|
|
xhr.send(formData);
|
|
|
|
}
|
|
|
|
}
|
2012-09-02 22:41:11 +04:00
|
|
|
|
2014-11-08 17:00:00 +03:00
|
|
|
function fileHandler(e) {
|
|
|
|
e.preventDefault();
|
2014-11-08 17:00:00 +03:00
|
|
|
$('upload_spinner').style.display = "block";
|
2012-07-01 14:23:41 +04:00
|
|
|
// fetch FileList object
|
2014-11-08 17:00:00 +03:00
|
|
|
var files = $('fileselect').files
|
2012-07-01 14:23:41 +04:00
|
|
|
// process all File objects
|
|
|
|
uploadFiles(files);
|
|
|
|
}
|
|
|
|
|
|
|
|
window.addEvent('load', function() {
|
2014-11-08 17:00:00 +03:00
|
|
|
// is XHR2 available?
|
2012-07-01 14:23:41 +04:00
|
|
|
var xhr = new XMLHttpRequest();
|
2014-11-08 17:00:00 +03:00
|
|
|
if (xhr.upload) {
|
|
|
|
$('uploadForm').addEvent('submit', fileHandler);
|
|
|
|
} else {
|
|
|
|
$('upload_frame').addEvent('load', function() { window.parent.closeWindows(); });
|
2014-11-08 17:00:00 +03:00
|
|
|
$('uploadForm').addEvent('submit', function() { $('upload_spinner').style.display = "block"; });
|
2014-11-08 17:00:00 +03:00
|
|
|
}
|
2012-07-01 14:23:41 +04:00
|
|
|
});
|
2009-03-12 16:24:18 +03:00
|
|
|
</script>
|
2008-07-31 16:03:28 +04:00
|
|
|
</head>
|
|
|
|
<body>
|
2014-11-08 17:00:00 +03:00
|
|
|
<iframe id="upload_frame" name="upload_frame" class="invisible" src="javascript:false;"></iframe>
|
|
|
|
<form action="command/upload" enctype="multipart/form-data" method="post" id="uploadForm" target="upload_frame" style="text-align: center;">
|
|
|
|
<div style="margin-top: 25px; display: inline-block; border: 1px solid lightgrey; border-radius: 4px;">
|
|
|
|
<input type="file" id="fileselect" name="fileselect[]" multiple="multiple" />
|
|
|
|
</div>
|
|
|
|
<div id="submitbutton" style="margin-top: 30px;">
|
2014-12-17 14:58:32 +03:00
|
|
|
<button type="submit" style="font-size: 1em;">QBT_TR(Upload Torrents)QBT_TR</button>
|
2014-11-07 15:53:11 +03:00
|
|
|
</div>
|
2011-10-02 11:22:41 +04:00
|
|
|
</form>
|
2014-11-08 17:00:00 +03:00
|
|
|
<div id="upload_spinner" class="mochaSpinner"></div>
|
2008-07-31 16:03:28 +04:00
|
|
|
</body>
|
|
|
|
</html>
|