From 23003142804e27afa5ad850b4e38fa283dfd3468 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Sun, 1 May 2016 07:52:02 +0200 Subject: [PATCH] wallet: enhance graph ajax refresh and resize prevent graph flicker on ajax refresh, only reload data after 5mn and/or when the browser window is resized. should reduce a bit the browser cpu usage... --- web/yaamp/core/backend/system.php | 2 +- web/yaamp/modules/site/coin.php | 14 +++++----- web/yaamp/modules/site/coin_market_graph.php | 27 +++++++++++++++----- web/yaamp/modules/site/coin_results.php | 7 ----- 4 files changed, 30 insertions(+), 20 deletions(-) diff --git a/web/yaamp/core/backend/system.php b/web/yaamp/core/backend/system.php index 8531741..84c132d 100644 --- a/web/yaamp/core/backend/system.php +++ b/web/yaamp/core/backend/system.php @@ -47,7 +47,7 @@ function BackendQuickClean() function marketHistoryPrune($symbol="") { $delay2M = settings_get("history_prune_delay", time() - 61*24*60*60); // 2 months - dborun("DELETE FROM market_history WHERE time < $delay2M"); + dborun("DELETE FROM market_history WHERE time < ".intval($delay2M)); // Prune records older than 1 week, one max per hour $delay7D = time() - 7*24*60*60; diff --git a/web/yaamp/modules/site/coin.php b/web/yaamp/modules/site/coin.php index 69cc25a..746f39f 100644 --- a/web/yaamp/modules/site/coin.php +++ b/web/yaamp/modules/site/coin.php @@ -55,8 +55,6 @@ echo << -
- +
+ end; -JavascriptReady("graph_refresh(); $(window).resize(graph_refresh);"); \ No newline at end of file +// JavascriptReady("$(window).resize(graph_resized);"); \ No newline at end of file diff --git a/web/yaamp/modules/site/coin_results.php b/web/yaamp/modules/site/coin_results.php index 7710bc6..b567125 100644 --- a/web/yaamp/modules/site/coin_results.php +++ b/web/yaamp/modules/site/coin_results.php @@ -179,9 +179,6 @@ if(!$info) echo ''.bitcoinvaluetoa($coin->price).''; echo ''; echo "
"; - if (yaamp_watched_coin($coin->symbol)) { - $this->renderPartial('coin_market_graph', array('coin'=>$coin)); - } return; } @@ -430,7 +427,3 @@ if (empty($sums)) { } echo ''; - -if (yaamp_watched_coin($coin->symbol)) { - $this->renderPartial('coin_market_graph', array('coin'=>$coin)); -}