C_PromptClockUI.js 4.2 KB

123456
  1. // Licensed Materials - Property of IBM
  2. // IBM Cognos Products: cchl
  3. // (C) Copyright IBM Corp. 2003, 2016.
  4. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  5. function C_PromptClockUI(_c0M1, _c8R1, _cDK, _cWQ){this._cXQ=_cWQ;this._cMK1=_c0M1;this._c9T1=_c0M1.uniqueID;this._cVR1=new Date(_c8R1.toString());this._c011=70;if(_cWQ){this._c011=70;}this._cC61=60;if(_cWQ){this._cC61=70;}var _cGB1=10;var _cHB1=10;this._cHV1=this._c011+_cGB1;if(this._cXQ){this._cHV1+= 6;}this._cIV1=this._cC61+_cHB1;if(this._cXQ){this._cIV1-= 12;}this._c111=12;this._cJC=360 / this._c111;var _cND1 ='...............';this._cOD1=_cND1.split('');var _c631 ='......................';this._c731=_c631.split('');var _c831 ='.............................';this._c931=_c831.split('');this._cEK=_cDK;this._cAT1();this._cBT1();};C_PromptClockUI.prototype._cAT1=function(){var _cCT=this._cMK1.appendChild(document.createElement("div"));_cCT.className="clsCCHLClockBlock";_cCT.setAttribute( "align", "center" );var _cLG1=_cCT.appendChild(document.createElement("div"));_cLG1.className="clsCCHLClock";var _c311=document.createElement("DIV");_c311.className="clsCCHLDivClock";_cLG1.appendChild(_c311);var _c411=document.createElement("DIV");_c411.className="clsCCHLDivRelative";_c311.appendChild(_c411);var i=0;for(i=1; i<this._c111+1; i++){var _cU6=document.createElement("DIV");_cU6.className="clsCCHLClockDigits";_cU6.id='clockDigits'+this._c9T1+ i;var _cS2=document.createTextNode(i);_cU6.appendChild(_cS2);_c411.appendChild(_cU6);}for(i=0; i<this._c731.length; i++){var _cS2=document.createElement("DIV");_cS2.className="clsCCHLMinuteHand";_cS2.id='minuteHand'+this._c9T1+ i;_c411.appendChild(_cS2);}for(i=0; i<this._cOD1.length; i++){var _cH9=document.createElement("DIV");_cH9.className="clsCCHLHourHand";_cH9.id='hourHand'+this._c9T1+ i;_c411.appendChild(_cH9);}if(this._cEK==true){for(i=0; i<this._c931.length; i++){var _c46=document.createElement("DIV");_c46.className="clsCCHLSecondHand";_c46.id='secondHand'+this._c9T1+ i;_c411.appendChild(_c46);}}};C_PromptClockUI.prototype._cBT1=function(){this._cZQ();this._c8I1();this._cO81();this._cP81();};C_PromptClockUI.prototype._cZQ=function(){for(var i=0; i<this._c111;++i){var _c1V1='clockDigits'+this._c9T1 +(i+1);var _cJV1=document.getElementById(_c1V1);_cJV1.style.top=(this._cHV1+this._c011*Math.sin(-1.045+i * this._cJC*Math.PI / 180))+ "px";_cJV1.style.left=(this._cIV1+this._cC61*Math.cos(-1.045+i * this._cJC*Math.PI / 180))+ "px";}};C_PromptClockUI.prototype._cP81=function(){if(this._cEK!=true){return;}var _c9I1=this._cVR1.getSeconds();var _c1M1=-1.57+Math.PI*_c9I1/30;for(var i=0; i<this._c931.length; i++){var _c1V1='secondHand'+this._c9T1 +(i);var _cJV1=document.getElementById(_c1V1);_cJV1.style.top=(this._cHV1+i*2*Math.sin(_c1M1))+ "px";_cJV1.style.left=(this._cIV1+i*2*Math.cos(_c1M1)+5)+ "px";if(this._cXQ){_cJV1.style.top=parseInt(_cJV1.style.top, 10)+6+"px";_cJV1.style.left=parseInt(_cJV1.style.left, 10)+"px";}}};C_PromptClockUI.prototype._cO81=function(){var _cAI1=this._cVR1.getMinutes();var _c2M1=-1.57+Math.PI*_cAI1/30;for(var i=0; i<this._c731.length; i++){var _c1V1='minuteHand'+this._c9T1 +(i);var _cJV1=document.getElementById(_c1V1);_cJV1.style.top=(this._cHV1+i*2*Math.sin(_c2M1))+ "px";_cJV1.style.left=(this._cIV1+i*2*Math.cos(_c2M1)+5)+ "px";if(this._cXQ){_cJV1.style.top=parseInt(_cJV1.style.top, 10)+6+"px";_cJV1.style.left=parseInt(_cJV1.style.left, 10)+"px";}}};C_PromptClockUI.prototype._c8I1=function(){var _cJP1=this._cVR1.getHours();var _cWR1=-1.57+Math.PI*_cJP1/6+Math.PI*parseInt(this._cVR1.getMinutes(),10)/360;for(var i=0; i<this._cOD1.length; i++){var _c1V1='hourHand'+this._c9T1 +(i);var _cJV1=document.getElementById(_c1V1);_cJV1.style.top=(this._cHV1+i*2*Math.sin(_cWR1))+ "px";_cJV1.style.left=(this._cIV1+i*2*Math.cos(_cWR1)+5)+ "px";if(this._cXQ){_cJV1.style.top=parseInt(_cJV1.style.top, 10)+6+"px";_cJV1.style.left=parseInt(_cJV1.style.left, 10)+"px";}}};C_PromptClockUI.prototype.F_UpdateClock=function(_c8R1){var _cBI1=this._cVR1;this._cVR1=new Date(_c8R1.toString());if((this._cVR1.getMinutes()!=_cBI1.getMinutes())||(this._cVR1.getHours()!=_cBI1.getHours())){this._c8I1();this._cO81();}if(this._cVR1.getSeconds()!=_cBI1.getSeconds()){this._cP81();}this._cVR1=new Date(_c8R1.toString());};