diff --git a/make-pages/SinglePage.hs b/make-pages/SinglePage.hs index 5b73264..ca0747c 100644 --- a/make-pages/SinglePage.hs +++ b/make-pages/SinglePage.hs @@ -57,12 +57,15 @@ make' root prefix nsfw dataDir dir info@(Info {date, title, artist, bg}) = do let makePrefetch (Image {path}) = [b||] let prefetches = map (makePrefetch . #first) $ tail images - let warning' = ifJust (#warning image0) \w -> [b|@4 + let makeWarning w = [b|@4
cw: $w
|] + let warning' = ifJust (#warning image0) makeWarning + let warningT = makeWarning [b|.|] + let bgStyle = ifJust bg \col -> [b|@0 |] @@ -125,6 +128,10 @@ make' root prefix nsfw dataDir dir info@(Info {date, title, artist, bg}) = do + + |] makeArtist :: Artist -> Builder diff --git a/script/single.js b/script/single.js index 5e3347f..8f4dc39 100644 --- a/script/single.js +++ b/script/single.js @@ -28,13 +28,10 @@ function setImage(id, src, width, height, href, cw, firstLoad) { let newCaption; if (!opened.has(id) && cw) { - let template = document.createElement('template'); - template.innerHTML = ` -
- cw: ${cw} -
`; - newCaption = template.content; - addCWListeners(id, newCaption.getElementById('cw')); + newCaption = document.getElementById('cw-template') + .content.firstElementChild.cloneNode(true); + newCaption.querySelector('#cw-text').innerHTML = cw; + addCWListeners(id, newCaption.querySelector('#cw')); } if (caption) {