From 916c194301fcc437e029ddec8290abba4c5ede13 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Thu, 18 Sep 2014 14:27:27 +0200 Subject: [PATCH] move import/export annotations to menu in annotations panel --- source/Ox.UI/js/Video/AnnotationPanel.js | 13 ++++++++++++- source/Ox.UI/js/Video/VideoAnnotationPanel.js | 15 ++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/source/Ox.UI/js/Video/AnnotationPanel.js b/source/Ox.UI/js/Video/AnnotationPanel.js index d4b2e178..94fca84a 100644 --- a/source/Ox.UI/js/Video/AnnotationPanel.js +++ b/source/Ox.UI/js/Video/AnnotationPanel.js @@ -47,6 +47,8 @@ Ox.AnnotationPanel = function(options, self) { calendarSize: 256, clickLink: null, editable: false, + enableExport: false, + enableImport: false, highlight: '', itemName: {singular: 'video', plural: 'videos'}, layers: [], @@ -263,7 +265,12 @@ Ox.AnnotationPanel = function(options, self) { {id: 'annotation', title: annotationTitle, disabled: true}, {id: 'find', title: Ox._('Find in This {0}', [Ox.toTitleCase(self.options.itemName.singular)])}, {id: 'findannotations', title: Ox._('Find in All {0}', [Ox.toTitleCase(self.options.itemName.plural)])} - ] : [] + ] : [], + [ + {}, + {id: 'import', title: Ox._('Import Annotations...'), disabled: !self.options.enableImport}, + {id: 'export', title: Ox._('Export Annotations...'), disabled: !self.options.enableExport}, + ] ), maxWidth: 256, style: 'square', @@ -282,10 +289,14 @@ Ox.AnnotationPanel = function(options, self) { getFolder(self.options.selected).options({selected: ''}); } else if (data.id == 'edit') { getFolder(self.options.selected).editItem(); + } else if (data.id == 'export') { + that.triggerEvent('exportannotations'); } else if (data.id == 'find') { that.triggerEvent('find', {value: value}); } else if (data.id == 'findannotations') { that.triggerEvent('findannotations', {key: key, value: value}); + } else if (data.id == 'import') { + that.triggerEvent('importannotations'); } else if (data.id == 'insert') { var id = $('.OxEditableElement div.OxInput').data('oxid'), element = $('.OxEditableElement textarea.OxInput')[0]; diff --git a/source/Ox.UI/js/Video/VideoAnnotationPanel.js b/source/Ox.UI/js/Video/VideoAnnotationPanel.js index a2e8ba6b..7e7836d7 100644 --- a/source/Ox.UI/js/Video/VideoAnnotationPanel.js +++ b/source/Ox.UI/js/Video/VideoAnnotationPanel.js @@ -637,9 +637,6 @@ Ox.VideoAnnotationPanel = function(options, self) { {id: 'embedSelection', title: Ox._('Embed Selection...')}, {id: 'linkToSelection', title: Ox._('Link to Selection...')}, {}, - {id: 'importAnnotations', title: Ox._('Import Annotations...'), disabled: !self.options.enableImport}, - {id: 'exportAnnotations', title: Ox._('Export Annotations...'), disabled: !self.options.enableExport}, - {}, {id: 'keyboard', title: Ox._('Keyboard Shortcuts...'), keyboard: 'h'} ] ), @@ -679,10 +676,6 @@ Ox.VideoAnnotationPanel = function(options, self) { 'in': self.options['in'], out: self.options.out }); - } else if (id == 'importAnnotations') { - that.triggerEvent('importannotations'); - } else if (id == 'exportAnnotations') { - that.triggerEvent('exportannotations'); } else if (id == 'keyboard') { showKeyboardShortcuts(); } @@ -802,6 +795,8 @@ Ox.VideoAnnotationPanel = function(options, self) { calendarSize: self.options.annotationsCalendarSize, clickLink: self.options.clickLink, editable: true, + enableExport: self.options.enableExport, + enableImport: self.options.enableImport, highlight: self.options.find, 'in': self.options['in'], itemName: self.options.itemName, @@ -855,6 +850,9 @@ Ox.VideoAnnotationPanel = function(options, self) { self.editing = true; setTimelineState(); }, + exportannotations: function() { + that.triggerEvent('exportannotations'); + }, find: function(data) { self.$findInput.options({value: data.value}); submitFindInput(data.value, true); @@ -863,6 +861,9 @@ Ox.VideoAnnotationPanel = function(options, self) { that.triggerEvent('findannotations', data); }, focus: that.gainFocus, + importannotations: function() { + that.triggerEvent('importannotations'); + }, info: function(data) { that.triggerEvent('info', data); },