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

Side by Side Diff: chrome/browser/resources/file_manager/js/util.js

Issue 8776003: [filebrowser] Change file sizes to KB, MB, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 /** 5 /**
6 * Namespace for utility functions. 6 * Namespace for utility functions.
7 */ 7 */
8 var util = { 8 var util = {
9 /** 9 /**
10 * Returns a function that console.log's its arguments, prefixed by |msg|. 10 * Returns a function that console.log's its arguments, prefixed by |msg|.
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 dir.getDirectory(name, { create: true }, getOrCreateNextName, 300 dir.getDirectory(name, { create: true }, getOrCreateNextName,
301 errorCallback); 301 errorCallback);
302 } 302 }
303 303
304 getOrCreateNextName(root); 304 getOrCreateNextName(root);
305 }, 305 },
306 306
307 /** 307 /**
308 * Lookup tables used by bytesToSi. 308 * Lookup tables used by bytesToSi.
309 */ 309 */
310 units_: ['B', 'k', 'M', 'G', 'T', 'P'], 310 units_: ['B', 'KB', 'MB', 'GB', 'TB', 'PB'],
311 scale_: [1, 1e3, 1e6, 1e9, 1e12, 1e15], 311 scale_: [1, 1e3, 1e6, 1e9, 1e12, 1e15],
312 312
313 /** 313 /**
314 * Convert a number of bytes into an appropriate International System of 314 * Convert a number of bytes into an appropriate International System of
315 * Units (SI) representation, using the correct number separators. 315 * Units (SI) representation, using the correct number separators.
316 * 316 *
317 * The first time this function is called it computes a lookup table which 317 * The first time this function is called it computes a lookup table which
318 * is cached for subsequent calls. 318 * is cached for subsequent calls.
319 * 319 *
320 * @param {number} bytes The number of bytes. 320 * @param {number} bytes The number of bytes.
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 if (typeof(arg) == 'string') { 388 if (typeof(arg) == 'string') {
389 element.appendChild(document.createTextNode(arg)); 389 element.appendChild(document.createTextNode(arg));
390 } else { 390 } else {
391 element.appendChild(arg); 391 element.appendChild(arg);
392 } 392 }
393 } 393 }
394 394
395 return element; 395 return element;
396 } 396 }
397 }; 397 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698