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

@ -117,7 +117,7 @@ Ox.Input = function(options, self) {
.bindEvent(Ox.extend(self.options.type != 'textarea' ? {
key_enter: submit
} : {}, {
key_control_v: paste,
key_control_i: insert,
key_escape: cancel,
key_shift_enter: submit
}));
@ -719,6 +719,17 @@ Ox.Input = function(options, self) {
- (self.options.style == 'rounded' ? 14 : 6);
}
function insert() {
var input = self.$input[0];
that.triggerEvent('insert', {
end: input.selectionEnd,
id: that.id,
selection: input.value.substring(input.selectionStart, input.selectionEnd),
start: input.selectionStart,
value: input.value
});
}
function keydown(event) {
var oldCursor = cursor(),
oldValue = self.options.value,
@ -758,6 +769,7 @@ Ox.Input = function(options, self) {
}
function paste() {
// fixme: unused
var data = Ox.Clipboard.paste();
data.text && self.$input.val(data.text);
}