From 3e3015be26c5d73a864a693e9694b5dee26e8a31 Mon Sep 17 00:00:00 2001 From: sostler Date: Sun, 6 Dec 2009 21:54:18 -0500 Subject: Fixed profile image handling --- src/site.clj | 2 +- static/pichat.js | 7 ++++++- template/logged_dump.st | 6 ++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/site.clj b/src/site.clj index 66a17d9..cc7dfd3 100644 --- a/src/site.clj +++ b/src/site.clj @@ -205,7 +205,7 @@ (doseq [a [:nick :avatar :contact :bio]] (let [v (user-info a)] (.setAttribute st (name a) - (if v (encode-html-entities v) nil)))) + (if (non-empty-string? v) (encode-html-entities v) nil)))) (.setAttribute st "dumps" (to-array (map process-message-for-output dumps))) (.toString st))) diff --git a/static/pichat.js b/static/pichat.js index fe5beaa..826bcba 100755 --- a/static/pichat.js +++ b/static/pichat.js @@ -144,9 +144,14 @@ function initChat() { } function initProfile() { + $('.logged-dump .content').each(function() { + var t = $(this); + t.html(buildMsgContent(t.text())); + }); + var onSubmit = function(original_element, edit, old) { if (edit == old) { return old }; - // Prevent entering script tags. TODO: investigate better scheme. + // MAJOR TODO: Prevent entering script tags if (original_element == 'avatar' && edit.indexOf("<") != -1) { return old; } diff --git a/template/logged_dump.st b/template/logged_dump.st index 3131aaf..51b67c6 100755 --- a/template/logged_dump.st +++ b/template/logged_dump.st @@ -1,6 +1,8 @@
- $if(dump.avatar)$$endif$ + $if(dump.avatar)$ + + $endif$
$dump.nick$ -- $dump.created_on$
-
$dump.content$
+
$dump.content$

-- cgit v1.2.3-70-g09d2