Changeset 35
- Timestamp:
- Sep 26, 2010, 5:39:23 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/UCustomApplication.pas
r34 r35 227 227 '<li>' + MakeLink('Odkazy', NavigationLink('/odkazy/')) + '</li>' + 228 228 '<li>' + MakeLink('Kontakt', NavigationLink('/kontakt/')) + '</li>' + 229 '<li>' + MakeLink('Kamery', NavigationLink('/kamery/')) + '</li>' + 229 230 '<li><a href="https://mail.zdechov.net/">Pošta</a></li>' + 230 231 '<li><a href="http://wiki.zdechov.net/">Wiki</a></li>' + -
trunk/CGI.lpr
r33 r35 24 24 RegisterPage('kontakt', Contact); 25 25 RegisterPage('serverinfo', ServerInfo); 26 RegisterPage('kamery', WebCam); 26 27 RegisterPage('', About); 27 28 HTTPServer := THTTPServerCGI.Create; -
trunk/Pages/UMainPage.pas
r33 r35 18 18 procedure Contact(App: TCustomApplication; HandlerData: THTTPHandlerData); 19 19 procedure ServerInfo(App: TCustomApplication; HandlerData: THTTPHandlerData); 20 procedure WebCam(App: TCustomApplication; HandlerData: THTTPHandlerData); 20 21 21 22 implementation … … 114 115 '<br/>' + 115 116 '<i>Aktualizováno: 1.7.2010</i>'; 117 end; 118 end; 119 end; 120 121 procedure WebCam(App: TCustomApplication; HandlerData: THTTPHandlerData); 122 const 123 WebCamImage = 'images/webcam/webcam.jpg'; 124 RefreshInterval = 1; 125 begin 126 with App do begin 127 HtmlDocument.Title := 'Webové kamery'; 128 129 with HtmlDocument.Body, THtmlString(SubItems[SubItems.Add(THtmlString.Create)]) do begin 130 Text := '<table style="width: 100%"><tr><td style="width: 20%">' + 131 '<strong>Kamery v okolí:</strong><br />' + 132 '<a href="http://www.mestovsetin.cz/vismo/dokumenty2.asp?id_org=18676&id=480245">Vsetínské kamery</a><br />' + 133 '<a href="http://www.huslenky.cz/?page=kamery&I=2">Kamery v Huslenkách</a><br/>' + 134 '<a href="http://kamery.hovnet.cz/">Kamery v Hovnetu</a><br/>' + 135 '</td><td style="width: 80%">'; 136 137 if FileExists(WebCamImage) then begin 138 Text := Text + '<script language="JavaScript">' + #13#10 + 139 ' var ImageURL = "' + NavigationLink('/' + WebCamImage) + '";' + #13#10 + 140 '' + #13#10 + 141 '// Force an immediate image load' + #13#10 + 142 'var theTimer = setTimeout("reloadImage()", 1);' + #13#10 + 143 '' + #13#10 + 144 'function reloadImage()' + #13#10 + 145 '{' + #13#10 + 146 ' theDate = new Date();' + #13#10 + 147 ' var url = ImageURL;' + #13#10 + 148 ' url += "?dummy=";' + #13#10 + 149 ' url += theDate.getTime().toString(10);' + #13#10 + 150 ' // The above dummy cgi-parameter enforce a bypass of the browser image cache.' + #13#10 + 151 ' // Here we actually load the image' + #13#10 + 152 ' document.theImage.src = url;' + #13#10 + 153 '' + #13#10 + 154 ' // Reload the image every defined period' + #13#10 + 155 ' theTimer = setTimeout("reloadImage()", ' + IntToStr(RefreshInterval * 1000) + ');' + #13#10 + 156 '}' + #13#10 + 157 '</script>' + #13#10 + 158 159 '<br /><div align="center"><img name="theImage" src="" idth="640" height="480" alt="Webcam image"><br>Poslední aktualizace: ' + 160 DateTimeToStr(FileDateToDateTime(FileAge(WebCamImage))) + '<br>Obnovování po ' + IntToStr(RefreshInterval) + ' sekundách</div><br />'; 161 end else Text := '<br />Obrázek nenalezen.<br /><br />'; 162 Text := Text + '</td></tr></table>'; 116 163 end; 117 164 end;
Note:
See TracChangeset
for help on using the changeset viewer.