diff --git a/source/Ox.UI/js/Video/Ox.AnnotationFolder.js b/source/Ox.UI/js/Video/Ox.AnnotationFolder.js index 783fe08f..cb0aff84 100644 --- a/source/Ox.UI/js/Video/Ox.AnnotationFolder.js +++ b/source/Ox.UI/js/Video/Ox.AnnotationFolder.js @@ -260,37 +260,24 @@ Ox.AnnotationFolder = function(options, self) { selectnone: function() { that.triggerEvent('selectnone'); }, - submit: submitAnnotation, - key_b: function() { - that.triggerEvent('key_b'); - }, - key_equal: function() { - that.triggerEvent('key_equal'); - }, - key_f: function() { - that.triggerEvent('key_f'); - }, - key_g: function() { - that.triggerEvent('key_g'); - }, - key_minus: function() { - that.triggerEvent('key_minus'); - }, - key_n: function() { - that.triggerEvent('key_n'); - }, - key_shift_g: function() { - that.triggerEvent('key_shift_g'); - }, - key_space: function() { - that.triggerEvent('key_space'); - } + submit: submitAnnotation }) .appendTo( ['event', 'place'].indexOf(self.options.type) > -1 ? self.$outer : that.$content ); + [ + '0', 'b', 'backslash', 'closebracket', 'comma', 'dot', 'equal', + 'f', 'g', 'h', 'i', 'minus', 'n', 'o', 'openbracket', 'p', + 'shift_0', 'shift_g', 'shift_i', 'shift_o', 'slash', 'space' + ].forEach(function(key) { + key = 'key_' + key; + self.$annotations.bindEvent(key, function() { + that.triggerEvent(key); + }); + }); + self.options.selected && setTimeout(function() { // need timeout in order to trigger events if (self.options.collapsed) { diff --git a/source/Ox.UI/js/Video/Ox.AnnotationPanel.js b/source/Ox.UI/js/Video/Ox.AnnotationPanel.js index 2d69dd20..69b78107 100644 --- a/source/Ox.UI/js/Video/Ox.AnnotationPanel.js +++ b/source/Ox.UI/js/Video/Ox.AnnotationPanel.js @@ -219,32 +219,18 @@ Ox.AnnotationPanel = function(options, self) { layer.type == 'event' ? 'calendar' : 'map' ), data); }, - key_b: function() { - that.triggerEvent('key_b'); - }, - key_equal: function() { - that.triggerEvent('key_equal'); - }, - key_f: function() { - that.triggerEvent('key_f'); - }, - key_g: function() { - that.triggerEvent('key_g'); - }, - key_minus: function() { - that.triggerEvent('key_minus'); - }, - key_n: function() { - that.triggerEvent('key_n'); - }, - key_shift_g: function() { - that.triggerEvent('key_shift_g'); - }, - key_space: function() { - that.triggerEvent('key_space'); - } }) .appendTo(self.$folders); + [ + '0', 'b', 'backslash', 'closebracket', 'comma', 'dot', 'equal', + 'f', 'g', 'h', 'i', 'minus', 'n', 'o', 'openbracket', 'p', + 'shift_0', 'shift_g', 'shift_i', 'shift_o', 'slash', 'space' + ].forEach(function(key) { + key = 'key_' + key; + self.$folder[i].bindEvent(key, function() { + that.triggerEvent(key); + }); + }); }); that.setElement( diff --git a/source/Ox.UI/js/Video/Ox.VideoEditor.js b/source/Ox.UI/js/Video/Ox.VideoEditor.js index 788912b3..bf9f0e89 100644 --- a/source/Ox.UI/js/Video/Ox.VideoEditor.js +++ b/source/Ox.UI/js/Video/Ox.VideoEditor.js @@ -62,9 +62,6 @@ Ox.VideoEditor = function(options, self) { .options(options || {}) .bindEvent({ key_0: toggleMuted, - key_shift_0: function() { - movePositionBy(-self.options.position); - }, key_alt_left: function() { }, key_alt_right: function() { @@ -140,6 +137,9 @@ Ox.VideoEditor = function(options, self) { key_right: function() { movePositionBy(0.04); }, + key_shift_0: function() { + movePositionBy(-self.options.position); + }, key_shift_down: function() { movePositionBy(self.options.duration); }, @@ -648,32 +648,19 @@ Ox.VideoEditor = function(options, self) { self.options.showAnnotationsMap = !data.collapsed; that.triggerEvent('togglemap', data); }, - key_b: function() { - that.triggerEvent('key_b'); - }, - key_equal: function() { - that.triggerEvent('key_equal'); - }, - key_f: function() { - that.triggerEvent('key_f'); - }, - key_g: function() { - that.triggerEvent('key_g'); - }, - key_minus: function() { - that.triggerEvent('key_minus'); - }, - key_n: function() { - that.triggerEvent('key_n'); - }, - key_shift_g: function() { - that.triggerEvent('key_shift_g'); - }, - key_space: function() { - that.triggerEvent('key_space'); - } }); + [ + '0', 'b', 'backslash', 'closebracket', 'comma', 'dot', 'equal', + 'f', 'g', 'h', 'i', 'minus', 'n', 'o', 'openbracket', 'p', + 'shift_0', 'shift_g', 'shift_i', 'shift_o', 'slash', 'space' + ].forEach(function(key) { + key = 'key_' + key; + self.$annotationPanel.bindEvent(key, function() { + that.triggerEvent(key); + }); + }); + that.setElement( Ox.SplitPanel({ elements: [