diff options
| author | ilotterytea <iltsu@alright.party> | 2025-06-15 16:14:16 +0400 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-06-15 16:14:16 +0400 |
| commit | 648c126b070fc83ddb66b0353d03c4ad31b87551 (patch) | |
| tree | 3a83989f5eac1ef21e58d06fb293e14b2be636b4 /public/index.php | |
| parent | d152925126af0d311746518a20f6a409869ae02d (diff) | |
feat: audio recording
Diffstat (limited to 'public/index.php')
| -rw-r--r-- | public/index.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/public/index.php b/public/index.php index 9e6ccf1..c3eea01 100644 --- a/public/index.php +++ b/public/index.php @@ -233,7 +233,7 @@ $privacy_exists = is_file($_SERVER['DOCUMENT_ROOT'] . '/static/PRIVACY.txt'); </section> <section class="box column"> - <div class="tabs"> + <div class="tabs" id="form-upload-tabs"> <div class="form-upload-tab tab" id="form-tab-file"> <button onclick="showUploadType('file')" class="transparent"> <p>File Upload</p> @@ -288,6 +288,8 @@ $privacy_exists = is_file($_SERVER['DOCUMENT_ROOT'] . '/static/PRIVACY.txt'); <textarea name="paste" placeholder="Enter your text here..."></textarea> </div> + <div class="column" id="form-record-upload" style="display: none;"></div> + <table class="vertical left" id="form-upload-options"> <tr> <th>Title:</th> @@ -336,6 +338,7 @@ $privacy_exists = is_file($_SERVER['DOCUMENT_ROOT'] . '/static/PRIVACY.txt'); } </script> <?php elseif (!$file): ?> + <script src="/static/scripts/audiorecorder.js"></script> <script> const formDetails = document.getElementById('form-upload-options'); @@ -591,8 +594,13 @@ $privacy_exists = is_file($_SERVER['DOCUMENT_ROOT'] . '/static/PRIVACY.txt'); } function showUploadType(type) { - document.getElementById('form-upload-wrapper').style.display = type == 'text' ? 'none' : 'flex'; + if (document.getElementById('form-upload-tabs').hasAttribute('disabled')) { + return; + } + + document.getElementById('form-upload-wrapper').style.display = type == 'file' ? 'flex' : 'none'; document.getElementById('form-text-upload').style.display = type == 'text' ? 'flex' : 'none'; + document.getElementById('form-record-upload').style.display = type === 'audio' ? 'flex' : 'none'; const tabs = document.querySelectorAll('.form-upload-tab'); |
