summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/debug.js17
-rw-r--r--js/interface.js15
-rw-r--r--static/debug.css17
-rw-r--r--static/main.css14
4 files changed, 34 insertions, 29 deletions
diff --git a/js/debug.js b/js/debug.js
index b139ef9..3fab4c7 100644
--- a/js/debug.js
+++ b/js/debug.js
@@ -1,6 +1,5 @@
$().ready(function()
{
-
// send commands using ajax
$(".ajax").each(function(x) {
$(this).click(function() {
@@ -41,17 +40,26 @@ $().ready(function()
});
// sortable tables
+ // src: http://stackoverflow.com/questions/4126206/javascript-parsefloat-1-23e-7-gives-1-23e-7-when-need-0-000000123
+ $.tablesorter.addParser({
+ id: 'scinot',
+ is: function(s) {
+ return /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/.test(s);
+ },
+ format: function(s) {
+ return $.tablesorter.formatFloat(s);
+ },
+ type: 'numeric'
+ });
$("table.sortable").each(function(x) {
$(this).tablesorter({widgets: ['zebra']});
});
-
- // k-best list feature tables
$(".toggle").each(function(x) {
$(this).click(function() {
$(this).next().toggle();
})
});
- $("table.kbest_features tr:odd").css("background-color", "#eee");
+ $("table.kbest_features tr:odd").css("background-color", "#87cefa");
$("table.kbest_features tr:even").css("background-color", "#fff");
// display svg
@@ -65,6 +73,5 @@ $().ready(function()
$('<svg width="100%">'+d+'</svg>')
);
$("#original_svg").width($("#original_svg").children()[0].getBBox().width+"px");
-
});
diff --git a/js/interface.js b/js/interface.js
index 77a94bb..dbdba4e 100644
--- a/js/interface.js
+++ b/js/interface.js
@@ -89,7 +89,7 @@ var catch_return = function (e)
{
if (e.keyCode == 13) {
e.preventDefault();
- Next();
+ next();
}
return false;
@@ -281,10 +281,10 @@ var next = function ()
}
// confirm to server
- if (document.getElementById("init").value != "") {
+ /*if (document.getElementById("init").value != "") {
var xhr_confirm = create_cors_req('get', base_url+":"+port+"/confirm");
xhr_confirm.send(); // FIXME handle errors
- }
+ }*/
// build request
var xhr = create_cors_req('post', next_url);
@@ -293,8 +293,9 @@ var next = function ()
}
xhr.onerror = function (e) { alert("XHR ERRROR 1x " + e.target.status); }
xhr.send(JSON.stringify(send_data)); // send 'next' request
-
- poll(base_url+":"+port);
+ xhr.onload = function() {
+ poll(base_url+":"+port);
+ }
}
var request_and_process_next = function ()
@@ -473,7 +474,7 @@ var init_text_editor = function ()
* init site
*
*/
-window.onload = function ()
+$().ready(function()
{
// reset vars
document.getElementById("source").value = "";
@@ -498,5 +499,5 @@ window.onload = function ()
document.getElementById("textboxes").style.display = "block";
}
-};
+});
diff --git a/static/debug.css b/static/debug.css
index 57992eb..d24fb5b 100644
--- a/static/debug.css
+++ b/static/debug.css
@@ -1,8 +1,11 @@
body { margin:2em; background:#fff }
-a { color:blue; text-decoration:underline }
-a:hover { color:#000 }
+a { color:#000;text-decoration: underline }
h2 { padding:.25em; border-bottom:1px solid #000; border-top:1px solid #000 }
-tr:hover { background:#ccc }
+table {
+ margin-left:auto;
+ margin-right:auto
+}
+tr:hover { background:#ddd }
td { border-top:1px solid #000 }
td.noborder { border:0 }
td.left { text-align:left }
@@ -16,18 +19,14 @@ td.right { text-align:right }
.big { font-size:1.1em }
.mono { font-family:monospace }
.even { background:#fff }
-.odd { background:#eee }
+.odd { background: #ffffe0 }
.up { text-align:right;margin-right:1em }
#svg_b64,#original_svg_b64 { display:none }
#floater {
float:right;
border:1px solid #000;
- background:#eee;
+ background:#ffffe0;
padding:1em;
margin-top:5em
}
-table {
- margin-left:auto;
- margin-right:auto
-}
diff --git a/static/main.css b/static/main.css
index 47f5d6b..26ac814 100644
--- a/static/main.css
+++ b/static/main.css
@@ -33,7 +33,7 @@ textarea, input {
.tiny { font-size:.6em }
a {
- color: #ccc;
+ color: #ddd;
text-decoration: underline
}
a:hover { color: #000 }
@@ -74,7 +74,7 @@ span#status { float:right }
/* Derivation editor */
#derivation_editor input {
- background: #eee;
+ background: #ddd;
font-size: 60%;
padding: .4em
}
@@ -85,9 +85,9 @@ p#overview_header { margin:.5em;margin-bottom:.25em;font-weight:bold }
div#overview_wrapper { margin-top:1em }
table#overview { font-size:.8em }
table#overview td.seg_text { width: 45% }
-table#overview td { border-bottom: 1px solid #ccc; border-left:1px solid #ccc; padding: .25em }
-table#overview tr:hover { background: #ccc }
-table#overview .doc_title { background-color: #eee }
+table#overview td { border-bottom: 1px solid #ddd; border-left:1px solid #ddd; padding: .25em }
+table#overview tr:hover { background: #ddd }
+table#overview .doc_title { background-color: #ddd }
table#overview td.num { text-align:right; font-style:italic }
/* /Session overview */
@@ -119,8 +119,6 @@ div#help {
width: 70%;
text-align: justify
}
-div#help a { color:#ccc }
-div#help:hover { color: #000 }
-div#help:hover a { color: #000 }
+div#help a { color:#000;text-decoration:underline }
/* /Help */