From 249ecc4237c911a10607f962a5681bcf6b7f4f06 Mon Sep 17 00:00:00 2001 From: Gabor Adam Toth Date: Mon, 15 Feb 2010 13:36:17 +0100 Subject: [PATCH] threads: toggle comments js --- world/net/place/threads.c | 28 ++++++++++++++++++++-------- world/static/examine.css | 19 +++++++++++++++++-- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/world/net/place/threads.c b/world/net/place/threads.c index bb4a8e6..9a494ee 100644 --- a/world/net/place/threads.c +++ b/world/net/place/threads.c @@ -495,7 +495,10 @@ htMain(last) { int i; int len; string t; - string ht = ""; + string ht = + ""; len = sizeof(_thread); if (last > len) last = len; @@ -503,21 +506,30 @@ htMain(last) { // reverse order for (i = len-1; i >= len - last; i--) { P3((">>> _thread[%O]: %O\n", i, _thread[i])) - t = htquote(_thread[i]["text"]); + mapping item = _thread[i]; + t = htquote(item["text"]); t = replace(t, "\n", "
\n"); t = replace(t, "<", "<"); t = replace(t, ">", ">"); + string c = ""; + if (item["comments"]) + foreach(mapping comment : item["comments"]) + c += "
" + comment["nick"] + ": " + comment["text"] + "
\n"; + ht += "
\n" "
\n" - "" + _thread[i]["author"] + "\n" - "" + htquote(_thread[i]["thread"]) + "\n" + "" + item["author"] + "\n" + "" + htquote(item["thread"]) + "\n" + "
\n" + "
\n" + "
" + t + "
\n" + "\n" "
\n" - "
" + t + "
\n" "\n" "
\n"; diff --git a/world/static/examine.css b/world/static/examine.css index 75d5667..c912fed 100644 --- a/world/static/examine.css +++ b/world/static/examine.css @@ -77,11 +77,21 @@ body.threads, margin: 22px 44px; } -.entry .text { +.entry .body { background: black; padding: 5px; } +.entry .body .comment { + margin: 0.5em 1em 0; + padding: 2px; + border-top: 1px solid #933; +} + +.entry .body .comment-author { + font-weight: bold; +} + .entry .title { display: none; } @@ -90,6 +100,7 @@ body.threads, .entry .footer a, .entry .footer a:visited { + cursor: pointer; color: white; background: transparent; } @@ -99,6 +110,10 @@ body.threads, text-decoration: underline; } -.entry .footer .comments { +.entry .footer .comments-link { float: right; } + +.hidden { + display: none; +} \ No newline at end of file