Commit 4c49b05e authored by Romain Courteaud's avatar Romain Courteaud

romain_dev: forum use html viewer

parent f9b3a2b1
......@@ -374,16 +374,29 @@
if (modification_dict.hasOwnProperty('allDocs_result')) {
allDocs_result = JSON.parse(gadget.state.allDocs_result);
domsugar(gadget.element, [
domsugar('p', {text: 'Comments:'}),
domsugar('ol', allDocs_result.data.rows.map(function (entry) {
console.log(entry);
return domsugar('li', [
domsugar('div', {html: entry.value.asStrippedHTML}),
domsugar('hr')
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, i) {
console.log(entry);
return domsugar('li', [
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