|
@@ -797,7 +797,7 @@
|
|
|
var caretPos = caret(input);
|
|
var caretPos = caret(input);
|
|
|
caret(input, isRTL ? caretPos.begin + 1 : caretPos.begin - 1);
|
|
caret(input, isRTL ? caretPos.begin + 1 : caretPos.begin - 1);
|
|
|
}, 0)) : (opts.insertMode = !opts.insertMode, caret(input, opts.insertMode || pos.begin != getMaskLength() ? pos.begin : pos.begin - 1)),
|
|
}, 0)) : (opts.insertMode = !opts.insertMode, caret(input, opts.insertMode || pos.begin != getMaskLength() ? pos.begin : pos.begin - 1)),
|
|
|
- ignorable = -1 != $.inArray(k, opts.ignorables);
|
|
|
|
|
|
|
+ opts.onKeyDown.call(this, e, getBuffer(), caret(input).begin, opts), ignorable = -1 != $.inArray(k, opts.ignorables);
|
|
|
}
|
|
}
|
|
|
function keypressEvent(e, checkval, writeOut, strict, ndx) {
|
|
function keypressEvent(e, checkval, writeOut, strict, ndx) {
|
|
|
var input = this, $input = $(input), k = e.which || e.charCode || e.keyCode;
|
|
var input = this, $input = $(input), k = e.which || e.charCode || e.keyCode;
|
|
@@ -844,10 +844,6 @@
|
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- function keyupEvent(e) {
|
|
|
|
|
- var buffer = ($(this), e.keyCode, getBuffer());
|
|
|
|
|
- opts.onKeyUp.call(this, e, buffer, opts);
|
|
|
|
|
- }
|
|
|
|
|
function pasteEvent(e) {
|
|
function pasteEvent(e) {
|
|
|
var input = this, $input = $(input), inputValue = input._valueGet(!0), caretPos = caret(input);
|
|
var input = this, $input = $(input), inputValue = input._valueGet(!0), caretPos = caret(input);
|
|
|
if ("propertychange" == e.type && input._valueGet().length <= getMaskLength()) return !0;
|
|
if ("propertychange" == e.type && input._valueGet().length <= getMaskLength()) return !0;
|
|
@@ -962,7 +958,7 @@
|
|
|
input._valueGet() == getBufferTemplate().join("") && $input.trigger("cleared"),
|
|
input._valueGet() == getBufferTemplate().join("") && $input.trigger("cleared"),
|
|
|
opts.showTooltip && $input.prop("title", getMaskSet().mask);
|
|
opts.showTooltip && $input.prop("title", getMaskSet().mask);
|
|
|
}).bind("complete.inputmask", opts.oncomplete).bind("incomplete.inputmask", opts.onincomplete).bind("cleared.inputmask", opts.oncleared),
|
|
}).bind("complete.inputmask", opts.oncomplete).bind("incomplete.inputmask", opts.onincomplete).bind("cleared.inputmask", opts.oncleared),
|
|
|
- $el.bind("keydown.inputmask", keydownEvent).bind("keypress.inputmask", keypressEvent).bind("keyup.inputmask", keyupEvent),
|
|
|
|
|
|
|
+ $el.bind("keydown.inputmask", keydownEvent).bind("keypress.inputmask", keypressEvent),
|
|
|
androidfirefox || $el.bind("compositionstart.inputmask", compositionStartEvent).bind("compositionupdate.inputmask", compositionUpdateEvent).bind("compositionend.inputmask", compositionEndEvent),
|
|
androidfirefox || $el.bind("compositionstart.inputmask", compositionStartEvent).bind("compositionupdate.inputmask", compositionUpdateEvent).bind("compositionend.inputmask", compositionEndEvent),
|
|
|
"paste" === PasteEventType && $el.bind("input.inputmask", inputFallBackEvent), patchValueProperty(el);
|
|
"paste" === PasteEventType && $el.bind("input.inputmask", inputFallBackEvent), patchValueProperty(el);
|
|
|
var initialValue = $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(el, el._valueGet(), opts) || el._valueGet() : el._valueGet();
|
|
var initialValue = $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(el, el._valueGet(), opts) || el._valueGet() : el._valueGet();
|
|
@@ -1084,7 +1080,7 @@
|
|
|
clearIncomplete: !1,
|
|
clearIncomplete: !1,
|
|
|
aliases: {},
|
|
aliases: {},
|
|
|
alias: null,
|
|
alias: null,
|
|
|
- onKeyUp: $.noop,
|
|
|
|
|
|
|
+ onKeyDown: $.noop,
|
|
|
onBeforeMask: void 0,
|
|
onBeforeMask: void 0,
|
|
|
onBeforePaste: void 0,
|
|
onBeforePaste: void 0,
|
|
|
onBeforeWrite: void 0,
|
|
onBeforeWrite: void 0,
|
|
@@ -1359,7 +1355,7 @@
|
|
|
}
|
|
}
|
|
|
return currentyear;
|
|
return currentyear;
|
|
|
},
|
|
},
|
|
|
- onKeyUp: function(e) {
|
|
|
|
|
|
|
+ onKeyDown: function(e) {
|
|
|
var $input = $(this);
|
|
var $input = $(this);
|
|
|
if (e.ctrlKey && e.keyCode == $.inputmask.keyCode.RIGHT) {
|
|
if (e.ctrlKey && e.keyCode == $.inputmask.keyCode.RIGHT) {
|
|
|
var today = new Date();
|
|
var today = new Date();
|
|
@@ -1523,7 +1519,7 @@
|
|
|
val1: new RegExp("0[1-9]|1[012]")
|
|
val1: new RegExp("0[1-9]|1[012]")
|
|
|
},
|
|
},
|
|
|
leapday: "02/29/",
|
|
leapday: "02/29/",
|
|
|
- onKeyUp: function(e) {
|
|
|
|
|
|
|
+ onKeyDown: function(e) {
|
|
|
var $input = $(this);
|
|
var $input = $(this);
|
|
|
if (e.ctrlKey && e.keyCode == $.inputmask.keyCode.RIGHT) {
|
|
if (e.ctrlKey && e.keyCode == $.inputmask.keyCode.RIGHT) {
|
|
|
var today = new Date();
|
|
var today = new Date();
|
|
@@ -1537,7 +1533,7 @@
|
|
|
placeholder: "yyyy/mm/dd",
|
|
placeholder: "yyyy/mm/dd",
|
|
|
alias: "mm/dd/yyyy",
|
|
alias: "mm/dd/yyyy",
|
|
|
leapday: "/02/29",
|
|
leapday: "/02/29",
|
|
|
- onKeyUp: function(e) {
|
|
|
|
|
|
|
+ onKeyDown: function(e) {
|
|
|
var $input = $(this);
|
|
var $input = $(this);
|
|
|
if (e.ctrlKey && e.keyCode == $.inputmask.keyCode.RIGHT) {
|
|
if (e.ctrlKey && e.keyCode == $.inputmask.keyCode.RIGHT) {
|
|
|
var today = new Date();
|
|
var today = new Date();
|