WebRoot/admin/assets/plugins/maskedinput/js/jquery.maskedinput.min.js
(开头部分) 6KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/*
Masked Input plugin for jQuery
Copyright (c) 2007-2013 Josh Bush (digitalbush.com)
Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
Version: 1.3.1
*/
(function(e) {
function t() {
var e = document.createElement("input"), t = "onpaste";
return e.setAttribute(t, ""), "function" == typeof e[t] ? "paste" : "input"
}
var n, a = t() + ".mask", r = navigator.userAgent, i = /iphone/i.test(r), o = /android/i.test(r);
e.mask = {definitions: {9: "[0-9]",a: "[A-Za-z]","*": "[A-Za-z0-9]"},dataName: "rawMaskFn",placeholder: "_"}, e.fn.extend({caret: function(e, t) {
var n;
if (0 !== this.length && !this.is(":hidden"))
return "number" == typeof e ? (t = "number" == typeof t ? t : e, this.each(function() {
this.setSelectionRange ? this.setSelectionRange(e, t) : this.createTextRange && (n = this.createTextRange(), n.collapse(!0), n.moveEnd("character", t), n.moveStart("character", e), n.select())
})) : (this[0].setSelectionRange ? (e = this[0].selectionStart, t = this[0].selectionEnd) : document.selection && document.selection.createRange && (n = document.selection.createRange(), e = 0 - n.duplicate().moveStart("character", -1e5), t = e + n.text.length), {begin: e,end: t})
},unmask: function() {
return this.trigger("unmask")
},mask: function(t, r) {
var c, l, s, u, f, h;
return !t && this.length > 0 ? (c = e(this[0]), c.data(e.mask.dataName)()) : (r = e.extend({placeholder: e.mask.placeholder,completed: null}, r), l = e.mask.definitions, s = [], u = h = t.length, f = null, e.each(t.split(""), function(e, t) {
"?" == t ? (h--, u = e) : l[t] ? (s.push(RegExp(l[t])), null === f && (f = s.length - 1)) : s.push(null)
}), this.trigger("unmask").each(function() {
function c(e) {
for (; h > ++e && !s[e]; )
;
return e
}
function d(e) {
for (; --e >= 0 && !s[e]; )
;
return e
}
function m(e, t) {
var n, a;
if (!(0 > e)) {
for (n = e, a = c(t); h > n; n++)
if (s[n]) {
if (!(h > a && s[n].test(R[a])))
break;
R[n] = R[a], R[a] = r.placeholder, a = c(a)
}
b(), x.caret(Math.max(f, e))
}
}
function p(e) {
var t, n, a, i;
for (t = e, n = r.placeholder; h > t; t++)
if (s[t]) {
if (a = c(t), i = R[t], R[t] = n, !(h > a && s[a].test(i)))
break;
n = i
}
}
function g(e) {
var t, n, a, r = e.which;
8 === r || 46 === r || i && 127 === r ? (t = x.caret(), n = t.begin, a = t.end, 0 === a - n && (n = 46 !== r ? d(n) : a = c(n - 1), a = 46 === r ? c(a) : a), k(n, a), m(n, a - 1), e.preventDefault()) : 27 == r && (x.val(S), x.caret(0, y()), e.preventDefault())
}
后面还有 53 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。