jproulx ([personal profile] jproulx) wrote in [site community profile] changelog2009-03-04 08:11 pm

[dw-free] Wrap user-generated content in CSS class to apply sane defaults

[commit: http://hg.dwscoalition.org/dw-free/rev/87012a117184]

http://bugs.dwscoalition.org/show_bug.cgi?id=264

Apply a baseline styling to user-generated content on application pages

Files modified:
  • htdocs/stc/lj_base-app.css
  • htdocs/talkpost.bml
  • htdocs/talkread.bml
  • htdocs/userinfo.bml
--------------------------------------------------------------------------------
diff -r dc885b3a5989 -r 87012a117184 htdocs/stc/lj_base-app.css
--- a/htdocs/stc/lj_base-app.css	Wed Mar 04 18:40:39 2009 +0000
+++ b/htdocs/stc/lj_base-app.css	Wed Mar 04 12:10:13 2009 -0800
@@ -261,3 +261,51 @@ input.bright {
     font-size: 1.2em;
     margin-top: 10px;
 }
+
+/**
+  * Apply a baseline display to all user-generated content
+  */
+.usercontent h1,
+.usercontent h2,
+.usercontent h3,
+.usercontent h4,
+.usercontent h5,
+.usercontent h6,
+.usercontent strong,
+.usercontent dt {
+    font-weight: bold;
+}
+.usercontent ul,
+.usercontent ol,
+.usercontent dl,
+.usercontent menu,
+.usercontent blockquote {
+    margin: 1em;
+}
+.usercontent ul,
+.usercontent ol,
+.usercontent dl,
+.usercontent menu,
+.usercontent dl dd {
+    margin-left: 2em;
+}
+.usercontent ol li {
+    list-style: decimal outside;
+}
+.usercontent ul li { 
+    list-style: disc outside;
+}
+.usercontent sup {
+    vertical-align: super;
+    font-size: smaller;
+}
+.usercontent sub { 
+    vertical-align: sub;
+    font-size: smaller;
+}
+.usercontent p,
+.usercontent fieldset,
+.usercontent table,
+.usercontent pre { 
+    margin-bottom: 1em;
+}
diff -r dc885b3a5989 -r 87012a117184 htdocs/talkpost.bml
--- a/htdocs/talkpost.bml	Wed Mar 04 18:40:39 2009 +0000
+++ b/htdocs/talkpost.bml	Wed Mar 04 12:10:13 2009 -0800
@@ -310,7 +310,7 @@ body<=
     $current{'Groups'} = $group_names if $group_names;
 
 
-    $ret .= "<div id='entry' style='margin-left: 30px'>";
+    $ret .= "<div id='entry' class='usercontent' style='margin-left: 30px'>";
 
     ### currents
     if (! $init->{'replyto'} && %current)
diff -r dc885b3a5989 -r 87012a117184 htdocs/talkread.bml
--- a/htdocs/talkread.bml	Wed Mar 04 18:40:39 2009 +0000
+++ b/htdocs/talkread.bml	Wed Mar 04 12:10:13 2009 -0800
@@ -328,7 +328,7 @@ my $old_url = 0;
                            );
     }
 
-    $ret .= "<div id='entry' style='margin-left: 30px'>";
+    $ret .= "<div id='entry' class='usercontent' style='margin-left: 30px'>";
 
 
     if (%current)
@@ -645,7 +645,7 @@ my $old_url = 0;
                 $ret .= "<br /><b>$ML{'.posted'}</b>"
                     if $last_talkid == $dtid && $last_jid == $u->{'userid'};
 
-                $ret .= "</td></tr><tr><td class='commentbody'>";
+                $ret .= "</td></tr><tr><td class='commentbody usercontent'>";
 
                 LJ::CleanHTML::clean_comment(\$post->{'body'}, { 'preformatted' => $post->{'props'}->{'opt_preformatted'},
                                                                  'anon_comment' => (!$pu || $pu->{'journaltype'} eq 'I'),
diff -r dc885b3a5989 -r 87012a117184 htdocs/userinfo.bml
--- a/htdocs/userinfo.bml	Wed Mar 04 18:40:39 2009 +0000
+++ b/htdocs/userinfo.bml	Wed Mar 04 12:10:13 2009 -0800
@@ -435,7 +435,7 @@ body<=
         $ret .= $content_block->(
             section_name    => 'bio',
             section_name_ml => $u->is_person || $u->is_identity ? '.bio.header' : '.about.header',
-            body            => $biobody,
+            body            => "<div class='usercontent'>$biobody</div>",
             links           => $links,
         );
     }
--------------------------------------------------------------------------------