diff options
author | Jonas Kohl | 2024-09-16 19:32:09 +0200 |
---|---|---|
committer | Jonas Kohl | 2024-09-16 19:32:09 +0200 |
commit | 6b7e714b59e28bc138681662006941274c3261af (patch) | |
tree | c683082c0a00681542db02d415bd45968f0a517b /src/application/views/view_topic_start.php | |
parent | fd3d969cf658475709db6a1e5090069cce51cbbd (diff) |
A lot more stuff
Diffstat (limited to 'src/application/views/view_topic_start.php')
-rw-r--r-- | src/application/views/view_topic_start.php | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/application/views/view_topic_start.php b/src/application/views/view_topic_start.php index 35befc7..da8c0cd 100644 --- a/src/application/views/view_topic_start.php +++ b/src/application/views/view_topic_start.php @@ -55,6 +55,60 @@ $canDelete = ($GLOBALS["currentUser"]?->id === $topicAuthor->id && $topicAuthor- }); }); </script> +<?php else: ?> + <div class="modal fade" tabindex="-1" role="dialog" id="diag-image-attachment"> + <div class="modal-dialog" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> + <h4 class="modal-title"><?= __("Attachment") ?></h4> + </div> + <div class="modal-body"> + <img class="image-attachment-view attachment-view" id="image-attachment-view" alt=""> + </div> + <div class="modal-footer"> + <a href="" download id="image-attachment-dl-btn" class="btn btn-default"><span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span> <?= __("Download") ?></a> + </div> + </div> + </div> + </div> + <div class="modal fade" tabindex="-1" role="dialog" id="diag-video-attachment"> + <div class="modal-dialog" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> + <h4 class="modal-title"><?= __("Attachment") ?></h4> + </div> + <div class="modal-body"> + <video class="video-attachment-view attachment-view" id="video-attachment-view" controls></video> + </div> + <div class="modal-footer"> + <a href="" download id="video-attachment-dl-btn" class="btn btn-default"><span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span> <?= __("Download") ?></a> + </div> + </div> + </div> + </div> + <script> + $(function() { + $(".image-attachment:not(.video-attachment)").click(function(e) { + e.preventDefault(); + var attUrl = "?_action=attachment&attachment=" + encodeURIComponent($(this).attr("data-attachment-id")); + $("#image-attachment-view").attr("src", attUrl); + $("#image-attachment-dl-btn").attr("href", attUrl); + $("#diag-image-attachment").modal(); + }); + $(".image-attachment.video-attachment").click(function(e) { + e.preventDefault(); + var attUrl = "?_action=attachment&attachment=" + encodeURIComponent($(this).attr("data-attachment-id")); + $("#video-attachment-view").attr("src", attUrl); + $("#video-attachment-dl-btn").attr("href", attUrl); + $("#diag-video-attachment").modal(); + }); + $("#diag-video-attachment").on("hide.bs.modal", function() { + $("#video-attachment-view")[0].pause(); + }); + }); + </script> <?php endif; ?> <div class="page-header margin-top-0 clearfix"> |