From d783b8e209ebe1e4bcb2725466e3cc82e62f2784 Mon Sep 17 00:00:00 2001 From: Patrick Simianer
Date: Thu, 18 Feb 2016 14:18:02 +0100 Subject: tidy --- js/debug.js | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'js/debug.js') diff --git a/js/debug.js b/js/debug.js index cd5882b..9d83be7 100644 --- a/js/debug.js +++ b/js/debug.js @@ -1,4 +1,4 @@ -var poll = function (url_prefix) +var poll_debug = function (url_prefix) { setTimeout(function(){ $.get(url_prefix+"/status_debug").done(function(response){ @@ -28,7 +28,7 @@ $().ready(function() { $("#features_value_get").focusout(function() { if (this.value == "") this.value = "1e-05"; }); $("#feature_groups_value").click(function() { this.value = ""; }); $("#feature_groups_value").focusout(function() { if (this.value == "") this.value = "1e-05"; }); - // set all sorts of learning rates + // set/get all sorts of learning rates $("#set_features").click(function() { k = $("#features").val(); v = $("#features_value").val(); @@ -52,6 +52,18 @@ $().ready(function() { }}); } }); + $("#get_features").click(function () { + $.get("http://"+document.URL.split("/")[2]+$("#features_type_get").val()+"/"+$("#features_get").val(), + function (data) { + $("#features_value_get").val(data); + }); + }); + $("#get_feature_groups").click(function () { + $.get("http://"+document.URL.split("/")[2]+"/get_rate/"+$("#feature_groups_get").val(), + function (data) { + $("#feature_groups_value_get").val(data); + }); + }); // sortable tables // src: http://stackoverflow.com/questions/4126206/javascript-parsefloat-1-23e-7-gives-1-23e-7-when-need-0-000000123 @@ -93,21 +105,8 @@ $().ready(function() { $(".updated").each(function(i,el){$(el).addClass("stale")}) } - poll("http://"+document.URL.split("/")[2]); - - $("#get_features").click(function () { - $.get("http://"+document.URL.split("/")[2]+$("#features_type_get").val()+"/"+$("#features_get").val(), - function (data) { - $("#features_value_get").val(data); - }); - }); - - $("#get_feature_groups").click(function () { - $.get("http://"+document.URL.split("/")[2]+"/get_rate/"+$("#feature_groups_get").val(), - function (data) { - $("#feature_groups_value_get").val(data); - }); - }); + // get current status + input ID + poll_debug("http://"+document.URL.split("/")[2]); }); -- cgit v1.2.3