⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clock.htc

📁 财务预算管理 财务支出
💻 HTC
📖 第 1 页 / 共 3 页
字号:
  if (iMinute < 0) iMinute = 0
  if (iMinute > 59) iMinute = 59

  if ((giMinute == iMinute) && (giHour == iHour))
    return
  else
    bValueChange = true
  
  if (giMinute != iMinute) 
  {
    giMinute = iMinute
    fnFireOnPropertyChange("propertyName", "minute")
  }
 
    if (giHour != iHour) 
    {
      giHour = iHour
      fnFireOnPropertyChange("propertyName", "hour")
      fnUptimeHourSelect()
    }
 
//  fnUptimeTitle()   
    fnFillInCells()
  
  if (bValueChange) fnFireOnPropertyChange("propertyName", "value")
}

//------------------------------------------------------------------------

function fnUptimeHourSelect()
{
  goHourSelect.options[ giHour ].selected = true
}
//------------------------------------------------------------------------

function fnBuildHourSelect()
{
  var newHourSelect

  newHourSelect = element.document.createElement("SELECT")
  goHourSelect.parentElement.replaceChild(newHourSelect, goHourSelect)
  goHourSelect = newHourSelect

  for (i=0 ; i < 24; i++)
  {
    e = element.document.createElement("OPTION")
    e.text = i
    goHourSelect.options.add(e)
  }

  goHourSelect.options[ giHour ].selected = true
  goHourSelect.attachEvent("onchange", fnHourSelectOnChange)
}

//------------------------------------------------------------------------

function fnHourSelectOnChange()
{
  iHour = goHourSelect.selectedIndex
  fnSetTime(giMinute, iHour)
}

//------------------------------------------------------------------------

function fnFillInCells()
{
  var iMinuteCell = 0
  
  for(i=0;i<60;i++,iMinuteCell++)
  {
     gaMinuteCell[iMinuteCell].innerText = i

     if (giMinute == i)
     {
       goCurrentMinuteCell = gaMinuteCell[iMinuteCell]
       gaMinuteCell[iMinuteCell].className = 'MinuteSelected_' + uniqueID
     } 
     else 
     {
       if (gaMinuteCell[iMinuteCell].className != 'Minute_' + uniqueID)
         gaMinuteCell[iMinuteCell].className = 'Minute_' + uniqueID
     }

     gaMinuteCell[iMinuteCell].minute = i+1
     gaMinuteCell[iMinuteCell].hour = giHour
  }
}

// **********************************************************************
//                            EVENT HANDLERS
// **********************************************************************

function fnOnClick()
{
  var e = window.event.srcElement

  if (e.tagName == "TD") 
  {

    if (gbReadOnly|| (!e.minute) ) return  // The calendar is read only
    fnSetTime(e.minute-1, e.hour)
  }
}

//------------------------------------------------------------------------

function fnOnSelectStart()
{
  window.event.returnValue = false
  window.event.cancelBubble = true
}

//------------------------------------------------------------------------

function fnOnReadyStateChange()
{
  gbLoading = (readyState != "complete")
}

//------------------------------------------------------------------------

function fnOnPropertyChange()
{
  if (window.event.propertyName.substring(0, 5) == 'style')
  { 
    switch (window.event.propertyName)
    {
      case 'style.calTitleBackgroundColor' :
        goStyle['WholeCalendar'].backgroundColor = style.calTitleBackgroundColor
        goStyle['Title'].backgroundColor = style.calTitleBackgroundColor
        break
      case 'style.calTitleColor' :
        goStyle['Title'].color = style.calTitleColor
        break
      case 'style.calTitleFontFamily' :
        goStyle['Title'].fontFamily = style.calTitleFontFamily
        break
      case 'style.calTitleFontSize' :
        goStyle['Title'].fontSize = style.calTitleFontSize
        break
      case 'style.calTitleFontWeight' :
        goStyle['Title'].fontWeight = style.calTitleFontWeight
        break
      case 'style.calTitleTextAlign' :
        goStyle['Title'].textAlign = style.calTitleTextAlign
        break

      case 'style.calMinuteTitleBackgroundColor' :
        goStyle['MinuteTitle'].backgroundColor = style.calMinuteTitleBackgroundColor
        break
      case 'style.calMinuteTitleColor' :
        goStyle['MinuteTitle'].color = style.calMinuteTitleColor
        break
      case 'style.calMinuteTitleFontFamily' :
        goStyle['MinuteTitle'].fontFamily = style.calMinuteTitleFontFamily
        break
      case 'style.calMinuteTitleFontSize' :
        goStyle['MinuteTitle'].fontSize = style.calMinuteTitleFontSize
        break
      case 'style.calMinuteTitleFontWeight' :
        goStyle['MinuteTitle'].fontWeight = style.calMinuteTitleFontWeight
        break
      case 'style.calMinuteTitleTextAlign' :
        goStyle['MinuteTitle'].textAlign = style.calMinuteTitleTextAlign
        break
      
      case 'style.calOffHourBackgroundColor' :
        goStyle['OffMinute'].backgroundColor = style.calOffHourBackgroundColor
        break
      case 'style.calOffHourColor' :
        goStyle['OffMinute'].color = style.calOffHourColor
        break
      case 'style.calOffHourFontFamily' :
        goStyle['OffMinute'].fontFamily = style.calOffHourFontFamily
        break
      case 'style.calOffHourFontSize' :
        goStyle['OffMinute'].fontSize = style.calOffHourFontSize
        break
      case 'style.calOffHourFontWeight' :
        goStyle['OffMinute'].fontWeight = style.calOffHourFontWeight
        break
      case 'style.calOffHourTextAlign' :
        goStyle['OffMinute'].textAlign = style.calOffHourTextAlign
        break
      case 'style.calOffHourVerticalAlign' :
        goStyle['OffMinute'].verticalAlign = style.calOffHourVerticalAlign
        break

      case 'style.calCurrentHourBackgroundColor' :
        goStyle['Minute'].backgroundColor = style.calCurrentHourBackgroundColor
        break
      case 'style.calCurrentHourColor' :
        goStyle['Minute'].color = style.calCurrentHourColor
        break
      case 'style.calCurrentHourFontFamily' :
        goStyle['Minute'].fontFamily = style.calCurrentHourFontFamily
        break
      case 'style.calCurrentHourFontSize' :
        goStyle['Minute'].fontSize = style.calCurrentHourFontSize
        break
      case 'style.calCurrentHourFontWeight' :
        goStyle['Minute'].fontWeight = style.calCurrentHourFontWeight
        break
      case 'style.calCurrentHourTextAlign' :
        goStyle['Minute'].textAlign = style.calCurrentHourTextAlign
        break
      case 'style.calCurrentHourVerticalAlign' :
        goStyle['Minute'].verticalAlign = style.calCurrentHourVerticalAlign
        break
      
      case 'style.calSelectedMinuteBackgroundColor' :
        goStyle['MinuteSelected'].backgroundColor = style.calSelectedMinuteBackgroundColor
        break
      case 'style.calSelectedMinuteColor' :
        goStyle['MinuteSelected'].color = style.calSelectedMinuteColor
        break
      case 'style.calSelectedMinuteFontFamily' :
        goStyle['MinuteSelected'].fontFamily = style.calSelectedMinuteFontFamily
        break
      case 'style.calSelectedMinuteFontSize' :
        goStyle['MinuteSelected'].fontSize = style.calSelectedMinuteFontSize
        break
      case 'style.calSelectedMinuteFontWeight' :
        goStyle['MinuteSelected'].fontWeight = style.calSelectedMinuteFontWeight
        break
      case 'style.calSelectedMinuteTextAlign' :
        goStyle['MinuteSelected'].textAlign = style.calSelectedMinuteTextAlign
        break
      case 'style.calSelectedMinuteVerticalAlign' :
        goStyle['MinuteSelected'].verticalAlign = style.calSelectedMinuteVerticalAlign
        break
    }
  }
}

// **********************************************************************
//                            HELPER FUNCTIONS
// **********************************************************************

function fnFireOnPropertyChange(name1, value1)
{
  var evObj = createEventObject()
  evObj.setAttribute(name1, value1)
  onPropertyChange.fire(evObj)
}

//------------------------------------------------------------------------

function fnUptimeGridColors()
{
  switch (gsGridCellEffect)
  {
    case "raised" :
      goStyle['OffMinute'].borderLeftColor = 'white'
      goStyle['OffMinute'].borderTopColor = 'white'
      goStyle['OffMinute'].borderRightColor = 'black'
      goStyle['OffMinute'].borderBottomColor = 'black'

      goStyle['Minute'].borderLeftColor = 'white'
      goStyle['Minute'].borderTopColor = 'white'
      goStyle['Minute'].borderRightColor = 'black'
      goStyle['Minute'].borderBottomColor = 'black'

      goStyle['MinuteSelected'].borderLeftColor = 'white'
      goStyle['MinuteSelected'].borderTopColor = 'white'
      goStyle['MinuteSelected'].borderRightColor = 'black'
      goStyle['MinuteSelected'].borderBottomColor = 'black'
      
      break
    case "flat" : 
      goStyle['OffMinute'].borderLeftColor = goStyle['OffMinute'].backgroundColor
      goStyle['OffMinute'].borderTopColor = goStyle['OffMinute'].backgroundColor
      goStyle['OffMinute'].borderRightColor = (gbShowVerticalGrid) ? gsGridLinesColor : goStyle['Minute'].backgroundColor
      goStyle['OffMinute'].borderBottomColor = (gbShowHorizontalGrid) ? gsGridLinesColor : goStyle['Minute'].backgroundColor

      goStyle['Minute'].borderLeftColor = goStyle['Minute'].backgroundColor
      goStyle['Minute'].borderTopColor = goStyle['Minute'].backgroundColor
      goStyle['Minute'].borderRightColor = (gbShowVerticalGrid) ? gsGridLinesColor : goStyle['Minute'].backgroundColor
      goStyle['Minute'].borderBottomColor = (gbShowHorizontalGrid) ? gsGridLinesColor : goStyle['Minute'].backgroundColor

      goStyle['MinuteSelected'].borderLeftColor = goStyle['MinuteSelected'].backgroundColor
      goStyle['MinuteSelected'].borderTopColor = goStyle['MinuteSelected'].backgroundColor
      goStyle['MinuteSelected'].borderRightColor = (gbShowVerticalGrid) ? gsGridLinesColor : goStyle['Minute'].backgroundColor
      goStyle['MinuteSelected'].borderBottomColor = (gbShowHorizontalGrid) ? gsGridLinesColor : goStyle['Minute'].backgroundColor
      
      break
    case "sunken" : 
      goStyle['OffMinute'].borderLeftColor = 'black'
      goStyle['OffMinute'].borderTopColor = 'black'
      goStyle['OffMinute'].borderRightColor = 'white'
      goStyle['OffMinute'].borderBottomColor = 'white'

      goStyle['Minute'].borderLeftColor = 'black'
      goStyle['Minute'].borderTopColor = 'black'
      goStyle['Minute'].borderRightColor = 'white'
      goStyle['Minute'].borderBottomColor = 'white'

      goStyle['MinuteSelected'].borderLeftColor = 'black'
      goStyle['MinuteSelected'].borderTopColor = 'black'
      goStyle['MinuteSelected'].borderRightColor = 'white'
      goStyle['MinuteSelected'].borderBottomColor = 'white'

      break
    default :
      throw 450
  }
}

</script>

<public:property put=fnPutMinute                  get=fnGetMinute                name="minute">
<public:property put=fnPutHour                get=fnGetHour              name="hour">
<public:property put=fnPutYear                 get=fnGetYear               name="year">
<public:property put=fnPutHourLength          get=fnGetHourLength        name="hourLength">
<public:property put=fnPutMinuteLength            get=fnGetMinuteLength          name="minuteLength">
<public:property put=fnPutFirstMinute             get=fnGetFirstMinute           name="firstMinute">
<public:property put=fnPutGridCellEffect       get=fnGetGridCellEffect     name="gridCellEffect">
<public:property put=fnPutGridLinesColor       get=fnGetGridLinesColor     name="gridLinesColor">
<public:property put=fnPutShowTimeSelectors    get=fnGetShowTimeSelectors  name="showTimeSelectors">
<public:property put=fnPutShowMinutes             get=fnGetShowMinutes           name="showMinutes">
<public:property put=fnPutShowTitle            get=fnGetShowTitle          name="showTitle">
<public:property put=fnPutShowVerticalGrid     get=fnGetShowVerticalGrid   name="showVerticalGrid">
<public:property put=fnPutShowHorizontalGrid   get=fnGetShowHorizontalGrid name="showHorizontalGrid">
<public:property put=fnPutValue                get=fnGetValue              name="value">
<public:property put=fnPutValueIsNull          get=fnGetValueIsNull        name="valueIsNull">
<public:property put=fnPutReadOnly             get=fnGetReadOnly           name="readOnly">

<public:event id="onChange"         name="onchange">
<public:event id="onPropertyChange" name="onpropertychange">
<public:event id="onError"          name="onerror">

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -