Commit fc94fdcc authored by Romain Courteaud's avatar Romain Courteaud

romain_dev: forum use html viewer

parent 543d3ca2
...@@ -374,16 +374,29 @@ ...@@ -374,16 +374,29 @@
if (modification_dict.hasOwnProperty('allDocs_result')) { if (modification_dict.hasOwnProperty('allDocs_result')) {
allDocs_result = JSON.parse(gadget.state.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(gadget.element, [
domsugar('p', {text: 'Comments:'}), 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); console.log(entry);
return domsugar('li', [ return domsugar('li', [
domsugar('div', {html: entry.value.asStrippedHTML}), viewer_list[i].element,
domsugar('hr') domsugar('hr')
]); ]);
})) }))
]); ]);
});
return; return;
} }
}, function onStateChange(modification_dict) { }, function onStateChange(modification_dict) {
......
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>989.19030.1234.33297</string> </value> <value> <string>989.20325.997.53486</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1610470594.07</float> <float>1610548223.31</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </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