Libraryless. Click here for Pure Java version (2580L/17K).
| 1 | // use inside of jAutoWidthHTMLLabel | 
| 2 | // pairs: (HTML text, false=left/true=right) | 
| 3 | // sadly, no padding possible with this div/span arrangement | 
| 4 | sS htmlForJLabel_chatConvo(LPair<S, Bool> dialog) {
 | 
| 5 |   ret lines(mapPairsToList(dialog, (content, right) -> {
 | 
| 6 | S color = right ? "#9999FF" : "#99FF99"; | 
| 7 | ret div(span(content, style := "background: \*color*/"), | 
| 8 | style := "margin-bottom: 10px; margin-" + (right ? "left" : "right") + ": 20px" + (right ? "; text-align: right" : "")); | 
| 9 | })); | 
| 10 | } | 
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1026592 | 
| Snippet name: | htmlForJLabel_chatConvo | 
| Eternal ID of this version: | #1026592/9 | 
| Text MD5: | 832b1e1b72ce465c0717b0abd8e3e0e9 | 
| Transpilation MD5: | f292c1f9a0da8a972a11e319b33c43f3 | 
| Author: | stefan | 
| Category: | javax / stefan's os | 
| Type: | JavaX fragment (include) | 
| Public (visible to everyone): | Yes | 
| Archived (hidden from active list): | No | 
| Created/modified: | 2020-01-15 14:38:33 | 
| Source code size: | 502 bytes / 10 lines | 
| Pitched / IR pitched: | No / No | 
| Views / Downloads: | 436 / 602 | 
| Version history: | 8 change(s) | 
| Referenced in: | [show references] |