aboutsummaryrefslogtreecommitdiff
path: root/gitweb/static/js/lib/common-lib.js
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2011-04-28 21:04:02 +0200
committerJunio C Hamano <gitster@pobox.com>2011-05-24 11:22:44 -0700
commite2895de4d8efef52e835731aaaaa9467e2110e62 (patch)
tree77b248b1d760928c1e26321e4fa015ae6cef8453 /gitweb/static/js/lib/common-lib.js
parent9a86dd571058a511e60af35206a31017d873e54a (diff)
downloadgit-e2895de4d8efef52e835731aaaaa9467e2110e62.tar.gz
git-e2895de4d8efef52e835731aaaaa9467e2110e62.tar.xz
gitweb.js: Update and improve comments in JavaScript files
This consists of adding a few extra explanation, fixing descriptions of functions to match names of parameters in code, adding a few separators, and fixing spelling -- while at it spell 'neighbor' using American spelling (and not as 'neighbour'). This is post-split cleanup. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb/static/js/lib/common-lib.js')
-rw-r--r--gitweb/static/js/lib/common-lib.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/gitweb/static/js/lib/common-lib.js b/gitweb/static/js/lib/common-lib.js
index 38f3b9e14..6a6d2000c 100644
--- a/gitweb/static/js/lib/common-lib.js
+++ b/gitweb/static/js/lib/common-lib.js
@@ -13,14 +13,17 @@
/* Padding */
/**
- * pad number N with nonbreakable spaces on the left, to WIDTH characters
+ * pad INPUT on the left with STR that is assumed to have visible
+ * width of single character (for example nonbreakable spaces),
+ * to WIDTH characters
+ *
* 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. '\u00A0'
- * @returns {String} INPUT prefixed with (WIDTH - INPUT.length) x STR
+ * @returns {String} INPUT prefixed with STR x (WIDTH - INPUT.length)
*/
function padLeftStr(input, width, str) {
var prefix = '';
@@ -34,7 +37,7 @@ function padLeftStr(input, width, str) {
}
/**
- * Pad INPUT on the left to SIZE width, using given padding character CH,
+ * Pad INPUT on the left to WIDTH, using given padding character CH,
* for example padLeft('a', 3, '_') is '__a'.
*
* @param {String} input: input value converted to string.
@@ -140,7 +143,8 @@ var maybeQuotedRe = /^\"(.*)\"$/;
/**#@-*/
/**
- * unquote maybe git-quoted filename
+ * unquote maybe C-quoted filename (as used by git, i.e. it is
+ * in double quotes '"' if there is any escape character used)
* e.g. 'aa' -> 'aa', '"a\ta"' -> 'a a'
*
* @param {String} str: git-quoted string