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

Side by Side Diff: chrome/browser/resources/sync_file_system_internals/utils.js

Issue 23753007: Show file path rather than title in syncfs-internals (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6 * Creates an element named |elementName| containing the content |text|.
7 * @param {string} elementName Name of the new element to be created.
8 * @param {string} text Text to be contained in the new element.
9 * @param {Object} opt_attributes Optional attribute dictionary for the element.
10 * @return {HTMLElement} The newly created HTML element.
11 */
12 function createElementFromText(elementName, text, opt_attributes) {
13 var element = document.createElement(elementName);
14 element.appendChild(document.createTextNode(text));
15 if (opt_attributes) {
16 for (var key in opt_attributes)
17 element.setAttribute(key, opt_attributes[key]);
18 }
19 return element;
20 }
21
22 /**
23 * Creates an element with |tagName| containing the content |dict|.
24 * @param {string} elementName Name of the new element to be created.
25 * @param {Object.<string, string>} dict Dictionary to be contained in the new
26 * element.
27 * @return {HTMLElement} The newly created HTML element.
28 */
29 function createElementFromDictionary(elementName, dict) {
30 var element = document.createElement(elementName);
31 for (var key in dict) {
32 element.appendChild(document.createTextNode(key + ': ' + dict[key]));
33 element.appendChild(document.createElement('br'));
34 }
35 return element;
36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698