summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6aa2de5)
raw | patch | inline | side by side (parent: 6aa2de5)
author | Stephen Boyd <bebarino@gmail.com> | |
Wed, 25 Nov 2009 03:51:40 +0000 (19:51 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 25 Nov 2009 08:06:32 +0000 (00:06 -0800) |
It seems that in Firefox-3.5 inserting with javascript inserts the
literal instead of a space. Fix this by inserting the unicode
representation for instead.
Also fix the off-by-one error in the padding calculation that was
causing one less space to be inserted than was requested by the caller.
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Cc: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
literal instead of a space. Fix this by inserting the unicode
representation for instead.
Also fix the off-by-one error in the padding calculation that was
causing one less space to be inserted than was requested by the caller.
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Cc: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gitweb/gitweb.js | patch | blob | history |
diff --git a/gitweb/gitweb.js b/gitweb/gitweb.js
index 5292c37d2ccfb6e9d93cf284d7da215932f1a5b1..2a25b7cc470a25572e8741803b4e7124933feff5 100644 (file)
--- a/gitweb/gitweb.js
+++ b/gitweb/gitweb.js
/**
* pad number N with nonbreakable spaces on the left, to WIDTH characters
- * example: padLeftStr(12, 3, ' ') == ' 12'
- * (' ' is nonbreakable space)
+ * example: padLeftStr(12, 3, '\u00A0') == '\u00A012'
+ * ('\u00A0' is nonbreakable space)
*
* @param {Number|String} input: number to pad
* @param {Number} width: visible width of output
- * @param {String} str: string to prefix to string, e.g. ' '
+ * @param {String} str: string to prefix to string, e.g. '\u00A0'
* @returns {String} INPUT prefixed with (WIDTH - INPUT.length) x STR
*/
function padLeftStr(input, width, str) {
var prefix = '';
width -= input.toString().length;
- while (width > 1) {
+ while (width > 0) {
prefix += str;
width--;
}
if (div_progress_info) {
div_progress_info.firstChild.data = blamedLines + ' / ' + totalLines +
- ' (' + padLeftStr(percentage, 3, ' ') + '%)';
+ ' (' + padLeftStr(percentage, 3, '\u00A0') + '%)';
}
if (div_progress_bar) {