1
0
Fork 0
forked from 0x2620/oxjs

add InsertHTMLDialog to VideoEditor

This commit is contained in:
rlx 2012-02-16 16:35:59 +00:00
commit 4dd2c5706d
7 changed files with 249 additions and 8 deletions

View file

@ -148,8 +148,6 @@ Ox.AnnotationPanel = function(options, self) {
that.triggerEvent('add', Ox.extend({layer: layer.id}, data));
},
blur: function() {
self.editing = false;
renderEditMenu();
that.triggerEvent('blur');
},
change: function(data) {
@ -163,6 +161,7 @@ Ox.AnnotationPanel = function(options, self) {
info: function(data) {
that.triggerEvent('info', {layer: layer.id});
},
insert: insert,
remove: function(data) {
that.triggerEvent('remove', Ox.extend({layer: layer.id}, data));
},
@ -258,6 +257,18 @@ Ox.AnnotationPanel = function(options, self) {
return folder;
}
function insert(data) {
var id = data.id;
Ox.InsertHTMLDialog(Ox.extend({
callback: function(data) {
Ox.UI.elements[id]
.value(data.value)
.focusInput(data.position)
.triggerEvent('change', data.value);
}
}, data)).open();
}
function renderEditMenu() {
Ox.print('RENDER EDIT MENU')
var annotation, annotationTitle, folder,
@ -288,7 +299,7 @@ Ox.AnnotationPanel = function(options, self) {
{id: 'edit', title: 'Edit Annotation', disabled: !self.options.selected || !isEditable || self.editing, keyboard: 'return'},
{id: 'delete', title: 'Delete Annotation', disabled: !self.options.selected || !isEditable, keyboard: 'delete'},
{},
{id: 'insert', title: 'Insert...', disabled: isString || !self.editing},
{id: 'insert', title: 'Insert...', disabled: isString || !self.editing, keyboard: 'control i'},
{id: 'undo', title: 'Undo Changes', disabled: !self.editing, keyboard: 'escape'},
{id: 'save', title: 'Save Changes', disabled: !self.editing, keyboard: isString ? 'return' : 'shift return'},
],
@ -322,6 +333,8 @@ Ox.AnnotationPanel = function(options, self) {
that.triggerEvent('find', {value: value});
} else if (data.id == 'findannotations') {
that.triggerEvent('findannotations', {key: key, value: value});
} else if (data.id == 'insert') {
insert({});
} else if (data.id == 'manage') {
that.triggerEvent('define', {
id: self.options.selected,