Skip to content

Commit c5cd757

Browse files
authored
Merge pull request #1045 from biigle/videoShortcuts
Add "o" shortcut to videos
2 parents 6c0a3aa + 19f8dac commit c5cd757

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

resources/assets/js/videos/components/settingsTab.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script>
22
import PowerToggle from '../../core/components/powerToggle';
33
import Settings from '../stores/settings';
4+
import Keyboard from '../../core/keyboard';
45
56
export default {
67
components: {
@@ -87,6 +88,13 @@ export default {
8788
handleUnmuteVideo() {
8889
this.muteVideo = false;
8990
},
91+
toggleAnnotationOpacity() {
92+
if (this.annotationOpacity > 0) {
93+
this.annotationOpacity = 0;
94+
} else {
95+
this.annotationOpacity = 1;
96+
}
97+
},
9098
},
9199
watch: {
92100
annotationOpacity(value) {
@@ -145,6 +153,8 @@ export default {
145153
this.restoreKeys.forEach((key) => {
146154
this[key] = Settings.get(key);
147155
});
156+
157+
Keyboard.on('o', this.toggleAnnotationOpacity);
148158
},
149159
};
150160
</script>

resources/assets/js/videos/videoContainer.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ export default {
175175
},
176176
reachedTrackedAnnotationLimit() {
177177
return this.disableJobTracking;
178+
},
179+
annotationsAreHidden() {
180+
return this.settings.annotationOpacity === 0;
178181
}
179182
},
180183
methods: {

resources/views/manual/tutorials/videos/shortcuts.blade.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@
9595
<td><kbd>l</kbd></td>
9696
<td>Select tool to attach labels to existing annotations</td>
9797
</tr>
98+
<tr>
99+
<td><kbd>o</kbd></td>
100+
<td>Toggle the annotation opactiy between 0.0 and 1.0</td>
101+
</tr>
98102
<tr>
99103
<td><kbd>Shift</kbd>+<kbd>l</kbd></td>
100104
<td>Select tool to swap labels of existing annotations</td>

resources/views/videos/show/sidebar-settings.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<sidebar-tab name="settings" icon="cog" title="Settings">
1+
<sidebar-tab name="settings" icon="cog" title="Settings" :highlight="annotationsAreHidden">
22
<settings-tab inline-template
33
v-on:update="handleUpdatedSettings"
44
:supports-jump-by-frame="supportsJumpByFrame"

0 commit comments

Comments
 (0)