-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
94 lines (79 loc) · 2.57 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
<!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<title>TapSearch</title>
<link rel="stylesheet" type="text/css" href="style.css" id="jsbin-css">
</head>
<body>
<article>
<header>
<h1><u>TapSearch</u></h1>
</header>
</article>
<script type="text/javascript" src="solve.js"></script>
<script type="text/javascript" src = "upl.js"></script>
<div>
<label for="input-file">Specify a file:</label><br>
<input type="file" id="input-file">
</div>
<textarea id="content-target"></textarea>
<div id = "enter">
<fieldset>
<legend>Enter Text</legend>
<textarea id = "txt" >
Enter The text here !
pls give /n/n for a paragraph change
</textarea>
<p>Click on Send to load the data</p>
<button type = "button" onclick = "search_input()">Send</button>
<button type = "button" onclick = "clear_all()">Clear</button>
</fieldset>
<p id = "demo"></p>
</div>
<div id = "search">
<fieldset>
<legend>Search a Word</legend>
<input id = "text1" placeholder = "Enter the word to search !" size = "30">
<br>
<p>Click on search to see matches</p>
<button type = "button" onclick = "search_output()">search</button>
</fieldset>
<p>Found on Paragraphs</p>
<p id = "maps" > </p>
</div>
<script>
document.getElementById('input-file')
.addEventListener('change', getFile)
function getFile(event) {
const input = event.target
if ('files' in input && input.files.length > 0) {
placeFileContent(
document.getElementById('content-target'),
input.files[0])
}
}
function placeFileContent(target, file) {
readFileContent(file).then(content => {
target.value = content
}).catch(error => console.log(error))
}
function readFileContent(file) {
const reader = new FileReader()
return new Promise((resolve, reject) => {
reader.onload = event => resolve(event.target.result)
reader.onerror = error => reject(error)
reader.readAsText(file)
})
}
</script>
<div id = "low" class = "jumbotron">
<footer>
<p><i>@created by Sutirtha Rej____24 Nov 2019</i></p>
<br>
<a href="https://github.com/ricksr/tapsearch">Git Repo</a>
</footer>
</div>
</body>
</html>