]> git.sesse.net Git - remoteglot/commitdiff
Remove the score padding; it made sense when a terminal was our primary output, but...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 22 Mar 2016 17:26:29 +0000 (18:26 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 22 Mar 2016 17:26:29 +0000 (18:26 +0100)
www/js/remoteglot.js

index b6076f4006e9d87034d553c6e7556031802fcff7..0a4366cbf801180b79ab5eef25a1c515bca784fd 100644 (file)
@@ -1905,14 +1905,6 @@ var onSnapEnd = function(source, target) {
 }
 // End of dragging-related code.
 
 }
 // End of dragging-related code.
 
-var pad = function(val, num_digits) {
-       var s = val.toString();
-       while (s.length < num_digits) {
-               s = " " + s;
-       }
-       return s;
-}
-
 var fmt_cp = function(v) {
        if (v === 0) {
                return "0.00";
 var fmt_cp = function(v) {
        if (v === 0) {
                return "0.00";
@@ -1930,9 +1922,9 @@ var format_short_score = function(score) {
        }
        if (score[0] === 'm') {
                if (score[2]) {  // Is a bound.
        }
        if (score[0] === 'm') {
                if (score[2]) {  // Is a bound.
-                       return score[2] + "\u00a0M" + pad(score[1], 3);
+                       return score[2] + "\u00a0M " + score[1];
                } else {
                } else {
-                       return "M" + pad(score[1], 3);
+                       return "M " + score[1];
                }
        } else if (score[0] === 'd') {
                return "TB draw";
                }
        } else if (score[0] === 'd') {
                return "TB draw";
@@ -1940,7 +1932,7 @@ var format_short_score = function(score) {
                if (score[2]) {  // Is a bound.
                        return score[2] + "\u00a0" + fmt_cp(score[1]);
                } else {
                if (score[2]) {  // Is a bound.
                        return score[2] + "\u00a0" + fmt_cp(score[1]);
                } else {
-                       return pad(fmt_cp(score[1]), 5);
+                       return fmt_cp(score[1]);
                }
        }
        return null;
                }
        }
        return null;