Advertisement
Guest User

UserPostHighlighter

a guest
Jan 14th, 2023
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.84 KB | Source Code | 0 0
  1. // ==UserScript==
  2. // @name     LongHF
  3. // @version  1
  4. // @grant    none
  5. // @match    https://kinkyforums.com/forum/*
  6. // @namespace Costanza
  7. // ==/UserScript==
  8.  
  9. 'use strict';
  10.  
  11. function highlightMyPosts(){
  12.     const a = document.getElementsByTagName('a');
  13.  
  14.   [...a].forEach(e => {
  15.     if(e.innerText === ''){
  16.       const parentRow = e.parentElement.parentElement;
  17.      
  18.       if(parentRow.classList.contains('posts-overview-table-row')){
  19.           // style for top level rows
  20.           parentRow.style.setProperty('background-color', '#fbebc5');
  21.           parentRow.style.setProperty('font-weight','bold');
  22.       } else {
  23.           // style for post children
  24.           e.style = "background-color: #fbebc5";
  25.       }
  26.     }
  27.   });
  28. }
  29.  
  30. function main() {
  31.   highlightMyPosts();
  32. }
  33.  
  34. window.addEventListener('load', function() {
  35.     main();
  36. }, false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement