forked from 0x2620/oxjs
add InsertHTMLDialog to VideoEditor
This commit is contained in:
parent
658fca3c76
commit
4dd2c5706d
7 changed files with 249 additions and 8 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue