diff options
| author | Alon Levy <alon@pobox.com> | 2015-03-01 11:49:37 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-03-01 11:49:37 +0200 |
| commit | 2c7b698707ea7bcb894cb3254bb55d94e468b0de (patch) | |
| tree | 1b2e291335ab78d50bd539710e57c2eef189bdb0 /src | |
| parent | 27837b700386586100b7f588fed62e7a23e02167 (diff) | |
client/rz_api_backend: shorten ajax_success print to one line
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/rz_api_backend.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/client/rz_api_backend.js b/src/client/rz_api_backend.js index 4d9d23b5..e2ff41ea 100644 --- a/src/client/rz_api_backend.js +++ b/src/client/rz_api_backend.js @@ -5,6 +5,13 @@ */ define([], function() { + function shorten(str, max_length) { + if (str.length < max_length) { + return str; + } + return str.substr(0, max_length - 3) + '...'; + } + function RZ_API_Backend() { var rz_server_url = 'http://%h:%p'; @@ -34,7 +41,7 @@ define([], function() { on_error(ret_error); } } else { - console.log('ajax success: ' + JSON.stringify(ret_data)); + console.log('ajax success: ' + shorten(JSON.stringify(ret_data), 50)); if (on_success) { on_success(ret_data); } |
