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

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: Added dependency for dom_distiller_resources 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++) {
16 var listItem = document.createElement('li');
17 var link = document.createElement('a');
18 link.innerText = entries[i].title;
19 link.setAttribute('href', entries[i].url);
20 listItem.appendChild(link);
21 list.appendChild(listItem);
22 }
23 $('entries-list').appendChild(list);
24 }
25 }
26
27 /* All the work we do on load. */
28 function onLoadWork() {
29 chrome.send('requestEntries');
30 }
31
32 document.addEventListener('DOMContentLoaded', onLoadWork);
OLDNEW
« no previous file with comments | « components/dom_distiller/webui/resources/about_dom_distiller.html ('k') | components/dom_distiller_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698