forked from leo-editor/leo-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathload-leo.html
151 lines (75 loc) · 1.98 KB
/
load-leo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script type="text/javascript" src="scripts/upclick-min.js"></script>
<script type="text/javascript" src="scripts/jquery.min.js"></script>
<title>Load Your Leo File</title>
</head>
<body>
<form name="form1">
<input type="button" id="uploader" value="Upload From Your Hard Drive">
</form>
<p style="margin:0;font-size:1em;"> </p>
Or
<p style="margin:0;font-size:1em;"> </p>
<form id="form2">
Upload from the Internet.<br>Enter the URL below.<br>
<input style="width:600px;" type="text" id="get_name"><br> <br>
<input type="button" value="Upload From the Internet" onClick="loader();">
</form>
<div style="margin:0 auto;text-align:left;" id="leo-data">
</div>
<script type="text/javascript">
var a_meg = 1048576;
var script_name = "do-leo.php";
var leo_div = document.getElementById('leo-data');
var name_element = document.getElementById('get_name')
var uploader = document.getElementById('uploader');
var do_return = function (data)
{
var is_leo = data.split("-");
if (!(is_leo[0] == "show"))
{
leo_div.innerHTML = data;
return;
}
if (!(is_leo[1] == "leo"))
{
leo_div.innerHTML = data;
return;
}
document.location = "./tmp/" + data;
};
var loader = function()
{
//alert(xget_name);
var xget_name = name_element.value
var res = $.post( script_name, {get_name: xget_name});
res.done(function(data)
{
//document.getElementById('leo-data').innerHTML = data;
do_return(data);
});
};
upclick(
{
element: uploader,
action: script_name,
maxsize: 20 * a_meg, // max allowed file size, in bytes
onstart: function(filename)
{
//alert('Start upload: '+filename);
var x = 2;
},
oncomplete:
function(data)
{
do_return(data);
}
});
</script>
<script type="text/javascript">
</script>
</body>
</html>