TR Height 초기화 및 Padding 수정 + OK 기준 숨기기 (패션·대기 자료실 전용)

tr[height="128"] 초기화, #read_profile_td padding 수정, 댓글 숨기기, OK 수 기준 게시글 숨기기 (패션·pdswait 게시판)

目前為 2025-11-01 提交的版本,檢視 最新版本

// ==UserScript==
// @name         TR Height 초기화 및 Padding 수정 + OK 기준 숨기기 (패션·대기 자료실 전용)
// @namespace    https://greasyfork.org/users/your-username
// @version      1.0.4
// @description  tr[height="128"] 초기화, #read_profile_td padding 수정, 댓글 숨기기, OK 수 기준 게시글 숨기기 (패션·pdswait 게시판)
// @match        *://*/*
// @grant        none
// ==/UserScript==

(function() {
  'use strict';

  // 스타일 수정
  const style = document.createElement('style');
  style.textContent = `
    tr[height="128"] { height: initial !important; }
    #read_profile_td { padding-bottom: 10px !important; }
  `;
  document.head.appendChild(style);

  // 댓글 숨기기 로직
  document.querySelectorAll('li[id^="comment_li_"]').forEach(li => {
    const ok = li.querySelector('.ok .r');
    const notok = li.querySelector('.notok');
    if (!ok || !notok) return;

    const okVal = parseInt(ok.textContent.trim(), 10) || 0;
    const notokVal = parseInt(notok.textContent.replace(/\D/g, ''), 10) || 0;

    if (okVal === 0 && notokVal === 0) {
      li.style.display = 'none';
    }
  });

  // OK 수 기준 게시글 숨기기
  const href = location.href;

  let threshold = null;
  if (href.includes('https://m.humoruniv.com/board/list.html?table=fashion')) {
    threshold = 20;
  } else if (href.includes('https://m.humoruniv.com/board/list.html?table=pdswait')) {
    threshold = 3;
  }

  if (threshold !== null) {
    document.querySelectorAll('.list_body_href').forEach(link => {
      const okNumEl = link.querySelector('.ok_num');
      if (!okNumEl) return;

      const num = Number(okNumEl.textContent.trim().replace(/[^0-9]/g, ''));
      if (num <= threshold) link.style.display = 'none';
    });
  }
})();