MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Specifikace Strana 450

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 504
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 449
450 Data Translators
//Assemble the lock tags and the replacement HTML.
var replCode = start + ' depFiles="' + depFiles + '"';
replCode = replCode + ' orig="%3Ckent%3E">\n';
replCode = replCode + imgTag;
replCode = replCode + end;
return replCode;
}
/******************************************************************
* The getImage() function determines which image to display *
* based on the day of the week, the time of day and the *
* user's platform. The day and time are figured based on UTC *
* time (Greenwich Mean Time) minus 8 hours, which gives *
* Pacific Standard Time (PST). No allowance is made for Daylight *
* Savings Time in this routine. *
******************************************************************/
function getImage(){
var today = new Date(); // Today's date & time.
var day = today.getUTCDay(); // Day of the week in the GMT time
zone.
// 0=Sunday, 1=Monday, and so on.
var hour = today.getUTCHours(); // The current hour in GMT, based on
the
// 24-hour clock.
var SFhour = hour - 8; // The time in San Francisco, based
on the
// 24-hour clock.
var platform = navigator.platform; // User's platform. All Windows
machines
// are identified by Dreamweaver as
"Win32",
// all Macs as "MacPPC".
var imageRef; // The image reference to be returned.
// If SFhour is negative, you have two adjustments to make.
// First, subtract one from the day count because it is already the
wee
// hours of the next day in GMT. Second, add SFhour to 24 to
// give a valid hour in the 24-hour clock.
if (SFhour < 0){
day = day - 1;
// The day count back one would make it negative, and it's
Saturday,
// so set the count to 6.
if (day < 0){
day = 6;
}
SFhour = SFhour + 24;
}
Zobrazit stránku 449
1 2 ... 445 446 447 448 449 450 451 452 453 454 455 ... 503 504

Komentáře k této Příručce

Žádné komentáře