diff options
author | Patrick Simianer <p@simianer.de> | 2016-02-18 14:18:02 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2016-02-18 14:18:02 +0100 |
commit | d783b8e209ebe1e4bcb2725466e3cc82e62f2784 (patch) | |
tree | bd74ea5be16d131b1681f803375bac925fafd7f2 /js/debug.js | |
parent | 53e8b1106a1ebaf13a5482477b67e04aacd4405d (diff) |
tidy
Diffstat (limited to 'js/debug.js')
-rw-r--r-- | js/debug.js | 33 |
1 files changed, 16 insertions, 17 deletions
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]); }); |