📄 actionresolverstrategy.js
字号:
function uiCalendar_ActionResolverStrategy(inputId, inputName, optPanelId, optFormat) { this._super(); var input = uiHtml_Element.createByEither(inputId, inputName); this.__domInput = input.getDomObject(); this.__panelId = optPanelId; this.__format = uiUtil_Type.getString(optFormat, "MM/dd/yyyy"); this.__origColor = null;}uiCalendar_ActionResolverStrategy = uiUtil_Object.declareClass(uiCalendar_ActionResolverStrategy, uiUtil_Object);uiCalendar_ActionResolverStrategy.prototype.getAction = function( eventName, calendarSuite, processedDate, selectedDate) { switch (eventName) { case "click" : return this.__getClickAction( calendarSuite, processedDate, selectedDate); case "mouseover" : return this.__getMouseOverAction(processedDate, selectedDate); case "mouseout" : return this.__getMouseOutAction(processedDate, selectedDate); }};uiCalendar_ActionResolverStrategy.prototype.__inTheSameMonth = function( date1, date2) { if (date1.getMonth() == date2.getMonth()) { return true; } return false;};uiCalendar_ActionResolverStrategy.prototype.__getClickAction = function( calendarSuite, processedDate, selectedDate) { if (!this.__inTheSameMonth(processedDate, selectedDate)) { return null; } var strategy = this; return function(e) { calendarSuite.update(processedDate); strategy.__domInput.value = (new uiUtil_Calendar( processedDate)).format(strategy.__format); if (strategy.__panelId != null) { var panel = uiPanel_driver.getSuite(strategy.__panelId); if (panel != null) { panel.requestHide(e, true); } } };};uiCalendar_ActionResolverStrategy.prototype.__getMouseOverAction = function( processedDate, selectedDate) { if (!this.__inTheSameMonth(processedDate, selectedDate)) { return null; } return function(e) { this.__origColor = this.style.backgroundColor; this.style.backgroundColor = "#ffd0d7"; };};uiCalendar_ActionResolverStrategy.prototype.__getMouseOutAction = function( processedDate, selectedDate) { if (!this.__inTheSameMonth(processedDate, selectedDate)) { return null; } return function(e) { this.style.backgroundColor = this.__origColor; };};uiCalendar_ActionResolverStrategy.prototype.getEventsOfInterest = function() { return new Array("click", "mouseover", "mouseout");};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -