From 6176389a10800bc22afa4c26c389f52913c35f2d Mon Sep 17 00:00:00 2001 From: Heikki Hannikainen Date: Thu, 4 Aug 2016 00:39:00 +0300 Subject: [PATCH] status: Remove dead code --- src/web/aprsc-graph.js | 5 +-- src/web/aprsc.js | 72 ------------------------------------------ 2 files changed, 3 insertions(+), 74 deletions(-) diff --git a/src/web/aprsc-graph.js b/src/web/aprsc-graph.js index 35e3643..c02517f 100644 --- a/src/web/aprsc-graph.js +++ b/src/web/aprsc-graph.js @@ -45,7 +45,6 @@ var graph_module = angular.module('graph', [ ]). }; instance.load_graph_success = function(data) { - top_status(); var d = instance.graphs_available[this.k]; instance.graph_fill(data, d); instance.schedule_graph(60000); @@ -54,12 +53,14 @@ var graph_module = angular.module('graph', [ ]). }; instance.load_graph_error = function(jqXHR, stat, errorThrown) { + /* var msg = 'Graph data download failed (' + stat + '). Server or network down?'; if (errorThrown) msg += '
HTTP error: ' + htmlent(errorThrown); - top_status('msg_e', msg); + instance.scope.uierror = msg_e; + */ instance.schedule_graph(60000); }; diff --git a/src/web/aprsc.js b/src/web/aprsc.js index 5ef60b4..b4cf67c 100644 --- a/src/web/aprsc.js +++ b/src/web/aprsc.js @@ -2,16 +2,6 @@ var options = {}; -function top_status(c, s) -{ - if (!c) { - $('#status').hide('fast'); - return; - } - - $('#status').hide().html('
' + s + '
').show('fast'); -} - function isUndefined(v) { var undef; @@ -314,70 +304,8 @@ function render(d) } -var next_req_timer; - -function schedule_update() -{ - if (next_req_timer) - clearTimeout(next_req_timer); - - next_req_timer = setTimeout(update_status, 10000); -} - var current_status; -function update_success(data) -{ - if (next_req_timer) { - clearTimeout(next_req_timer); - next_req_timer = 0; - } - - top_status(); - /* If this is the first successful status download, motd needs to be - * updated too. - */ - if (!current_status) { - current_status = data; - motd_check(); - } else { - current_status = data; - } - render(data); - schedule_update(); -} - -function update_status() -{ - if (next_req_timer) { - clearTimeout(next_req_timer); - next_req_timer = 0; - } - - $.ajax({ - url: '/status.json', - dataType: 'json', - cache: false, - timeout: 5000, - error: function(jqXHR, stat, errorThrown) { - var msg = ''; - if (stat == 'timeout') - msg = 'Status download timed out. Network or server down?'; - else if (stat == 'error') - msg = 'Status download failed with an error. Network or server down?'; - else - msg = 'Status download failed (' + stat + ').'; - - if (errorThrown) - msg += '
HTTP error: ' + htmlent(errorThrown); - - top_status('msg_e', msg); - - schedule_update(); - }, - success: update_success - }); -} var motd_last;