2008-07-31 12:03:28 +00: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" />
|
2009-11-23 12:57:16 +00:00
|
|
|
<title>_(Download local torrent)</title>
|
2008-07-31 12:03:28 +00:00
|
|
|
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
2008-09-14 10:14:54 +00:00
|
|
|
<script type="text/javascript" src="scripts/mootools-1.2-core-yc.js" charset="utf-8"></script>
|
2009-03-12 13:24:18 +00:00
|
|
|
<script type="text/javascript">
|
2012-07-01 13:23:41 +03:00
|
|
|
|
2009-12-05 14:19:37 +00:00
|
|
|
function hideAll() {
|
2009-11-23 14:21:07 +00:00
|
|
|
window.parent.closeWindows();
|
2009-03-12 13:24:18 +00:00
|
|
|
}
|
2012-07-01 13:23:41 +03:00
|
|
|
|
|
|
|
function uploadFiles(files) {
|
|
|
|
var xhr = new XMLHttpRequest();
|
|
|
|
if (xhr.upload) {
|
|
|
|
// file received/failed
|
|
|
|
xhr.onreadystatechange = function(e) {
|
|
|
|
if (xhr.readyState == 4) {
|
|
|
|
if (xhr.status == 200)
|
|
|
|
hideAll();
|
|
|
|
else
|
|
|
|
alert("Upload Failed!");
|
|
|
|
}
|
|
|
|
};
|
|
|
|
// start upload
|
|
|
|
var formData = new FormData();
|
|
|
|
for (var i = 0, file; file = files[i]; ++i) {
|
|
|
|
formData.append(file.name, file);
|
|
|
|
}
|
|
|
|
xhr.open("POST", "command/upload", true);
|
|
|
|
xhr.send(formData);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// file selection
|
|
|
|
function fileSelectHandler(e) {
|
|
|
|
// fetch FileList object
|
|
|
|
var files = e.target.files || e.dataTransfer.files;
|
|
|
|
// process all File objects
|
|
|
|
uploadFiles(files);
|
|
|
|
}
|
|
|
|
|
|
|
|
window.addEvent('load', function() {
|
|
|
|
$('fileselect').addEvent('change', fileSelectHandler);
|
|
|
|
// is XHR2 available?
|
|
|
|
var xhr = new XMLHttpRequest();
|
|
|
|
if (xhr.upload) {
|
|
|
|
$('submitbutton').addClass("invisible");
|
|
|
|
}
|
|
|
|
});
|
2009-03-12 13:24:18 +00:00
|
|
|
</script>
|
2008-07-31 12:03:28 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
2012-07-01 13:23:41 +03:00
|
|
|
<br/>
|
2011-10-02 10:22:41 +03:00
|
|
|
<iframe id="upload_frame" name="upload_frame" style="width:1px;height:1px;border:0px;" src="javascript:false;"></iframe>
|
2012-06-10 20:15:57 +03:00
|
|
|
<form action="command/upload" enctype="multipart/form-data" method="post" id="uploadForm" target="upload_frame">
|
2012-07-01 13:23:41 +03:00
|
|
|
<input type="file" id="fileselect" name="fileselect[]" multiple="multiple" /><br/>
|
|
|
|
<div id="submitbutton">
|
|
|
|
<button type="submit">_(Upload Torrents)</button>
|
|
|
|
</div
|
2011-10-02 10:22:41 +03:00
|
|
|
</form>
|
2008-07-31 12:03:28 +00:00
|
|
|
</body>
|
|
|
|
</html>
|