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

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

Issue 7529036: Add warning message to downloads directory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing image Created 9 years, 4 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) 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 getFileErrorMnemonic: function(code) { 51 getFileErrorMnemonic: function(code) {
52 for (var key in FileError) { 52 for (var key in FileError) {
53 if (key.search(/_ERR$/) != -1 && FileError[key] == code) 53 if (key.search(/_ERR$/) != -1 && FileError[key] == code)
54 return key; 54 return key;
55 } 55 }
56 56
57 return code; 57 return code;
58 }, 58 },
59 59
60 htmlUnescape: function(str) {
61 return str.replace(/&(lt|gt|amp);/g, function(entity) {
62 switch (entity) {
63 case '&lt;': return '<';
64 case '&gt;': return '>';
65 case '&amp;': return '&';
66 }
67 });
68 },
69
60 /** 70 /**
61 * Given a list of Entries, recurse any DirectoryEntries, and call back 71 * Given a list of Entries, recurse any DirectoryEntries, and call back
62 * with a list of all file and directory entries encountered (including the 72 * with a list of all file and directory entries encountered (including the
63 * original set). 73 * original set).
64 */ 74 */
65 recurseAndResolveEntries: function(entries, successCallback, errorCallback) { 75 recurseAndResolveEntries: function(entries, successCallback, errorCallback) {
66 var pendingSubdirectories = 0; 76 var pendingSubdirectories = 0;
67 var pendingFiles = 0; 77 var pendingFiles = 0;
68 78
69 var dirEntries = []; 79 var dirEntries = [];
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 if (typeof(arg) == 'string') { 384 if (typeof(arg) == 'string') {
375 element.appendChild(document.createTextNode(arg)); 385 element.appendChild(document.createTextNode(arg));
376 } else { 386 } else {
377 element.appendChild(arg); 387 element.appendChild(arg);
378 } 388 }
379 } 389 }
380 390
381 return element; 391 return element;
382 } 392 }
383 }; 393 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/file_manager/js/file_manager.js ('k') | chrome/browser/resources/file_manager/main.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698