WebContent/resource/js/jquery.date_input.pack.js
(开头部分) 9KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
DateInput = (function($) {
function DateInput(el, opts) {
if (typeof(opts) != "object") opts = {};
$.extend(this, DateInput.DEFAULT_OPTS, opts);
this.input = $(el);
this.bindMethodsToObj("show", "hide", "hideIfClickOutside", "keydownHandler", "selectDate");
this.build();
this.selectDate();
this.hide()
};
DateInput.DEFAULT_OPTS = {
month_names: ["一月份", "二月份", "三月份", "四月份", "五月份", "六月份", "七月份", "八月份", "九月份", "十月份", "十一月份", "十二月份"],
short_month_names: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
short_day_names: ["日", "一", "二", "三", "四", "五", "六"],
start_of_week: 1
};
DateInput.prototype = {
build: function() {
var monthNav = $('<p class="month_nav">' + '<span class="button prev" title="[Page-Up]">«</span>' + ' <span class="month_name"></span> ' + '<span class="button next" title="[Page-Down]">»</span>' + '</p>');
this.monthNameSpan = $(".month_name", monthNav);
$(".prev", monthNav).click(this.bindToObj(function() {
this.moveMonthBy( - 1)
}));
$(".next", monthNav).click(this.bindToObj(function() {
this.moveMonthBy(1)
}));
var yearNav = $('<p class="year_nav">' + '<span class="button prev" title="[Ctrl+Page-Up]">«</span>' + ' <span class="year_name"></span> ' + '<span class="button next" title="[Ctrl+Page-Down]">»</span>' + '</p>');
this.yearNameSpan = $(".year_name", yearNav);
$(".prev", yearNav).click(this.bindToObj(function() {
this.moveMonthBy( - 12)
}));
$(".next", yearNav).click(this.bindToObj(function() {
this.moveMonthBy(12)
}));
var nav = $('<div class="nav"></div>').append(monthNav, yearNav);
var tableShell = "<table><thead><tr>";
$(this.adjustDays(this.short_day_names)).each(function() {
tableShell += "<th>" + this + "</th>"
});
tableShell += "</tr></thead><tbody></tbody></table>";
this.dateSelector = this.rootLayers = $('<div class="date_selector"></div>').append(nav, tableShell).insertAfter(this.input);
if ($.browser.msie && $.browser.version < 7) {
this.ieframe = $('<iframe class="date_selector_ieframe" frameborder="0" src="#"></iframe>').insertBefore(this.dateSelector);
this.rootLayers = this.rootLayers.add(this.ieframe);
$(".button", nav).mouseover(function() {
$(this).addClass("hover")
});
$(".button", nav).mouseout(function() {
$(this).removeClass("hover")
})
};
this.tbody = $("tbody", this.dateSelector);
this.input.change(this.bindToObj(function() {
this.selectDate()
}));
this.selectDate()
},
selectMonth: function(date) {
var newMonth = new Date(date.getFullYear(), date.getMonth(), 1);
if (!this.currentMonth || !(this.currentMonth.getFullYear() == newMonth.getFullYear() && this.currentMonth.getMonth() == newMonth.getMonth())) {
后面还有 210 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
