summaryrefslogtreecommitdiff
path: root/js/debug.js
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2016-02-03 15:33:02 +0100
committerPatrick Simianer <p@simianer.de>2016-02-03 15:33:02 +0100
commitfee5d5a36f373f6d1f02bbddfbfa960f3af2f9dd (patch)
treec40f5a3bc0fa48e65935a9c5ce44759ac7a2cb57 /js/debug.js
parenteab3faa76a9ad712ae43cbdd574cc7436b9e2e2a (diff)
css, tablesorter scientific notation
Diffstat (limited to 'js/debug.js')
-rw-r--r--js/debug.js17
1 files changed, 12 insertions, 5 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");
-
});