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

Side by Side Diff: components/dom_distiller/webui/resources/about_dom_distiller.js

Issue 23503042: Initial WebUI for DOM Distiller. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased 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 * Callback from the backend with the list of entries to display.
7 * This call will build the entries section of the DOM distiller page, or hide
8 * that section if there are none to display.
9 * @param {!Array.<string>} entries The entries.
10 */
11 function onGotEntries(entries) {
12 $('entries-section').hidden = !entries.length;
13 if (entries.length > 0) {
14 var list = document.createElement('ul');
15 for (var i=0; i < entries.length; i++) {
stuartmorgan 2013/09/12 05:25:24 Spaces around =
nyquist 2013/09/12 17:42:12 Done.
16 var listItem = document.createElement('li');
17 var link = document.createElement('a');
18 var linkHref = document.createAttribute('href');
19 var text = document.createTextNode(entries[i].title);
20 link.appendChild(text);
21 linkHref.nodeValue = entries[i].url;
22 link.setAttributeNode(linkHref);
23 listItem.appendChild(link);
24 list.appendChild(listItem);
25 }
26 $('entries-list').appendChild(list);
27 }
28 }
29
30 /* All the work we do onload. */
stuartmorgan 2013/09/12 05:25:24 on load
nyquist 2013/09/12 17:42:12 Done.
31 function onLoadWork() {
32 chrome.send('requestEntries');
33 }
34
35 document.addEventListener('DOMContentLoaded', onLoadWork);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698