X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-live.git;a=blobdiff_plain;f=yarrg%2Fweb%2Fquery_age;h=4f8ba814b7f1e5ddf2b0ce0fc22549ad560b728d;hp=7cfe54e291799e6c8daa53ec0207c0f4d37eeead;hb=66b7b921f50bc3242a7e45a63a94391bcebf7cb9;hpb=1da4d6e0bbabfb308c1cc5d1e08a2712ce647259 diff --git a/yarrg/web/query_age b/yarrg/web/query_age index 7cfe54e..4f8ba81 100644 --- a/yarrg/web/query_age +++ b/yarrg/web/query_age @@ -52,6 +52,7 @@ my $sth= $dbh->prepare("SELECT archipelago, islandid, islandname, timestamp $sth->execute(); +
<& SELF:pageload &> <%method pageload> @@ -69,19 +70,17 @@ $sth->execute(); $now $fetchrow - +
% my $row; % my %da_ages; % my %ts_sortkeys; % $da_ages{'id_loaded'}= 0; % my $rowix= 0; % while ($row= $fetchrow->()) { -% print STDERR "$row\n"; % my $rowid= "id_$row->{'islandid'}"; % my $cellid= "c$rowid"; % my $age= $now - $row->{'timestamp'}; @@ -124,6 +123,7 @@ Time since this page loaded: var now= Date.now(); debug('updating now='+now); for (var ageid in <% $jsprefix %>ages) { + if (!<% $jsprefix %>ages.hasOwnProperty(ageid)) continue; var oldage= <% $jsprefix %>ages[ageid]; var el= document.getElementById(<% $elemidprefix %>ageid); var age= oldage + (now - da_pageload) / 1000; @@ -142,6 +142,7 @@ Time since this page loaded: <& "lookup:formhidden", ours => sub { 0; } &> + <%init> use POSIX; use CommodsWeb;
Archipelago Island Age -