Two Column S1

two colomn ui for s1

目前为 2015-10-17 提交的版本。查看 最新版本

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