diff options
-rw-r--r-- | index.php | 4 | ||||
-rw-r--r-- | js/debug.js | 33 |
2 files changed, 18 insertions, 19 deletions
@@ -15,8 +15,8 @@ <input type="text" id="key" name="key" style="width:20em" /> Session type: <select name="ui_type"> - <option value="t">text</option> <option value="g">graphical</option> + <option value="t">text</option> </select> <input type="submit" value="Submit" /> @@ -45,8 +45,8 @@ </optgroup> <optgroup label="Session C"> - <option value="product_en-de_beta_test_C" onclick="document.getElementById('key').value=this.value;">en-de</option> <option value="product_de-en_beta_test_C" onclick="document.getElementById('key').value=this.value;">de-en</option> + <option value="product_en-de_beta_test_C" onclick="document.getElementById('key').value=this.value;">en-de</option> <!-- <option value="product_en-de_beta_test_1_C" onclick="document.getElementById('key').value=this.value;">C* en-de</option> <option value="product_de-en_beta_test_1_C" onclick="document.getElementById('key').value=this.value;">C* de-en</option>--> </optgroup> 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]); }); |