From 1f23be2d64f0ec3f1000050da7c2de98bb1619a7 Mon Sep 17 00:00:00 2001 From: Leane Schlundt Date: Thu, 5 Dec 2024 11:01:12 +0100 Subject: [PATCH 01/25] Add screenshot function to videos --- .../components/screenshotButton.vue | 36 ++++++++++++++----- .../js/videos/components/settingsTab.vue | 9 +++++ resources/assets/js/videos/videoContainer.vue | 5 +++ .../annotations/show/tabs/settings.blade.php | 2 +- .../videos/show/sidebar-settings.blade.php | 6 ++++ 5 files changed, 48 insertions(+), 10 deletions(-) diff --git a/resources/assets/js/annotations/components/screenshotButton.vue b/resources/assets/js/annotations/components/screenshotButton.vue index 94c58babc..2169ba660 100644 --- a/resources/assets/js/annotations/components/screenshotButton.vue +++ b/resources/assets/js/annotations/components/screenshotButton.vue @@ -9,6 +9,12 @@ import Keyboard from '../../core/keyboard'; * @type {Object} */ export default { + props:{ + isImage:{ + type: Boolean, + default: true + } + }, data() { return { filenames: {}, @@ -150,15 +156,27 @@ export default { }, }, created() { - let ids = biigle.$require('annotations.imagesIds'); - let filenames = {}; - biigle.$require('annotations.imagesFilenames').forEach((filename, index) => { - filenames[ids[index]] = filename; - }); - this.filenames = filenames; - this.currentId = biigle.$require('annotations.imageId'); - Events.$on('images.change', this.updateCurrentId); - Events.$on('annotations.map.init', this.setMap); + if (this.isImage) { + let ids = biigle.$require('annotations.imagesIds'); + let filenames = {}; + biigle.$require('annotations.imagesFilenames').forEach((filename, index) => { + filenames[ids[index]] = filename; + }); + this.filenames = filenames; + this.currentId = biigle.$require('annotations.imageId'); + Events.$on('images.change', this.updateCurrentId); + Events.$on('annotations.map.init', this.setMap); + } else { + let ids = biigle.$require('videos.videoIds'); + let filenames = {}; + biigle.$require('videos.videoFilenames').forEach((filename, index) => { + filenames[ids[index]] = filename; + }); + this.filenames = filenames; + this.currentId = biigle.$require('videos.id'); + Events.$on('video.change', this.updateCurrentId); + Events.$on('videos.map.init', this.setMap); + } Keyboard.on('p', this.capture); }, }; diff --git a/resources/assets/js/videos/components/settingsTab.vue b/resources/assets/js/videos/components/settingsTab.vue index 7e322614e..6c7599cd6 100644 --- a/resources/assets/js/videos/components/settingsTab.vue +++ b/resources/assets/js/videos/components/settingsTab.vue @@ -1,16 +1,22 @@ diff --git a/resources/views/annotations/show/tabs/settings.blade.php b/resources/views/annotations/show/tabs/settings.blade.php index a9fece479..168c1c331 100644 --- a/resources/views/annotations/show/tabs/settings.blade.php +++ b/resources/views/annotations/show/tabs/settings.blade.php @@ -3,7 +3,7 @@
diff --git a/resources/views/videos/show/sidebar-settings.blade.php b/resources/views/videos/show/sidebar-settings.blade.php index 887451551..c5a171db3 100644 --- a/resources/views/videos/show/sidebar-settings.blade.php +++ b/resources/views/videos/show/sidebar-settings.blade.php @@ -4,6 +4,12 @@ :supports-jump-by-frame="supportsJumpByFrame" >
+