-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
128 lines (102 loc) · 3.55 KB
/
index.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<html>
<head>
<script src="./jquery-1.11.2.min.js"></script>
<script src="./moment.js"></script>
<script>
moment().format();
</script>
<script>
window.onload = function() {
//Check File API support
if (window.File && window.FileList && window.FileReader) {
var filesInput = document.getElementById("files");
filesInput.addEventListener("change", function(event) {
var files = event.target.files; //FileList object
var output = document.getElementById("result");
for (var i = 0; i < files.length; i++) {
var file = files[i];
//Only plain text
if (!file.type.match('plain')) continue;
var picReader = new FileReader();
picReader.addEventListener("load", function(event) {
var textFile = event.target;
var div = document.createElement("div");
div.id = "textDIV";
//$("#textDIV").empty();
$("#output1").empty();
$("#output2").empty();
$("#output3").empty();
div.innerText = textFile.result;
output.insertBefore(div, null);
});
//Read the text file
picReader.readAsText(file);
}
});
}
else {
console.log("Your browser does not support File API");
}
}
</script>
<script src="./agendamanager.js"></script>
<style type="text/css">
body{
font-family: 'Segoe UI';
font-size: 12pt;
}
header h1{
font-size:12pt;
color: #fff;
background-color: #1BA1E2;
padding: 20px;
}
article
{
width: 80%;
margin:auto;
margin-top:10px;
}
input[type='file']{
margin:10px;
}
</style>
</head>
<header>
<h1>Agenda Manager - TTU Analysis of Algorithms</h1>
<h5 style="padding-left: 10px;">Programmed by Carlos Alban</h5>
</header>
<body>
<article>
<p><strong>Instructions:</strong> <br>1. Select a .txt file. <br>2. Click on the go button to start. <br>3. Scroll down to see results.<br></p>
</article>
<article>
<p>You may create your own .txt file or use one of these samples: <a href="./test1.txt" download>test1.txt</a>, <a href="./test2.txt" download>test2.txt</a>, <a href="./test3.txt" download>test3.txt</a></p>
<p><i>Note: Data must be in format (x,y) where x is a string representing a rule and y is an integer representing the priority. Each cycle is defined by a new line.</i></p>
<label for="files">Select a file : </label>
<input id="files" type="file" />
<br>
<button type="button" id="go" style="padding:15px 25px 15px 25px; margin-bottom:15px">GO!</button>
<button type="button" id="reset" style="padding:15px 25px 15px 25px; margin-bottom:15px">RESET</button>
<br>
<output id="result" />
</article>
<table align="center">
<hr>
<tr>
<td style="vertical-align: top">
<div id="output1" style="margin-left: 10px">
</div>
</td>
<td style="vertical-align: top">
<div id="output2" style="margin-left: 10px">
</div>
</td>
<td style="vertical-align: top">
<div id="output3" style="margin-left: 10px">
</div>
</td>
</tr>
</table>
</body>
</html>