Skip to content

Commit

Permalink
speed up lazyload
Browse files Browse the repository at this point in the history
  • Loading branch information
deemru committed Nov 9, 2019
1 parent bc9966e commit d8d5407
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@
$uid = $call['u'];
$address = $call['a'];

echo '<pre>';
w8io_print_transactions( $aid, $where, $uid, 100, $address, false === strpos( $where, 'asset' ) );
echo '</pre>';
return;
}
}
Expand Down Expand Up @@ -213,11 +215,10 @@ function lazyload()
g_loading = true;
$.get( g_lazyload.attr( "url" ), null, function( data )
{
g_lazyload.remove();
if( data )
{
$(".base").append( data );
$( data ).insertAfter( g_lazyload );
g_lazyload.remove();
g_lazyload = $(".lazyload");
if( g_lazyload.length )
Expand Down Expand Up @@ -259,6 +260,10 @@ function lazyload()
border: 0;
background-color: #606870;
}
pre
{
margin: 0;
}
</style>
</head>
<body>
Expand Down Expand Up @@ -371,7 +376,7 @@ function w8io_print_transactions( $aid, $where, $uid, $count, $address, $spam =
'a' => $address,
];
$call = W8IO_ROOT . 'api/' . $wk->base58Encode( $wk->encryptash( json_encode( $call ) ) );
echo '<pre class="lazyload" url="' . $call . '">...</pre>';
echo '</pre><pre class="lazyload" url="' . $call . '">...';
return;
}

Expand Down Expand Up @@ -743,13 +748,13 @@ function txproc( &$tx )
$assetId = $address === 'WAVES' ? 0 : $api->get_asset( $address );
if( $assetId === false )
{
echo '<pre class="base">';
echo '<pre>';
w8io_print_transactions( false, $where, false, 100, $address, !( $f === 'f' ) );
echo '</pre>';
}
else
{
echo '<pre class="base">';
echo '<pre>';
w8io_print_distribution( $assetId );
echo '</pre>';
}
Expand All @@ -766,7 +771,7 @@ function txproc( &$tx )
$balance = $balance['balance'];
$full_address = $full_address !== $address ? " / <a href=\"". W8IO_ROOT . $full_address ."\">$full_address</a>" : '';

echo "<a href=\"". W8IO_ROOT . $address ."\">$address</a>$full_address @ $height" . PHP_EOL;
echo "<a href=\"". W8IO_ROOT . $address ."\">$address</a>$full_address @ $height" . PHP_EOL . PHP_EOL;
echo '<table><tr><td valign="top"><pre>';

$tickers = [];
Expand Down Expand Up @@ -861,7 +866,7 @@ function txproc( &$tx )
echo "$bs{$record['amount']} <a href=\"{$record['furl']}\">{$record['asset']}</a>$be" . PHP_EOL;
}

echo '</pre></td><td valign="top"><pre class="base">';
echo '</pre></td><td valign="top"><pre>';

if( $f !== 'pay' )
w8io_print_transactions( $aid, $where, false, 100, $address, !( $f === 'f' ) );
Expand Down

0 comments on commit d8d5407

Please sign in to comment.