Updated: animated spinner logic

This commit is contained in:
bergware
2020-02-10 19:13:50 +01:00
parent f7436d8ae8
commit 1a67bde674

View File

@@ -77,7 +77,7 @@ function toggle(checked) {
function resize() {
$('pre.up').height(Math.max(window.innerHeight-320,330));
}
function showLog(log) {
function showLog(log,init) {
logfile = log;
$('span.label input[type=checkbox]').prop('checked',true);
$('span.label').each(function(){
@@ -90,21 +90,13 @@ function showLog(log) {
$('pre.up').html(data);
<?if ($display['resize']):?>
resize();
if (init) $(window).bind('resize',function(){resize();});
<?endif;?>
$('div.spinner.fixed').hide('slow');
});
}
$(function() {
timers.syslog = setTimeout(function(){$('div.spinner.fixed').show('slow');},150);
$.post('/webGui/include/Syslog.php',{log:'<?=$log?>'},function(data){
clearTimeout(timers.syslog);
$('pre.up').html(data);
<?if ($display['resize']):?>
resize();
$(window).bind('resize',function(){resize();});
<?endif;?>
$('div.spinner.fixed').hide('slow');
});
showLog(logfile,true);
});
$('.tabs').append("<span class='status'><?=$select?><span class='lite label'><label>Text<input type='checkbox' class='ctrl' onclick='highlight(!this.checked,\"N\")' checked></label></span><span class='error label'><label>Error<input type='checkbox' onclick='highlight(this.checked,\"E\")' checked></label></span><span class='warn label'><label>Warning<input type='checkbox' onclick='highlight(this.checked,\"W\")' checked></label></span><span class='system label'><label>System<input type='checkbox' onclick='highlight(this.checked,\"S\")' checked></label></span><span class='array label'><label>Array<input type='checkbox' onclick='highlight(this.checked,\"A\")' checked></label></span><span class='login label'><label>Login<input type='checkbox' onclick='highlight(this.checked,\"L\")' checked></label></span><span class='lite label'><input type='checkbox' class='ctrl' onclick='toggle(this.checked)' checked></span></span>");
</script>