.js/lobste.rs.js

Thu, 29 Sep 2016 14:25:47 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Thu, 29 Sep 2016 14:25:47 -0400
changeset 397
466b95c31b1e
parent 375
195bf106146f
child 510
809d4a3da079
permissions
-rw-r--r--

make this a little more specific

375
195bf106146f Add lobste.rs tweaks for preview mode
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
1 // If story previews are enabled, set regular spacing and place byline below
195bf106146f Add lobste.rs tweaks for preview mode
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
2 // title.
195bf106146f Add lobste.rs tweaks for preview mode
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
3 if (document.querySelector('div.story_content')) {
195bf106146f Add lobste.rs tweaks for preview mode
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
4 var sheet = document.createElement('style')
195bf106146f Add lobste.rs tweaks for preview mode
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
5 sheet.innerHTML = "\
397
466b95c31b1e make this a little more specific
Meredith Howard <mhoward@roomag.org>
parents: 375
diff changeset
6 ol.list li.story { height: 7.5em; } \
375
195bf106146f Add lobste.rs tweaks for preview mode
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
7 li.story div.byline { color: #777; } \
195bf106146f Add lobste.rs tweaks for preview mode
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
8 li.story div.byline a { color: #777; } \
195bf106146f Add lobste.rs tweaks for preview mode
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
9 li.story div.story_content { color: #999; font-size: 95%; }"
195bf106146f Add lobste.rs tweaks for preview mode
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
10 document.body.appendChild(sheet)
195bf106146f Add lobste.rs tweaks for preview mode
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
11
195bf106146f Add lobste.rs tweaks for preview mode
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
12 var bylines = document.querySelectorAll('div.story_content + div.byline')
195bf106146f Add lobste.rs tweaks for preview mode
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
13 for (var e of bylines) {
195bf106146f Add lobste.rs tweaks for preview mode
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
14 e.parentNode.insertBefore(e, e.previousElementSibling)
195bf106146f Add lobste.rs tweaks for preview mode
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
15 }
195bf106146f Add lobste.rs tweaks for preview mode
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
16 }

mercurial