Download Button Added
This commit is contained in:
parent
129ecce981
commit
88acf38da4
|
@ -20,7 +20,8 @@
|
||||||
var html_content = `<section style="margin: 100px auto; width:50%; height:50%; text-align:center;">
|
var html_content = `<section style="margin: 100px auto; width:50%; height:50%; text-align:center;">
|
||||||
<div style="width:100%; height:100%; text-align:center;">
|
<div style="width:100%; height:100%; text-align:center;">
|
||||||
<h1 style="height:15%; width:90%; padding: 5%">Decoded</h1>
|
<h1 style="height:15%; width:90%; padding: 5%">Decoded</h1>
|
||||||
<img src="upload/` + response["image"] + `" alt="Image Not Found">
|
<img src="upload/` + response["image"] + `" alt="Image Not Found" class="result_box">
|
||||||
|
<a href="upload/` + response["image"] + `" class="result_box_download" download >Download Image</a>
|
||||||
</div>
|
</div>
|
||||||
<div style="width:100%; height:100%; text-align:center;">
|
<div style="width:100%; height:100%; text-align:center;">
|
||||||
<h1 style="height:15%; width:90%; padding: 5%">Secret Text:</h1>
|
<h1 style="height:15%; width:90%; padding: 5%">Secret Text:</h1>
|
||||||
|
@ -36,6 +37,7 @@
|
||||||
<source src="upload/` + response["wav"] + `" type="audio/wav">
|
<source src="upload/` + response["wav"] + `" type="audio/wav">
|
||||||
Your browser does not support the audio element.
|
Your browser does not support the audio element.
|
||||||
</audio>
|
</audio>
|
||||||
|
<a href="upload/` + response["wav"] + `" download>Download Audio</a>
|
||||||
<div>
|
<div>
|
||||||
<h1 style="height:15%; width:90%; padding: 5%">Secret Text:</h1>
|
<h1 style="height:15%; width:90%; padding: 5%">Secret Text:</h1>
|
||||||
<p style="color: red">` + response["payload"] + `</p>
|
<p style="color: red">` + response["payload"] + `</p>
|
||||||
|
@ -50,6 +52,7 @@
|
||||||
<source src="upload/` + response["mp3"] + `" type="audio/wav">
|
<source src="upload/` + response["mp3"] + `" type="audio/wav">
|
||||||
Your browser does not support the audio element.
|
Your browser does not support the audio element.
|
||||||
</audio>
|
</audio>
|
||||||
|
<a href="upload/` + response["mp3"] + `" download>Download Audio</a>
|
||||||
<div>
|
<div>
|
||||||
<h1 style="height:15%; width:90%; padding: 5%">Secret Text:</h1>
|
<h1 style="height:15%; width:90%; padding: 5%">Secret Text:</h1>
|
||||||
<p style="color: red">` + response["payload"] + `</p>
|
<p style="color: red">` + response["payload"] + `</p>
|
||||||
|
@ -63,6 +66,7 @@
|
||||||
<video style="width: 100%" src="upload/` + response["mp4"] + `" controls autoplay>
|
<video style="width: 100%" src="upload/` + response["mp4"] + `" controls autoplay>
|
||||||
Sorry, your browser doesn't support embedded videos.
|
Sorry, your browser doesn't support embedded videos.
|
||||||
</video>
|
</video>
|
||||||
|
<a href="upload/` + response["mp4"] + `" download>Download Video</a>
|
||||||
<div>
|
<div>
|
||||||
<h1 style="height:15%; width:90%; padding: 5%">Secret Text:</h1>
|
<h1 style="height:15%; width:90%; padding: 5%">Secret Text:</h1>
|
||||||
<p style="color: red">` + response["payload"] + `</p>
|
<p style="color: red">` + response["payload"] + `</p>
|
||||||
|
@ -78,6 +82,7 @@
|
||||||
<div style="width:100%; height:100%; text-align:center;">
|
<div style="width:100%; height:100%; text-align:center;">
|
||||||
<h1 style="height:15%; width:90%; padding: 5%">Decoded</h1>
|
<h1 style="height:15%; width:90%; padding: 5%">Decoded</h1>
|
||||||
<textarea style="height:75%; width:90%; padding: 5%">` + data + `</textarea>
|
<textarea style="height:75%; width:90%; padding: 5%">` + data + `</textarea>
|
||||||
|
<a href="upload/` + response["txt"] + `" download>Download Text File</a>
|
||||||
</div>
|
</div>
|
||||||
<div style="width:100%; height:100%; text-align:center;">
|
<div style="width:100%; height:100%; text-align:center;">
|
||||||
<h1 style="height:15%; width:90%; padding: 5%">Secret Text:</h1>
|
<h1 style="height:15%; width:90%; padding: 5%">Secret Text:</h1>
|
||||||
|
@ -101,6 +106,11 @@
|
||||||
$("body").append(html_content)
|
$("body").append(html_content)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(".result_box").on("click", function(){
|
||||||
|
|
||||||
|
$(".result_box_download").click()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -28,14 +28,18 @@
|
||||||
$.get('/get_session', function(response) {
|
$.get('/get_session', function(response) {
|
||||||
console.log(response)
|
console.log(response)
|
||||||
if(response.hasOwnProperty("image")){
|
if(response.hasOwnProperty("image")){
|
||||||
var html_content = `<section style="margin: 100px auto; width:50%; height:50%; display: flex; justify-content: space-between;">
|
var html_content = `<section style="margin: 100px auto; width:50%; height:55%; display: flex; justify-content: space-between;">
|
||||||
<div style="border: 1px solid black; width:100%; height:100%; text-align:center;">
|
<div style="border: 1px solid black; width:100%; height:100%; text-align:center;">
|
||||||
<h1 style="height:15%; width:90%; padding: 5%">Original</h1>
|
<h1 style="height:15%; width:90%; padding: 5%">Original</h1>
|
||||||
<img src="upload/` + response["image"] + `" alt="Image Not Found">
|
<img src="upload/` + response["image"] + `" alt="Image Not Found" class="result_box">
|
||||||
|
<br>
|
||||||
|
<a href="upload/` + response["image"] + `" download rel="nofollow" class="result_box_download">Download Image</a>
|
||||||
</div>
|
</div>
|
||||||
<div style="border: 1px solid black; width:100%; height:100%; text-align:center;">
|
<div style="border: 1px solid black; width:100%; height:100%; text-align:center;">
|
||||||
<h1 style="height:15%; width:90%; padding: 5%">Encoded</h1>
|
<h1 style="height:15%; width:90%; padding: 5%">Encoded</h1>
|
||||||
<img src="upload/` + response["image2"] + `" alt="Image Not Found">
|
<img src="upload/` + response["image2"] + `" alt="Image Not Found" class="result_box">
|
||||||
|
<br>
|
||||||
|
<a href="upload/` + response["image2"] + `" download rel="nofollow" class="result_box_download">Download Image</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</section>`
|
</section>`
|
||||||
|
@ -49,6 +53,8 @@
|
||||||
<source src="upload/` + response["wav"] + `" type="audio/wav">
|
<source src="upload/` + response["wav"] + `" type="audio/wav">
|
||||||
Your browser does not support the audio element.
|
Your browser does not support the audio element.
|
||||||
</audio>
|
</audio>
|
||||||
|
<br>
|
||||||
|
<a href="upload/` + response["wav"] + `" download rel="nofollow">Download Audio</a>
|
||||||
</div>
|
</div>
|
||||||
<div style="border: 1px solid black; width:100%; height:100%; text-align:center;">
|
<div style="border: 1px solid black; width:100%; height:100%; text-align:center;">
|
||||||
<h1 style="height:15%; width:90%; padding: 5%">Encoded</h1>
|
<h1 style="height:15%; width:90%; padding: 5%">Encoded</h1>
|
||||||
|
@ -56,6 +62,8 @@
|
||||||
<source src="upload/` + response["wav2"] + `" type="audio/wav">
|
<source src="upload/` + response["wav2"] + `" type="audio/wav">
|
||||||
Your browser does not support the audio element.
|
Your browser does not support the audio element.
|
||||||
</audio>
|
</audio>
|
||||||
|
<br>
|
||||||
|
<a href="upload/` + response["wav2"] + `" download rel="nofollow">Download Audio</a>
|
||||||
</div>
|
</div>
|
||||||
</section>`
|
</section>`
|
||||||
$("body").append(html_content)
|
$("body").append(html_content)
|
||||||
|
@ -68,6 +76,8 @@
|
||||||
<source src="upload/` + response["mp3"] + `" type="audio/wav">
|
<source src="upload/` + response["mp3"] + `" type="audio/wav">
|
||||||
Your browser does not support the audio element.
|
Your browser does not support the audio element.
|
||||||
</audio>
|
</audio>
|
||||||
|
<br>
|
||||||
|
<a href="upload/` + response["mp3"] + `" download rel="nofollow">Download Audio</a>
|
||||||
</div>
|
</div>
|
||||||
<div style="border: 1px solid black; width:100%; height:100%; text-align:center;">
|
<div style="border: 1px solid black; width:100%; height:100%; text-align:center;">
|
||||||
<h1 style="height:15%; width:90%; padding: 5%">Encoded</h1>
|
<h1 style="height:15%; width:90%; padding: 5%">Encoded</h1>
|
||||||
|
@ -75,6 +85,8 @@
|
||||||
<source src="upload/` + response["mp3_2"] + `" type="audio/wav">
|
<source src="upload/` + response["mp3_2"] + `" type="audio/wav">
|
||||||
Your browser does not support the audio element.
|
Your browser does not support the audio element.
|
||||||
</audio>
|
</audio>
|
||||||
|
<br>
|
||||||
|
<a href="upload/` + response["mp3_2"] + `" download rel="nofollow">Download Audio</a>
|
||||||
</div>
|
</div>
|
||||||
</section>`
|
</section>`
|
||||||
$("body").append(html_content)
|
$("body").append(html_content)
|
||||||
|
@ -86,12 +98,16 @@
|
||||||
<video style="width: 100%" src="upload/` + response["mp4"] + `" controls autoplay>
|
<video style="width: 100%" src="upload/` + response["mp4"] + `" controls autoplay>
|
||||||
Sorry, your browser doesn't support embedded videos.
|
Sorry, your browser doesn't support embedded videos.
|
||||||
</video>
|
</video>
|
||||||
|
<br>
|
||||||
|
<a href="upload/` + response["mp4"] + `" download rel="nofollow">Download Video</a>
|
||||||
</div>
|
</div>
|
||||||
<div style="border: 1px solid black; width:100%; height:100%; text-align:center;">
|
<div style="border: 1px solid black; width:100%; height:100%; text-align:center;">
|
||||||
<h1 style="height:15%; width:90%; padding: 5%">Encoded</h1>
|
<h1 style="height:15%; width:90%; padding: 5%">Encoded</h1>
|
||||||
<video style="width: 100%" src="upload/` + response["mp4_2"] + `" controls autoplay>
|
<video style="width: 100%" src="upload/` + response["mp4_2"] + `" controls autoplay>
|
||||||
Sorry, your browser doesn't support embedded videos.
|
Sorry, your browser doesn't support embedded videos.
|
||||||
</video>
|
</video>
|
||||||
|
<br>
|
||||||
|
<a href="upload/` + response["mp4_2"] + `" download rel="nofollow">Download Video</a>
|
||||||
</div>
|
</div>
|
||||||
</section>`
|
</section>`
|
||||||
$("body").append(html_content)
|
$("body").append(html_content)
|
||||||
|
@ -101,11 +117,13 @@
|
||||||
var html_content = `<section style="margin: 100px auto; width:50%; height:50%; display: flex; justify-content: space-between;">
|
var html_content = `<section style="margin: 100px auto; width:50%; height:50%; display: flex; justify-content: space-between;">
|
||||||
<div style="border: 1px solid black; width:100%; height:100%; text-align:center;">
|
<div style="border: 1px solid black; width:100%; height:100%; text-align:center;">
|
||||||
<h1 style="height:15%; width:90%; padding: 5%">Original</h1>
|
<h1 style="height:15%; width:90%; padding: 5%">Original</h1>
|
||||||
<a href="upload/` + response["document"] + `" download>Download Document</a>
|
<br>
|
||||||
|
<a href="upload/` + response["document"] + `" download rel="nofollow">Download Document</a>
|
||||||
</div>
|
</div>
|
||||||
<div style="border: 1px solid black; width:100%; height:100%; text-align:center;">
|
<div style="border: 1px solid black; width:100%; height:100%; text-align:center;">
|
||||||
<h1 style="height:15%; width:90%; padding: 5%">Encoded</h1>
|
<h1 style="height:15%; width:90%; padding: 5%">Encoded</h1>
|
||||||
<a href="upload/` + response["document_2"] + `" download>Download Document</a>
|
<br>
|
||||||
|
<a href="upload/` + response["document_2"] + `" download rel="nofollow">Download Document</a>
|
||||||
</div>
|
</div>
|
||||||
</section>`
|
</section>`
|
||||||
$("body").append(html_content)
|
$("body").append(html_content)
|
||||||
|
@ -140,6 +158,11 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("body").on("click", ".result_box", function(e){
|
||||||
|
e.preventDefault()
|
||||||
|
window.location.href = $(this).parent().find("a").attr("href")
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue