diff options
-rw-r--r-- | File-decryption/webapp/assets/js/main.js | 8 | ||||
-rw-r--r-- | File-decryption/webapp/index.html | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/File-decryption/webapp/assets/js/main.js b/File-decryption/webapp/assets/js/main.js index 23def70..cd1ccc5 100644 --- a/File-decryption/webapp/assets/js/main.js +++ b/File-decryption/webapp/assets/js/main.js @@ -10,11 +10,13 @@ document.addEventListener("DOMContentLoaded", function () { let decryptToggle = document.getElementById('decrypt-toggle'); let serialForm = document.getElementById('serial-form'); var jsonRenderer = document.querySelector('.target'); + var liveDecoder = document.getElementById('live-decoder'); // Don't display the download button until a file is selected fileDownloadBtn.style.display = 'none'; serialForm.style.display = 'none'; + liveDecoder.style.display = 'none'; fileInput.onchange = () => { const reader = new FileReader() @@ -22,6 +24,12 @@ document.addEventListener("DOMContentLoaded", function () { console.log(e); currentFileName = e.target.fileName; processFileInput(e); + + // If the filename ends with .cns or pb, we can assume it's a protobuf file + if(currentFileName.endsWith('.cns') || currentFileName.endsWith('.pb')){ + // Enable live decoding + liveDecoder.style.display = 'block'; + } }); for (let file of fileInput.files) { diff --git a/File-decryption/webapp/index.html b/File-decryption/webapp/index.html index c522c08..8f63e74 100644 --- a/File-decryption/webapp/index.html +++ b/File-decryption/webapp/index.html @@ -63,7 +63,7 @@ <hr/> - <section class="file-decode"> + <section class="file-decode" id="live-decoder"> <div class="section-title"> <h3 class="title">Live decoding</h3> </div> |