Two Column S1

two colomn ui for s1

  1. // ==UserScript==
  2. // @name Two Column S1
  3. // @namespace https://exz.me/
  4. // @version 0.14
  5. // @description two colomn ui for s1
  6. // @author Epix
  7. // @match https://bbs.saraba1st.com/2b/*
  8. // @grant GM_addStyle
  9. // ==/UserScript==
  10. var width = 47;
  11. var list_on_left = true;
  12. if (self === top && location.href.startsWith('https://bbs.saraba1st.com/2b/forum-') || (new RegExp("mod=forumdisplay")).test(location.href)) {
  13.  
  14.  
  15. $('nv_forum').style['width'] = width + '%';
  16. GM_addStyle('.wp,#toptb{min-width:0 !important');
  17. var f = document.createElement("iframe");
  18. f.id = 'frame';
  19. f.name = 'frame';
  20. f.style.width = (100 - width) + '%';
  21. f.style.height = '95%';
  22. f.style.position = 'fixed';
  23. f.style.right = '0';
  24. f.style.bottom = '0';
  25. document.body.appendChild(f);
  26.  
  27. document.onclick = function (event) {
  28. var target = event.target;
  29. //console.log(target.nodeName,target.href);
  30. //return;
  31. var url = null;
  32. if (target.nodeName === "TH" && target.parentNode.parentNode.parentNode.id === "threadlisttableid") {
  33. url = target.querySelector('th>a.xst').href;
  34. } else if (target.nodeName === "TD" && target.parentNode.parentNode.parentNode.id === "threadlisttableid") {
  35. url = target.querySelector('td>a').href;
  36. } else if (target.nodeName === "A" && (target.href.search("thread-") !== -1 || target.href.search("mod=viewthread") !== -1)) {
  37. url = target.href;
  38. event.preventDefault();
  39. } else {
  40. return;
  41. }
  42. document.getElementById('frame').src = url;
  43. history.pushState(null, null, url);
  44. };
  45. } else if (self !== top && location.href.startsWith('https://bbs.saraba1st.com/2b/thread') || (new RegExp("mod=viewthread")).test(location.href)) {
  46. GM_addStyle('#toptb,#hd{display:none}');
  47. }
  48. if (location.href.startsWith('https://bbs.saraba1st.com/2b/thread') || (new RegExp("mod=viewthread")).test(location.href)) {
  49. var td = document.querySelectorAll('.plhin tbody tr:first-child td.pls:first-child');
  50. for (var i in td) {
  51. td[i].rowSpan = "4";
  52. }
  53. GM_addStyle('\
  54. .favatar {\
  55. height: 150px !important;\
  56. overflow: hidden !important;\
  57. }\
  58. .favatar:hover {\
  59. height: auto !important;\
  60. overflow: visible !important;\
  61. }\
  62. .favatar .pi {\
  63. position: absolute;\
  64. }\
  65. .favatar:hover .pi {\
  66. position: initial;\
  67. }\
  68. .favatar .authi {\
  69. background: white;\
  70. padding: 5px;\
  71. }\
  72. .favatar:hover .authi {\
  73. background: none;\
  74. padding: 0;\
  75. }\
  76. .t_fsz {\
  77. min-height: 0 !important;\
  78. }\
  79. .sign {\
  80. max-height: 20px !important;\
  81. padding: 0 !important;\
  82. position: relative;\
  83. width: 600px;\
  84. top: 10px;\
  85. margin-left: 70px;\
  86. margin-bottom: 0 !important;\
  87. background: rgb(246, 247, 235);\
  88. height: 0;\
  89. overflow: visible;\
  90. opacity: 0.01;\
  91. }\
  92. .sign:hover {\
  93. max-height: 200px !important;\
  94. opacity: 1;\
  95. }\
  96. .plhin > tbody > tr:nth-child(1) > td.plc{\
  97. width: 100%; \
  98. }\
  99. .plhin > tbody > tr:nth-child(3) > td:first-child {\
  100. display: none;\
  101. }\
  102. .plhin > tbody > tr:nth-child(3) > td{\
  103. border-bottom: 1px solid #022C80; \
  104. }\
  105. .plhin > tbody > tr:nth-child(4){\
  106. display: none;\
  107. }\
  108. #p_btn {\
  109. padding: 0 !important;\
  110. margin-top: 0 !important;\
  111. margin-bottom: 0 !important;\
  112. }');
  113.  
  114. }