Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: ui/webui/resources/js/util.js

Issue 132013002: Replace own callback handling with Promises. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 <include src="assert.js"> 5 <include src="assert.js">
6 6
7 /** 7 /**
8 * The global object. 8 * The global object.
9 * @type {!Object} 9 * @type {!Object}
10 * @const 10 * @const
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 * |maxLength|. 400 * |maxLength|.
401 * @param {string} original The original string. 401 * @param {string} original The original string.
402 * @param {number} maxLength The maximum length allowed for the string. 402 * @param {number} maxLength The maximum length allowed for the string.
403 * @return {string} The original string if its length does not exceed 403 * @return {string} The original string if its length does not exceed
404 * |maxLength|. Otherwise the first |maxLength| - 3 characters with '...' 404 * |maxLength|. Otherwise the first |maxLength| - 3 characters with '...'
405 * appended. 405 * appended.
406 */ 406 */
407 function elide(original, maxLength) { 407 function elide(original, maxLength) {
408 if (original.length <= maxLength) 408 if (original.length <= maxLength)
409 return original; 409 return original;
410 return original.substring(0, maxLength - 3) + '...'; 410 return original.substring(0, maxLength - 3) + '\u2026';
Bernhard Bauer 2014/01/10 13:52:08 Now that you use a single character for the ellips
Adrian Kuegel 2014/01/10 16:52:01 Done.
411 } 411 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698