ignore time

Fri, 10 Feb 2017 12:22:53 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Fri, 10 Feb 2017 12:22:53 -0500
changeset 510
809d4a3da079
parent 509
14ac01e21c51
child 511
f175eea7ad19

ignore time

.js/lobste.rs.js file | annotate | diff | comparison | revisions
--- a/.js/lobste.rs.js
+++ b/.js/lobste.rs.js
@@ -14,3 +14,16 @@ if (document.querySelector('div.story_co
     e.parentNode.insertBefore(e, e.previousElementSibling)
   }
 }
+
+// only safe when you've guaranteed a parent matches
+function parentSelector (el, selector) {
+    while ((el = el.parentElement) && !el.matches(selector));
+    return el;
+}
+
+['angersock'].forEach(function (u) {
+  var collapse = document.querySelectorAll('div.comment > div.details > div.byline > a[href="/u/' + u + '"]')
+  for (var el of collapse) {
+    parentSelector(el, 'div.comment').previousElementSibling.click()
+  }
+})

mercurial