Two Column S1

two colomn ui for s1

目前为 2015-04-07 提交的版本。查看 最新版本

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