📄 clock.htc
字号:
element.children[0].rows[0].cells[1].children[0].children[0].disabled = gbReadOnly
element.children[0].rows[0].cells[1].children[0].children[1].disabled = gbReadOnly
}
// **********************************************************************
// CALENDAR INITIALIZATION FUNCTIONS
// **********************************************************************
function fnCreateCalendarHTML()
{
var row, cell
element.innerHTML =
'<table border=0 class=WholeCalendar_' + uniqueID + '> ' +
' <tr> ' +
' <td class=Title_' + uniqueID + '>Сʱ</td> ' +
' <td class=TimeControls_' + uniqueID + '> ' +
' <nobr> <select size=10 ></select> ' +
' </nobr> </td> ' +
' </tr> ' +
' <tr> <td colspan=2> ' +
' <table class=CalTable_' + uniqueID + ' cellspacing=0 border=0> ' +
' <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>' +
' <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>' +
' <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>' +
' <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>' +
' <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>' +
' <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>' +
' <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>' +
' <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>' +
' <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>' +
' <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>' +
' <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>' +
' </table> ' +
' </td> ' +
' </tr> ' +
'</table> ';
goHourSelect = element.children[0].rows[0].cells[1].children[0].children[0]
for (row=1; row < 11; row++)
for (cell=0; cell < 6; cell++)
gaMinuteCell[((row-1)*6) + cell] = element.children[0].rows[1].cells[0].children[0].rows[row].cells[cell]
}
//------------------------------------------------------------------------
function fnCreateStyleSheets()
{
var StyleInfo
if (! element.document.body.BehaviorStyleSheet)
{
element.document.body.BehaviorStyleSheet = element.document.createStyleSheet()
}
StyleInfo = element.document.body.BehaviorStyleSheet
StyleInfo.addRule( '.WholeCalendar_' + uniqueID,
'background-color : lightgrey ;'+
'border : 1px solid black ;'+
'cursor : default ;'+
'width : 100% ;'+
'height : 100% ;'
)
goStyle['WholeCalendar'] = StyleInfo.rules[StyleInfo.rules.length - 1].style
StyleInfo.addRule( '.Title_' + uniqueID,
'color : #00009F ;'+ // cal--title-color
'font-family : Arial ;'+ // cal--title-font-family
'font-size : 10pt ;'+ // cal--title-font-size
'font-weight : bold ;'+ // cal--title-font-weight
'text-align : center ;'+ // cal--title-text-align
'height : 1 ;'+
'width : 50% ;'+
'background-color : lightgrey;'
)
goStyle['Title'] = StyleInfo.rules[StyleInfo.rules.length - 1].style
fnLoadCSSDefault('cal--title-background-color', 'calTitleBackgroundColor', goStyle['Title'], 'backgroundColor')
fnLoadCSSDefault('cal--title-color', 'calTitleColor', goStyle['Title'], 'color')
fnLoadCSSDefault('cal--title-font-family', 'calTitleFontFamily', goStyle['Title'], 'fontFamily')
fnLoadCSSDefault('cal--title-font-size', 'calTitleFontSize', goStyle['Title'], 'fontSize')
fnLoadCSSDefault('cal--title-font-weight', 'calTitleFontWeight', goStyle['Title'], 'fontWeight')
fnLoadCSSDefault('cal--title-text-align', 'calTitleTextAlign', goStyle['Title'], 'textAlign')
StyleInfo.addRule( '.TimeControls_' + uniqueID,
'text-align : right ;'
)
goStyle['TimeControls'] = StyleInfo.rules[StyleInfo.rules.length - 1].style
StyleInfo.addRule( '.CalTable_' + uniqueID,
'border : 1 solid black ;'+
'width : 100% ;'+
'height : 100% ;'
)
goStyle['CalTable'] = StyleInfo.rules[StyleInfo.rules.length - 1].style
StyleInfo.addRule( '.MinuteTitle_' + uniqueID,
'background-color : lightgrey ;'+ // minuteTitle-background-color
'color : black ;'+ // minuteTitle-color
'font-family : Arial ;'+ // minuteTitle-font-family
'font-size : 8pt ;'+ // minuteTitle-font-size
'font-weight : bold ;'+ // minuteTitle-font-weight
'text-align : center ;'+ // minuteTitle-text-align
'border-width : 1px ;'+
'border-style : solid ;'+
'border-left-color : white ;'+
'border-top-color : white ;'+
'border-right-color : black ;'+
'border-bottom-color : black ;'+
'width : 16% ;'+
'height : 1 ;'
)
goStyle['MinuteTitle'] = StyleInfo.rules[StyleInfo.rules.length - 1].style
fnLoadCSSDefault('cal--minuteTitle-background-color', 'calMinuteTitleBackgroundColor', goStyle['MinuteTitle'], 'backgroundColor')
fnLoadCSSDefault('cal--minuteTitle-color', 'calMinuteTitleColor', goStyle['MinuteTitle'], 'color')
fnLoadCSSDefault('cal--minuteTitle-font-family', 'calMinuteTitleFontFamily', goStyle['MinuteTitle'], 'fontFamily')
fnLoadCSSDefault('cal--minuteTitle-font-size', 'calMinuteTitleFontSize', goStyle['MinuteTitle'], 'fontSize')
fnLoadCSSDefault('cal--minuteTitle-font-weight', 'calMinuteTitleFontWeight', goStyle['MinuteTitle'], 'fontWeight')
fnLoadCSSDefault('cal--minuteTitle-text-align', 'calMinuteTitleTextAlign', goStyle['MinuteTitle'], 'textAlign')
StyleInfo.addRule( '.OffMinute_' + uniqueID,
'background-color : lightgrey ;'+ // cal--offHour-background-color
'color : #7F7F7F ;'+ // cal--offHour-color
'font-family : Arial ;'+ // cal--offHour-font-family
'font-size : 8pt ;'+ // cal--offHour-font-size
'font-weight : normal ;'+ // cal--offHour-font-weight
'text-align : right ;'+ // cal--offHour-text-align
'vertical-align : text-top ;'+ // cal--offHour-vertical-align
'border-width : 1px ;'+
'border-style : solid ;'+
'border-left-color : white ;'+
'border-top-color : white ;'+
'border-right-color : black ;'+
'border-bottom-color : black ;'+
'width : 16% ;'+
'cursor : hand ;'
)
goStyle['OffMinute'] = StyleInfo.rules[StyleInfo.rules.length - 1].style
fnLoadCSSDefault('cal--offHour-background-color', 'calOffHourBackgroundColor', goStyle['OffMinute'], 'backgroundColor')
fnLoadCSSDefault('cal--offHour-color', 'calOffHourColor', goStyle['OffMinute'], 'color')
fnLoadCSSDefault('cal--offHour-font-family', 'calOffHourFontFamily', goStyle['OffMinute'], 'fontFamily')
fnLoadCSSDefault('cal--offHour-font-size', 'calOffHourFontSize', goStyle['OffMinute'], 'fontSize')
fnLoadCSSDefault('cal--offHour-font-weight', 'calOffHourFontWeight', goStyle['OffMinute'], 'fontWeight')
fnLoadCSSDefault('cal--offHour-text-align', 'calOffHourTextAlign', goStyle['OffMinute'], 'textAlign')
fnLoadCSSDefault('cal--offHour-vertical-align', 'calOffHourVerticalAlign', goStyle['OffMinute'], 'verticalAlign')
StyleInfo.addRule( '.Minute_' + uniqueID,
'background-color : lightgrey ;'+ // cal--currentHour-background-color
'color : #00009F ;'+ // cal--currentHour-color
'font-family : Arial ;'+ // cal--currentHour-font-family
'font-size : 8pt ;'+ // cal--currentHour-font-size
'font-weight : normal ;'+ // cal--currentHour-font-weight
'text-align : right ;'+ // cal--currentHour-text-align
'vertical-align : text-top ;'+ // cal--currentHour-vertical-align
'border-width : 1px ;'+
'border-style : solid ;'+
'border-left-color : white ;'+
'border-top-color : white ;'+
'border-right-color : black ;'+
'border-bottom-color : black ;'+
'width : 16% ;'+
'cursor : hand ;'
)
goStyle['Minute'] = StyleInfo.rules[StyleInfo.rules.length - 1].style
fnLoadCSSDefault('cal--currentHour-background-color', 'calCurrentHourBackgroundColor', goStyle['Minute'], 'backgroundColor')
fnLoadCSSDefault('cal--currentHour-color', 'calCurrentHourColor', goStyle['Minute'], 'color')
fnLoadCSSDefault('cal--currentHour-font-family', 'calCurrentHourFontFamily', goStyle['Minute'], 'fontFamily')
fnLoadCSSDefault('cal--currentHour-font-size', 'calCurrentHourFontSize', goStyle['Minute'], 'fontSize')
fnLoadCSSDefault('cal--currentHour-font-weight', 'calCurrentHourFontWeight', goStyle['Minute'], 'fontWeight')
fnLoadCSSDefault('cal--currentHour-text-align', 'calCurrentHourTextAlign', goStyle['Minute'], 'textAlign')
fnLoadCSSDefault('cal--currentHour-vertical-align', 'calCurrentHourVerticalAlign', goStyle['Minute'], 'verticalAlign')
StyleInfo.addRule( '.MinuteSelected_' + uniqueID,
'background-color : #7F7F7F ;'+ // cal--selectedMinute-background-color
'color : yellow ;'+ // cal--selectedMinute-color
'font-family : Arial ;'+ // cal--selectedMinute-font-family
'font-size : 8pt ;'+ // cal--selectedMinute-font-size
'font-weight : normal ;'+ // cal--selectedMinute-font-weight
'text-align : right ;'+ // cal--selectedHour-text-align
'vertical-align : text-top ;'+ // cal--selectedHour-vertical-align
'border-width : 1px ;'+
'border-style : solid ;'+
'border-left-color : black ;'+
'border-top-color : black ;'+
'border-right-color : #BFBFBF ;'+
'border-bottom-color : #BFBFBF ;'+
'width : 16% ;'+
'cursor : hand ;'
)
goStyle['MinuteSelected'] = StyleInfo.rules[StyleInfo.rules.length - 1].style
fnLoadCSSDefault('cal--selectedMinute-background-color', 'calSelectedMinuteBackgroundColor', goStyle['MinuteSelected'], 'backgroundColor')
fnLoadCSSDefault('cal--selectedMinute-color', 'calSelectedMinuteColor', goStyle['MinuteSelected'], 'color')
fnLoadCSSDefault('cal--selectedMinute-font-family', 'calSelectedMinuteFontFamily', goStyle['MinuteSelected'], 'fontFamily')
fnLoadCSSDefault('cal--selectedMinute-font-size', 'calSelectedMinuteFontSize', goStyle['MinuteSelected'], 'fontSize')
fnLoadCSSDefault('cal--selectedMinute-font-weight', 'calSelectedMinuteFontWeight', goStyle['MinuteSelected'], 'fontWeight')
fnLoadCSSDefault('cal--selectedMinute-text-align', 'calSelectedMinuteTextAlign', goStyle['MinuteSelected'], 'textAlign')
fnLoadCSSDefault('cal--selectedMinute-vertical-align', 'calSelectedMinuteVerticalAlign', goStyle['MinuteSelected'], 'verticalAlign')
}
//------------------------------------------------------------------------
function fnLoadCSSDefault(sCSSProp, sScriptProp, oStyleRule, sStyleRuleProp)
{
if (element.currentStyle[sCSSProp])
{
oStyleRule[sStyleRuleProp] = element.currentStyle[sCSSProp]
}
element.style[sScriptProp] = oStyleRule[sStyleRuleProp]
}
//------------------------------------------------------------------------
function fnGetPropertyDefaults()
{
var x
var oTime = new Date()
giMinute = oTime.getMinutes()
giHour = oTime.getHours()
// The JavaScript Time.getYear function returns a 2 digit time representation
// for times in the 1900's and a 4 digit time for 2000 and beyond.
if (element.hour)
{
if (! isNaN(parseInt(element.hour))) giHour = parseInt(element.hour)
if (giHour < 1) giHour = 1
if (giHour > 24) giHour = 24
}
if (element.minute)
{
if (! isNaN(parseInt(element.minute))) giMinute = parseInt(element.minute)
if (giMinute < 1) giMinute = 1
if (giMinute > 60) giMinute = 60
}
if (element.hourLength)
{
switch (element.hourLength.toLowerCase())
{
case 'short' :
giHourLength = 0
break
case 'long' :
giHourLength = 1
break
}
}
if (element.minuteLength)
{
switch (element.minuteLength.toLowerCase())
{
case 'short' :
giMinuteLength = 0
break
case 'medium' :
giMinuteLength = 1
break
case 'long' :
giMinuteLength = 1
break
}
}
if (element.gridCellEffect)
{
switch (element.gridCellEffect.toLowerCase())
{
case 'raised' :
giGridCellEffect = 'raised'
break
case 'flat' :
giGridCellEffect = 'flat'
break
case 'sunken' :
giGridCellEffect = 'sunken'
break
}
}
if (element.gridLinesColor)
gsGridLinesColor = element.gridLinesColor
if (element.showTimeSelectors)
gbShowTimeSelectors = (element.showTimeSelectors) ? true : false
if (element.showMinutes)
gbShowMinutes = (element.showMinutes) ? true : false
if (element.showTitle)
gbShowTitle = (element.showTitle) ? true : false
if (element.showHorizontalGrid)
gbShowHorizontalGrid = (element.showHorizontalGrid) ? true : false
if (element.showVerticalGrid)
gbShowVerticalGrid = (element.showVerticalGrid) ? true : false
if (element.valueIsNull)
gbValueIsNull = (element.valueIsNull) ? true : false
if (element.name)
gsName = element.name
if (element.readOnly)
gbReadOnly = (element.readOnly) ? true : false
}
// **********************************************************************
// CALENDAR CONTROL FUNCTIONS
// **********************************************************************
function fnSetTime(iMinute, iHour)
{
var bValueChange = false
if (gbValueIsNull)
{
gbValueIsNull = false
fnFireOnPropertyChange("propertyName", "valueIsNull")
}
if (iHour < 0) iHour = 0
if (iHour > 23) iHour = 23
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -