Mercurial > addons > firefox-addons > feed-preview
annotate js/feed-preview.js @ 29:688d75e554e0
Add option to expand feed entries by default
author | Guido Berhoerster <guido+feed-preview@berhoerster.name> |
---|---|
date | Mon, 21 Jan 2019 15:15:59 +0100 |
parents | f0c4a458869c |
children | 76e23b361e92 |
rev | line source |
---|---|
6
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
1 /* |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
2 * Copyright (C) 2018 Guido Berhoerster <guido+feed-preview@berhoerster.name> |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
3 * |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
4 * This Source Code Form is subject to the terms of the Mozilla Public |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
5 * License, v. 2.0. If a copy of the MPL was not distributed with this |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
7 */ |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
8 |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
9 'use strict'; |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
10 |
29
688d75e554e0
Add option to expand feed entries by default
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
26
diff
changeset
|
11 export function renderFeedPreview(feedPreviewDocument, feed, |
688d75e554e0
Add option to expand feed entries by default
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
26
diff
changeset
|
12 expandEntriesByDefault) { |
6
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
13 // inject XSL stylesheet which transforms XHTML to HTML allowing the use of |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
14 // the HTML DOM |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
15 let xslFilename = browser.runtime.getURL('web_resources/xhtml-to-html.xsl'); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
16 let xmlStylesheetNode = |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
17 feedPreviewDocument.createProcessingInstruction('xml-stylesheet', |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
18 `type="application/xslt+xml" href="${xslFilename}"`); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
19 feedPreviewDocument.firstChild.after(xmlStylesheetNode); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
20 |
10
ff5e5e3eba32
Implement feed subscription for web-based feed readers
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
9
diff
changeset
|
21 feedPreviewDocument.querySelector('#default-stylesheet').href = |
6
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
22 browser.runtime.getURL('web_resources/style/feed-preview.css'); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
23 |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
24 feedPreviewDocument.querySelector('title').textContent = feed.title; |
10
ff5e5e3eba32
Implement feed subscription for web-based feed readers
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
9
diff
changeset
|
25 |
ff5e5e3eba32
Implement feed subscription for web-based feed readers
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
9
diff
changeset
|
26 feedPreviewDocument.querySelector('label[for="feed-reader-selection"]') |
ff5e5e3eba32
Implement feed subscription for web-based feed readers
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
9
diff
changeset
|
27 .textContent = browser.i18n.getMessage('feedReaderSelectionLabel'); |
ff5e5e3eba32
Implement feed subscription for web-based feed readers
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
9
diff
changeset
|
28 feedPreviewDocument.querySelector('[name="subscribe"]').textContent = |
ff5e5e3eba32
Implement feed subscription for web-based feed readers
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
9
diff
changeset
|
29 browser.i18n.getMessage('subscribeButtonLabel'); |
ff5e5e3eba32
Implement feed subscription for web-based feed readers
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
9
diff
changeset
|
30 |
6
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
31 feedPreviewDocument.querySelector('#feed-title').textContent = feed.title; |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
32 feedPreviewDocument.querySelector('#feed-subtitle').textContent = |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
33 feed.subtitle; |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
34 |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
35 if (typeof feed.logo !== 'undefined') { |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
36 let feedLogoTemplate = |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
37 feedPreviewDocument.querySelector('#feed-logo-template'); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
38 let logoNode = feedPreviewDocument.importNode(feedLogoTemplate.content, |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
39 true); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
40 let imgElement = logoNode.querySelector('#feed-logo'); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
41 imgElement.setAttribute('src', feed.logo.url); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
42 imgElement.setAttribute('alt', feed.logo.title); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
43 feedPreviewDocument.querySelector('#feed-header').prepend(logoNode); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
44 } |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
45 |
9
fcd65cf3f634
Simplify the hint shown if there are no entries
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
6
diff
changeset
|
46 feedPreviewDocument.querySelector("#no-entries-hint").textContent = |
fcd65cf3f634
Simplify the hint shown if there are no entries
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
6
diff
changeset
|
47 browser.i18n.getMessage('noEntriesHint'); |
fcd65cf3f634
Simplify the hint shown if there are no entries
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
6
diff
changeset
|
48 |
6
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
49 let entryTemplateElement = |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
50 feedPreviewDocument.querySelector('#entry-template'); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
51 let entryTitleTemplateElement = |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
52 feedPreviewDocument.querySelector('#entry-title-template'); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
53 let entryTitleLinkedTemplateElement = |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
54 feedPreviewDocument.querySelector('#entry-title-linked-template'); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
55 let entryFileListTemplateElement = |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
56 feedPreviewDocument.querySelector('#entry-files-list-template'); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
57 let entryFileTemplateElement = |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
58 feedPreviewDocument.querySelector('#entry-file-template'); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
59 for (let entry of feed.entries) { |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
60 let entryNode = |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
61 feedPreviewDocument.importNode(entryTemplateElement.content, |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
62 true); |
29
688d75e554e0
Add option to expand feed entries by default
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
26
diff
changeset
|
63 entryNode.querySelector('details.entry').open = expandEntriesByDefault; |
688d75e554e0
Add option to expand feed entries by default
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
26
diff
changeset
|
64 |
6
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
65 let titleElement; |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
66 let titleNode; |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
67 if (typeof entry.link !== 'undefined') { |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
68 titleNode = feedPreviewDocument |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
69 .importNode(entryTitleLinkedTemplateElement.content, true); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
70 titleElement = titleNode.querySelector('.entry-link'); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
71 titleElement.href = entry.link; |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
72 titleElement.title = entry.title; |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
73 } else { |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
74 titleNode = feedPreviewDocument |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
75 .importNode(entryTitleTemplateElement.content, true); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
76 titleElement = titleNode.querySelector('.entry-title'); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
77 } |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
78 titleElement.textContent = entry.title; |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
79 entryNode.querySelector('.entry-header').prepend(titleNode); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
80 |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
81 let timeElement = entryNode.querySelector('.entry-date > time'); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
82 timeElement.textContent = entry.date.toLocaleString(); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
83 |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
84 let contentElement = entryNode.querySelector('.entry-content'); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
85 let contentDocument = new DOMParser().parseFromString(entry.content, |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
86 'text/html'); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
87 let stylesheetElement = contentDocument.createElement('link'); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
88 stylesheetElement.rel = 'stylesheet'; |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
89 stylesheetElement.href = |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
90 browser.runtime.getURL('web_resources/style/entry-content.css'); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
91 contentDocument.head.appendChild(stylesheetElement); |
26
f0c4a458869c
Open links within feed content in a new tab
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
10
diff
changeset
|
92 // open links in a new tab rather than within the iframe |
f0c4a458869c
Open links within feed content in a new tab
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
10
diff
changeset
|
93 for (let linkElement of contentDocument.links) { |
f0c4a458869c
Open links within feed content in a new tab
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
10
diff
changeset
|
94 linkElement.target = '_blank'; |
f0c4a458869c
Open links within feed content in a new tab
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
10
diff
changeset
|
95 } |
6
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
96 contentElement.srcdoc = new XMLSerializer() |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
97 .serializeToString(contentDocument); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
98 contentElement.title = entry.title; |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
99 |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
100 if (entry.files.length > 0) { |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
101 let fileListNode = feedPreviewDocument |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
102 .importNode(entryFileListTemplateElement.content, true); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
103 fileListNode.querySelector('.entry-files-title').textContent = |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
104 browser.i18n.getMessage('filesTitle'); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
105 let fileListElement = |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
106 fileListNode.querySelector('.entry-files-list'); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
107 |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
108 for (let file of entry.files) { |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
109 let fileNode = feedPreviewDocument |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
110 .importNode(entryFileTemplateElement.content, true); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
111 |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
112 let fileLinkElement = |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
113 fileNode.querySelector('.entry-file-link'); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
114 fileLinkElement.href = file.url; |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
115 fileLinkElement.title = file.filename; |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
116 fileLinkElement.textContent = file.filename; |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
117 |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
118 fileNode.querySelector('.entry-file-info').textContent = |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
119 `(${file.type}, ${file.size} bytes)`; |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
120 |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
121 fileListElement.appendChild(fileNode); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
122 } |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
123 |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
124 entryNode.querySelector('.entry').append(fileListNode); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
125 } |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
126 |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
127 feedPreviewDocument.body.append(entryNode); |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
128 } |
5d7c13e998e9
Create feed previews using a stream filter
Guido Berhoerster <guido+feed-preview@berhoerster.name>
parents:
diff
changeset
|
129 } |