Thu, 18 Aug 2016 14:41:19 -0400
Add lobste.rs tweaks for preview mode
.js/lobste.rs.js | file | annotate | diff | comparison | revisions |
new file mode 100644 --- /dev/null +++ b/.js/lobste.rs.js @@ -0,0 +1,16 @@ +// If story previews are enabled, set regular spacing and place byline below +// title. +if (document.querySelector('div.story_content')) { + var sheet = document.createElement('style') + sheet.innerHTML = "\ + li.story { height: 7.5em; } \ + li.story div.byline { color: #777; } \ + li.story div.byline a { color: #777; } \ + li.story div.story_content { color: #999; font-size: 95%; }" + document.body.appendChild(sheet) + + var bylines = document.querySelectorAll('div.story_content + div.byline') + for (var e of bylines) { + e.parentNode.insertBefore(e, e.previousElementSibling) + } +}