69 lines
2.4 KiB
HTML
69 lines
2.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
|
<title>RESULT</title>
|
|
</head>
|
|
<body>
|
|
</body>
|
|
<script>
|
|
|
|
$(document).ready(function(){
|
|
|
|
$.get('/get_session', function(response) {
|
|
if(response.hasOwnProperty("image")){
|
|
console.log(response)
|
|
var html_content = `<section>
|
|
<div>
|
|
<h1>Decoded</h1>
|
|
<img src="upload/` + response["image"] + `" alt="Image Not Found">
|
|
</div>
|
|
<div>
|
|
<h1>Secret Text:</h1>
|
|
<p>` + response["payload"] + `</p>
|
|
</div>
|
|
</section>`
|
|
$("body").append(html_content)
|
|
}
|
|
else if(response.hasOwnProperty("wav")){
|
|
var html_content = `<section>
|
|
<h1>Decoded</h1>
|
|
<audio controls>
|
|
<source src="upload/` + response["wav"] + `" type="audio/wav">
|
|
Your browser does not support the audio element.
|
|
</audio>
|
|
<div>
|
|
<h1>Secret Text:</h1>
|
|
<p>` + response["payload"] + `</p>
|
|
</div>
|
|
</section>`
|
|
$("body").append(html_content)
|
|
}
|
|
else if(response.hasOwnProperty("txt")){
|
|
fetch("upload/" + response["txt"])
|
|
.then(res => res.text())
|
|
.then(data => {
|
|
var html_content = `<section>
|
|
<div>
|
|
<h1>Decoded</h1>
|
|
<textarea>` + data + `</textarea>
|
|
</div>
|
|
<div>
|
|
<h1>Secret Text:</h1>
|
|
<p>` + response["payload"] + `</p>
|
|
</div>
|
|
</section>`
|
|
$("body").append(html_content)
|
|
})
|
|
.catch(error => {
|
|
console.error('Error:', error);
|
|
});
|
|
}
|
|
});
|
|
})
|
|
|
|
</script>
|
|
</html> |