Skip to content

Commit

Permalink
Merge pull request #1045 from biigle/videoShortcuts
Browse files Browse the repository at this point in the history
Add "o" shortcut to videos
  • Loading branch information
mzur authored Jan 10, 2025
2 parents 6c0a3aa + 19f8dac commit c5cd757
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
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

0 comments on commit c5cd757

Please sign in to comment.