Indeed.com: Design like Stepstone

This script changes the old-fashioned indeed.com design to the modern Stepstone.com design.

目前為 2016-07-13 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Indeed.com: Design like Stepstone
  3. // @namespace https://greasyfork.org/de/scripts/21365
  4. // @description This script changes the old-fashioned indeed.com design to the modern Stepstone.com design.
  5.  
  6. // @include *.indeed.com/*
  7. // @include *.indeed.co.uk/*
  8. // @include *.indeed.*/*
  9. // @include *proxy-us.hide.me/*
  10. // @run-at document-end
  11.  
  12. // @author lukie80
  13. // @copyright Creative Commons Attribution-ShareAlike 3.0 Unported (CC-BY-SA 3.0)
  14. // @license http://creativecommons.org/licenses/by-sa/3.0/
  15. // @version 1.1
  16. // @lastupdated 2016.07.13
  17. //
  18. // ==/UserScript==
  19. //-------------------------------------------------------------------------------------------------------------------
  20.  
  21. //needed for finding sponsored jobs, source: http://stackoverflow.com/a/4275177 - needed
  22. function getElementsStartsWithId( id ) {
  23. var children = document.body.getElementsByTagName('*');
  24. var elements = [], child;
  25. for (var i = 0, length = children.length; i < length; i++) {
  26. child = children[i];
  27. if (child.id.substr(0, id.length) == id)
  28. elements.push(child);
  29. }
  30. return elements;
  31. }
  32.  
  33. //needed for CSS replacement
  34. function addGlobalStyle(css) {
  35. var head, style;
  36. head = document.getElementsByTagName('head')[0];
  37. if (!head) { return; }
  38. style = document.createElement('style');
  39. style.type = 'text/css';
  40. style.innerHTML = css;
  41. head.appendChild(style);
  42. }
  43.  
  44. //replacing CSS
  45. addGlobalStyle("\
  46. *{\
  47. font-family: Trebuchet ms !important; \
  48. }\
  49. body{\
  50. font-family: Trebuchet ms !important; \
  51. color: #0C2577 !important; \
  52. background: linear-gradient(#EFF5FA 0px, #EFF5FA 35px,#FFFFFF 205px) !important; \
  53. } \
  54. a{\
  55. color: #0C2577 !important; \
  56. } \
  57. a:visited{\
  58. color: #666 !important; \
  59. } \
  60. .company{\
  61. color: #1260cf !important; \
  62. } \
  63. .location{\
  64. color: #1260cf !important; \
  65. } \
  66. .summary{\
  67. color: #666 !important; \
  68. } \
  69. .inwrap{\
  70. border-right: none !important; \
  71. border-bottom: none !important; \
  72. } \
  73. .input_text{\
  74. border: thin solid #d4e4f2 !important; \
  75. } \
  76. .new{\
  77. color: #1260cf !important; \
  78. } \
  79. .nji{\
  80. color: #1260cf !important; \
  81. } \
  82. .nji nji recDecoration{\
  83. color: #1260cf !important; \
  84. } \
  85. .more_link{\
  86. color: #1260cf !important; \
  87. } \
  88. .iaLabel{\
  89. color: #1260cf !important; \
  90. } \
  91. .result-link-source{\
  92. color: #1260cf !important; \
  93. } \
  94. .date{\
  95. color: #1260cf !important; \
  96. } \
  97. #what_label_top{\
  98. color: #1260cf !important; \
  99. } \
  100. #where_label_top{\
  101. color: #1260cf !important; \
  102. } \
  103. #g_nav{\
  104. background: #fff !important; \
  105. border-bottom: thin solid #d4e4f2 !important; \
  106. } \
  107. #p_nav{\
  108. background: #fff !important; \
  109. border: none !important; \
  110. } \
  111. .inwrapBorder{\
  112. border: none !important; \
  113. thin solid #d4e4f2 !important; \
  114. } \
  115. .lnav{\
  116. border-spacing: 10px !important; \
  117. } \
  118. #pageContent{\
  119. border-spacing: 10px !important; \
  120. } \
  121. #refineresults{\
  122. background: #eff5fa !important; \
  123. border: thin solid #d4e4f2 !important; \
  124. border-radius: 6px !important; \
  125. padding-top: 17px !important; \
  126. } \
  127. #resultsCol{\
  128. border: thin solid #d4e4f2 !important; \
  129. border-radius: 6px !important; \
  130. background-color: #eff5fa !important; \
  131. } \
  132. #auxCol{\
  133. border: thin solid #d4e4f2 !important; \
  134. border-radius: 6px !important; \
  135. background-color = #eff5fa !important; \
  136. } \
  137. #femp_list{\
  138. padding-right: 10px !important; \
  139. } \
  140. .femp_item{\
  141. border: thin solid #d4e4f2 !important; \
  142. border-radius: 6px !important; \
  143. background-color = #fff !important; \
  144. } \
  145. ");
  146.  
  147. //dynamic style application
  148. document.getElementsByTagName("h1")[0].textContent = "Search: " + document.getElementsByTagName("h1")[0].textContent;
  149. var badDivs = getElementsStartsWithId("pj_");
  150. var goodDivs = getElementsStartsWithId("p_");
  151. for (var i = 0; i < goodDivs.length; i++){
  152. if (i % 2 == 0){
  153. goodDivs[i].style.background = '#f9fbfd';
  154. } else {
  155. goodDivs[i].style.background = '#FFFFFF';
  156. }
  157. goodDivs[i].style.border = 'thin solid #d4e4f2';
  158. goodDivs[i].style.margin = "-1px -1px -1px -1px";
  159. //goodDivs[i].style.borderRadius = '6px';
  160. }
  161. for (var i = 0; i < badDivs.length; i++){
  162. badDivs[i].style.background = '#fdf9fd';
  163. badDivs[i].style.border = 'thin solid #f7e6f7';
  164. badDivs[i].style.margin = "-1px -1px -1px -1px";
  165. //badDivs[i].remove();
  166. //this can remove the sponsored jobs but this is not suggested
  167. //because they are not qualitative spam. However they are
  168. //quantitative spam.
  169. }
  170.  
  171. //-------------------------------------------------------------------------------------------------------------------