mirror of
https://github.com/openvk/openvk
synced 2025-01-09 17:29:42 +03:00
Fix video bruh moment in textarea
This commit is contained in:
parent
37696673bf
commit
4c758e35fc
2 changed files with 14 additions and 9 deletions
|
@ -10,6 +10,9 @@
|
||||||
<div id="post-buttons{$textAreaId}" style="display: none;">
|
<div id="post-buttons{$textAreaId}" style="display: none;">
|
||||||
<div class="upload">
|
<div class="upload">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="post-upload">
|
||||||
|
<span style="color: inherit;"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="post-has-poll">
|
<div class="post-has-poll">
|
||||||
{_poll}
|
{_poll}
|
||||||
|
@ -52,7 +55,7 @@
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<input type="file" class="postFileSel" id="postFilePic" name="_pic_attachment" accept="image/*" style="display:none;" />
|
<input type="file" class="postFileSel" id="postFilePic" name="_pic_attachment" accept="image/*" style="display:none;" />
|
||||||
<input type="file" class="postFileSel" id="postFileVid" name="_vid_attachment" accept="video/*" style="display:none;" />
|
<input type="file" class="postFileSel" id="postFileVid" name="_vid_attachment" accept="video/*" style="display:none;" onchange="handleVideoTAreaUpdate(event, {$textAreaId})" />
|
||||||
<input type="hidden" name="poll" value="none" />
|
<input type="hidden" name="poll" value="none" />
|
||||||
<input type="hidden" name="type" value="1" />
|
<input type="hidden" name="type" value="1" />
|
||||||
<input type="hidden" name="hash" value="{$csrfToken}" />
|
<input type="hidden" name="hash" value="{$csrfToken}" />
|
||||||
|
@ -91,10 +94,6 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(() => {
|
$(document).ready(() => {
|
||||||
u("#post-buttons{$textAreaId} .postFileSel").on("change", function() {
|
|
||||||
handleUpload.bind(this, {$textAreaId})();
|
|
||||||
});
|
|
||||||
|
|
||||||
setupWallPostInputHandlers({$textAreaId});
|
setupWallPostInputHandlers({$textAreaId});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -22,10 +22,16 @@ function trim(string) {
|
||||||
return newStr;
|
return newStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleUpload(id) {
|
function handleVideoTAreaUpdate(event, id) {
|
||||||
console.warn("блять...");
|
console.log(event, id);
|
||||||
|
let indicator = u("#post-buttons" + id + " .post-upload");
|
||||||
u("#post-buttons" + id + " .postFileSel").not("#" + this.id).each(input => input.value = null);
|
let file = event.target.files[0];
|
||||||
|
if(typeof file === "undefined") {
|
||||||
|
indicator.attr("style", "display: none;");
|
||||||
|
} else {
|
||||||
|
u("span", indicator.nodes[0]).text("Видеолента: " + trim(file.name) + " (" + humanFileSize(file.size, false) + ")");
|
||||||
|
indicator.attr("style", "display: block;");
|
||||||
|
}
|
||||||
|
|
||||||
document.querySelector("#post-buttons" + id + " #wallAttachmentMenu").classList.add("hidden");
|
document.querySelector("#post-buttons" + id + " #wallAttachmentMenu").classList.add("hidden");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue