From e1222d5d4bf84f4136eb9200d3a7ed15c8d79d51 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Wed, 31 Dec 2014 19:55:24 -0800 Subject: [PATCH] Fix newlines in catalog [code] blocks, and add background color. #263 --- src/General/Build.coffee | 4 +++- src/General/css/photon.css | 5 +++++ src/General/css/style.css | 5 +++++ src/General/css/tomorrow.css | 3 +++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/General/Build.coffee b/src/General/Build.coffee index 9ccff5990..77a64ef2b 100755 --- a/src/General/Build.coffee +++ b/src/General/Build.coffee @@ -357,7 +357,9 @@ Build = for exif in $$ '.abbr, .exif', root.lastElementChild $.rm exif for pp in $$ '.prettyprint', root.lastElementChild - $.replace pp, $.tn pp.textContent + cc = $.el 'span', className: 'catalog-code' + $.add cc, [pp.childNodes...] + $.replace pp, cc for br in $$ 'br', root.lastElementChild when br.previousSibling?.nodeName is 'BR' $.rm br diff --git a/src/General/css/photon.css b/src/General/css/photon.css index 7874f2184..228a7258a 100755 --- a/src/General/css/photon.css +++ b/src/General/css/photon.css @@ -33,6 +33,11 @@ background-color: #DDD; } +/* Catalog */ +:root.photon .catalog-code { + background-color: rgba(150, 150, 150, 0.2); +} + /* Quote */ :root.photon .backlink.deadlink { color: #F60 !important; diff --git a/src/General/css/style.css b/src/General/css/style.css index bf00ead2a..1c86de0b7 100755 --- a/src/General/css/style.css +++ b/src/General/css/style.css @@ -666,6 +666,11 @@ div[data-checked="false"] > .suboption-list { .catalog-thread > .comment > b { font-weight: normal; } +.catalog-code { + background-color: #FFF; + display: inline-block; + max-width: 100%; +} /* Announcement Hiding */ :root.hide-announcement #globalMessage { diff --git a/src/General/css/tomorrow.css b/src/General/css/tomorrow.css index be44f74a0..d207c26f9 100755 --- a/src/General/css/tomorrow.css +++ b/src/General/css/tomorrow.css @@ -34,6 +34,9 @@ :root.tomorrow .catalog-thread > .comment > span.quote { color: #B5BD68; } +:root.tomorrow .catalog-code { + background-color: rgba(255, 255, 255, 0.1); +} /* Quote */ :root.tomorrow .backlink.deadlink {