Commit ad9165ae authored by Romain Courteaud's avatar Romain Courteaud

romain_dev: forum use html viewer

parent 8d67fa1f
...@@ -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);
domsugar(gadget.element, [ return new RSVP.Queue(RSVP.all(
domsugar('p', {text: 'Comments:'}), allDocs_result.data.rows.map(function (entry) {
domsugar('ol', allDocs_result.data.rows.map(function (entry) { return gadget.declareGadget('gadget_html_viewer.html')
console.log(entry); .push(function (viewer) {
return domsugar('li', [ return viewer.render({value: entry.value.asStrippedHTML})
domsugar('div', {html: entry.value.asStrippedHTML}), .push(function () {
domsugar('hr') 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; 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