Ignore:
Timestamp:
Feb 11, 2012, 10:43:06 AM (13 years ago)
Author:
chronos
Message:
  • Upraveno: Periodické načítání obrázků kamery se nyní provádí na pozadí kvůli zamezení problikávání.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Pages/UWebCamPage.pas

    r67 r71  
    4040  I: Integer;
    4141  Id: Integer;
     42  LastFileDate: string;
    4243  ImageWidth, ImageHeight: string;
    4344begin
     
    115116
    116117        if FileExists(WebCamImage) then begin
     118        DateTimeToString(LastFileDate, 'hh:mm:ss d.m.yyyy', FileDateToDateTime(FileAge(WebCamImage)));
    117119        Text := Text + '<script language="JavaScript">' + #13#10 +
    118120        '  var ImageURL= "' + NavigationLink('/' + WebCamImage) + '";' + #13#10 +
     
    129131        '  // The above dummy cgi-parameter enforce a bypass of the browser image cache.' + #13#10 +
    130132        '  // Here we actually load the image' + #13#10 +
    131         '  document.theImage.src = url;' + #13#10 +
     133        '  document.theImage.src = document.theImageTemp.src;' + #13#10 +
     134        '  document.theImageTemp.src = url;' + #13#10 +
    132135        '' + #13#10 +
    133136        '  // Reload the image every defined period' + #13#10 +
     
    137140
    138141        '<br /><div align="center">' + DbRows[0].Values['Name'] + '<br/>' +
    139         '<img name="theImage" src="" width="' + ImageWidth + '" height="' + ImageHeight + '" alt="' +
    140         DbRows[0].Values['Name'] + '"/><br/>Aktualizace: ' +
    141           DateTimeToStr(FileDateToDateTime(FileAge(WebCamImage))) + ' Perioda: ' +
    142           IntToStr(RefreshInterval) + ' sekund Typ: ' + DbRows[0].Values['DeviceType'] + '<br />' +
     142        '<img name="theImageTemp" src="' + NavigationLink('/' + WebCamImage) + '" width="0" height="0" alt="Temp image"/>' +
     143        '<img name="theImage" src="' + NavigationLink('/' + WebCamImage) + '" width="' + ImageWidth + '" height="' + ImageHeight + '" alt="' +
     144        DbRows[0].Values['Name'] + '"/><br/>Aktualizace: <span id="lasttime">' +
     145          LastFileDate + '</span>, Perioda: ' +
     146          IntToStr(RefreshInterval) + ' sekund, Typ: ' + DbRows[0].Values['DeviceType'] + '<br />' +
    143147          '<br/>' + DbRows[0].Values['Description'] + '</div>';
    144148        end else Text := Text + '<br />Obrázek nenalezen.<br /><br />';
Note: See TracChangeset for help on using the changeset viewer.