Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "o" shortcut to videos #1045

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions resources/assets/js/videos/components/settingsTab.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script>
import PowerToggle from '../../core/components/powerToggle';
import Settings from '../stores/settings';
import Keyboard from '../../core/keyboard';

export default {
components: {
Expand Down Expand Up @@ -87,6 +88,13 @@ export default {
handleUnmuteVideo() {
this.muteVideo = false;
},
toggleAnnotationOpacity() {
if (this.annotationOpacity > 0) {
this.annotationOpacity = 0;
} else {
this.annotationOpacity = 1;
}
},
},
watch: {
annotationOpacity(value) {
Expand Down Expand Up @@ -145,6 +153,8 @@ export default {
this.restoreKeys.forEach((key) => {
this[key] = Settings.get(key);
});

Keyboard.on('o', this.toggleAnnotationOpacity);
},
};
</script>
3 changes: 3 additions & 0 deletions resources/assets/js/videos/videoContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ export default {
},
reachedTrackedAnnotationLimit() {
return this.disableJobTracking;
},
annotationsAreHidden() {
return this.settings.annotationOpacity === 0;
}
},
methods: {
Expand Down
4 changes: 4 additions & 0 deletions resources/views/manual/tutorials/videos/shortcuts.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@
<td><kbd>l</kbd></td>
<td>Select tool to attach labels to existing annotations</td>
</tr>
<tr>
<td><kbd>o</kbd></td>
<td>Toggle the annotation opactiy between 0.0 and 1.0</td>
</tr>
<tr>
<td><kbd>Shift</kbd>+<kbd>l</kbd></td>
<td>Select tool to swap labels of existing annotations</td>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/videos/show/sidebar-settings.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<sidebar-tab name="settings" icon="cog" title="Settings">
<sidebar-tab name="settings" icon="cog" title="Settings" :highlight="annotationsAreHidden">
<settings-tab inline-template
v-on:update="handleUpdatedSettings"
:supports-jump-by-frame="supportsJumpByFrame"
Expand Down
Loading