};
+// Commands we need to send to Citadel Server before we begin rendering forum view.
+// These are common to flat and threaded views.
+//
+void setup_for_forum_view(struct ctdlsession *c)
+{
+ char buf[1024];
+ ctdl_printf(c, "MSGP text/html|text/plain"); // Declare the MIME types we know how to render
+ ctdl_readline(c, buf, sizeof(buf)); // Ignore the response
+ ctdl_printf(c, "MSGP dont_decode"); // Tell the server we will decode base64/etc client-side
+ ctdl_readline(c, buf, sizeof(buf)); // Ignore the response
+}
+
+
+#if 0
// Renderer for one message in the threaded view
// (This will probably work for the flat view too.)
//
}
-// Commands we need to send to Citadel Server before we begin rendering forum view.
-// These are common to flat and threaded views.
-//
-void setup_for_forum_view(struct ctdlsession *c)
-{
- char buf[1024];
- ctdl_printf(c, "MSGP text/html|text/plain"); // Declare the MIME types we know how to render
- ctdl_readline(c, buf, sizeof(buf)); // Ignore the response
- ctdl_printf(c, "MSGP dont_decode"); // Tell the server we will decode base64/etc client-side
- ctdl_readline(c, buf, sizeof(buf)); // Ignore the response
-}
-
-
-#if 0
-
// This code implements the thread display code. The thread sorting algorithm is working nicely but we're trying
// not to do rendering in the C server of webcit. Maybe move it into the server as "MSGS threaded" or something like that?
{
if ((this.status / 100) == 2)
{
- document.getElementById(div).innerHTML = this.responseText; // FIXME don't let the C server render it. do JSON now.
+ msg = JSON.parse(this.responseText);
+
+ document.getElementById(div).innerHTML =
+ "<div>" // begin message wrapper
+ + "<div style=\"float:left;padding-right:2px\">" // begin avatar FIXME move to a stylesheet
+ + "<i class=\"fa fa-user-circle fa-2x\"></i> " // FIXME temporary avatar
+ + "</div>" // end avatar
+ + "<div>" // begin content
+ + "<div>" // begin header
+ + "<span class=\"ctdl-username\"><a href=\"#\">" // FIXME link to user profile
+ + msg.from
+ + "</a></span> "
+ + "<span class=\"ctdl-msgdate\">"
+ + msg.time
+ + "</span> "
+ + "</div>" // end header
+ + "<div>" // begin body
+ + msg.text
+ + "</div>" // end body
+ + "</div>" // end content
+ + "</div>" // end wrapper
+ ;
}
else
{