summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2016-02-18 14:18:02 +0100
committerPatrick Simianer <p@simianer.de>2016-02-18 14:18:02 +0100
commitd783b8e209ebe1e4bcb2725466e3cc82e62f2784 (patch)
treebd74ea5be16d131b1681f803375bac925fafd7f2
parent53e8b1106a1ebaf13a5482477b67e04aacd4405d (diff)
tidy
-rw-r--r--index.php4
-rw-r--r--js/debug.js33
2 files changed, 18 insertions, 19 deletions
diff --git a/index.php b/index.php
index d10bc2e..d01caf1 100644
--- a/index.php
+++ b/index.php
@@ -15,8 +15,8 @@
<input type="text" id="key" name="key" style="width:20em" />
&nbsp;&nbsp;&nbsp;&nbsp;Session type:
<select name="ui_type">
- <option value="t">text</option>
<option value="g">graphical</option>
+ <option value="t">text</option>
</select>
&nbsp;&nbsp;&nbsp;&nbsp;
<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]);
});