[ Index ]
 

Code source de e107 0.7.8

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/e107_plugins/clock_menu/ -> clock.js (source)

   1  <!--
   2  
   3  function tick(e107_datepref,e107_dateformat,e107_datesuff1,e107_datesuff2,e107_datesuff3,e107_datesuff4) {
   4    if(e107_datepref=='undefined'){e107_datepref = '';}
   5    var hours, minutes, seconds, ap;
   6    var intHours, intMinutes, intSeconds;  var today;
   7    today = new Date();
   8    intDay = today.getDay();
   9    intDate = today.getDate();
  10    intMonth = today.getMonth();
  11    intYear = today.getYear();
  12    intHours = today.getHours();
  13    intMinutes = today.getMinutes();
  14    intSeconds = today.getSeconds();
  15    timeString = DayNam[intDay]+" "+e107_datepref+" "+intDate;
  16    if (intDate == 1 || intDate == 21 || intDate == 31) {
  17      timeString= timeString + e107_datesuff1 + " ";
  18    } else if (intDate == 2 || intDate == 22) {
  19      timeString= timeString  + e107_datesuff2 + " ";
  20    } else if (intDate == 3 || intDate == 23) {
  21      timeString= timeString  + e107_datesuff3 + " ";
  22    } else {
  23      timeString = timeString  + e107_datesuff4 + " ";
  24    } 
  25    if (intYear < 2000){
  26      intYear += 1900;
  27    }
  28    timeString = timeString+" "+MnthNam[intMonth]+" "+intYear;
  29    if(e107_dateformat == 1){
  30      if (intHours == 0) {
  31         hours = "12:";
  32         ap = "am.";
  33      } else if (intHours < 12) { 
  34         hours = intHours+":";
  35         ap = "am.";
  36      } else if (intHours == 12) {
  37         hours = "12:";
  38         ap = "pm.";
  39      } else {
  40         intHours = intHours - 12
  41         hours = intHours + ":";
  42         ap = "pm.";
  43      }
  44    }else{
  45      if (intHours < 10) {
  46         hours = "0" + intHours + ":";
  47      } else {
  48         hours = intHours + ":";
  49      }
  50      ap = '';
  51    }
  52    if (intMinutes < 10) {
  53       minutes = "0"+intMinutes;
  54    } else {
  55       minutes = intMinutes;
  56    }
  57    if (intSeconds < 10) {
  58       seconds = ":0"+intSeconds;
  59    } else {
  60       seconds = ":"+intSeconds;
  61    }
  62    timeString = (document.all)? timeString+", "+hours+minutes+seconds+" "+ap:timeString+" "+hours+minutes+" "+ap;
  63    var clock = (document.all) ? document.all("Clock") : document.getElementById("Clock");
  64    clock.innerHTML = timeString;
  65    (document.all)?window.setTimeout("tick('"+e107_datepref+"','"+e107_dateformat+"','"+e107_datesuff1+"','"+e107_datesuff2+"','"+e107_datesuff3+"','"+e107_datesuff4+"');", 1000):window.setTimeout("tick('"+e107_datepref+"','"+e107_dateformat+"','"+e107_datesuff1+"','"+e107_datesuff2+"','"+e107_datesuff3+"','"+e107_datesuff4+"');", 6000);
  66  }
  67  
  68  ////tick();
  69  
  70  //-->


Généré le : Sun Apr 1 01:23:32 2007 par Balluche grâce à PHPXref 0.7