diff options
Diffstat (limited to 'src/client/util.js')
| -rw-r--r-- | src/client/util.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/client/util.js b/src/client/util.js index 763623af..88226a4d 100644 --- a/src/client/util.js +++ b/src/client/util.js @@ -228,6 +228,12 @@ define(['jquery'], function($) { return ret; } + // String utilities + function capitalize(word) { + if (word.length == 0) return ''; + return word.slice(0, 1).toUpperCase() + word.slice(1, word.length); + } + // logging helpers function log_error(msg) { console.log('error: ' + msg); @@ -248,6 +254,8 @@ define(['jquery'], function($) { setSelection: setSelection, selectionStart: selectionStart, + capitalize: capitalize, + log_error: log_error, }; }); |
