site: chrome 52+ workaround for broken algo redirect

Since recently Chrome doesnt refresh anymore the page on goback();
This commit is contained in:
Tanguy Pruvot 2016-08-21 18:59:51 +02:00
parent 1b4d4c788d
commit defe4f9036
5 changed files with 11 additions and 16 deletions

View file

@ -1022,7 +1022,11 @@ class SiteController extends CommonController
else
user()->setState('yaamp-algo', 'all');
$this->goback();
$route = getparam('r');
if (!empty($route))
$this->redirect($route);
else
$this->goback();
}
public function actionGomining()

View file

@ -133,7 +133,7 @@ function page_refresh()
function select_algo(algo)
{
window.location.href = '/site/algo?algo='+algo;
window.location.href = '/site/algo?algo='+algo+'&r=/';
}
////////////////////////////////////////////////////

View file

@ -48,7 +48,7 @@ function page_refresh()
function select_algo(algo)
{
window.location.href = '/site/algo?algo='+algo;
window.location.href = '/site/algo?algo='+algo+'&r=/site/miners';
}
////////////////////////////////////////////////////

View file

@ -1,7 +1,5 @@
<?php
$algo = user()->getState('yaamp-algo');
JavascriptFile("/extensions/jqplot/jquery.jqplot.js");
JavascriptFile("/extensions/jqplot/plugins/jqplot.dateAxisRenderer.js");
JavascriptFile("/extensions/jqplot/plugins/jqplot.barRenderer.js");
@ -18,9 +16,8 @@ if($user)
$coin = getdbo('db_coins', $user->coinid);
if($coin) echo <<<END
<script>
$(function()
{
<script type="text/javascript">
$(function() {
$('#favicon').remove();
$('head').append('<link href="$coin->image" id="favicon" rel="shortcut icon">');
});
@ -31,12 +28,6 @@ END;
$user->hostaddr = $_SERVER['REMOTE_ADDR'];
$user->save();
}
// if(!$this->admin && count($recents) > 5)
// {
// debuglog("$user->id, $user->username, $user->balance");
// debuglog($recents);
// }
}
$username = $user? $user->username: '';
@ -175,7 +166,7 @@ function page_refresh()
function select_algo(algo)
{
window.location.href = '/site/algo?algo='+algo;
window.location.href = '/site/algo?algo='+algo+'&r=/site/mining';
}
////////////////////////////////////////////////////

View file

@ -94,7 +94,7 @@ Select Algo: <select id='algo_select'>$string</select>&nbsp;
$('#algo_select').change(function(event)
{
var algo = $('#algo_select').val();
window.location.href = '/site/algo?algo='+algo;
window.location.href = '/site/algo?algo='+algo+'&r=/stats';
});
</script>