Commit 64fa6c4b authored by Romain Courteaud's avatar Romain Courteaud

romain_dev: forum use html viewer

parent 6f07aa75
......@@ -374,16 +374,29 @@
if (modification_dict.hasOwnProperty('allDocs_result')) {
allDocs_result = JSON.parse(gadget.state.allDocs_result);
return new RSVP.Queue(RSVP.all(
allDocs_result.data.rows.map(function (entry) {
return gadget.declareGadget('gadget_html_viewer.html')
.push(function (viewer) {
return viewer.render({value: entry.value.asStrippedHTML})
.push(function () {
return viewer;
});
});
})
))
.push(function (viewer_list) {
domsugar(gadget.element, [
domsugar('p', {text: 'Comments:'}),
domsugar('ol', allDocs_result.data.rows.map(function (entry) {
domsugar('ol', allDocs_result.data.rows.map(function (entry, i) {
console.log(entry);
return domsugar('li', [
domsugar('div', {html: entry.value.asStrippedHTML}),
viewer_list[i].element,
domsugar('hr')
]);
}))
]);
});
return;
}
}, function onStateChange(modification_dict) {
......
......@@ -240,7 +240,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>989.19030.1234.33297</string> </value>
<value> <string>989.20325.997.53486</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -258,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>1610470594.07</float>
<float>1610548223.31</float>
<string>UTC</string>
</tuple>
</state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment