|

楼主 |
发表于 2020-5-29 06:54
|
显示全部楼层
CHH交易区变色
- // ==UserScript==
- // @name chh交易区背景颜色
- // @namespace https://www.ryzl.com.cn/
- // @version 0.1
- // @description 过滤交易区非硬盘的显示
- // @author 荣耀之链
- // @require none
- // @match https://www.chiphell.com/forum-26-*.html
- // @grant none
- // ==/UserScript==
- (function() {
- //let keywords = ['硬盘', '固态', 'ssd', 'SSD','512G','存储']
- let keywords = ['固态', 'ssd']
- let $tbody = document.getElementById('threadlisttableid').children
- for (let i = 0; i < $tbody.length; i++) {
- let e = $tbody[i]
- if (keywords.some(k => {
- return e.innerText.toLowerCase().indexOf(k) >= 0
- })) {
- e.style.setProperty('background-color', '#C0C0C0', )
- }
- }
- //keywords = ['xr','XR','Xr','iphone8 p','iphone 8 p','iphone8 P','Iphone8 p','Iphone8 P','8p','8P','one11','one 11','11 p','11p','11P','11 P','xs','Xs','XS']
- keywords = ['8p','8P','8 p','8 P']
- for (let i = 0; i < $tbody.length; i++) {
- let e = $tbody[i]
- if (keywords.some(k => {
- return e.innerText.toLowerCase().indexOf(k) >= 0
- })) {
- e.style.setProperty('background-color', '#EAADEA', )
- }
- }
- keywords = ['6s p','6s P','6sp','6SP',]
- for (let i = 0; i < $tbody.length; i++) {
- let e = $tbody[i]
- if (keywords.some(k => {
- return e.innerText.toLowerCase().indexOf(k) >= 0
- })) {
- e.style.setProperty('background-color', '#32CD99', )
- }
- }
- keywords = ['7 p','7 P','7p','7P',]
- for (let i = 0; i < $tbody.length; i++) {
- let e = $tbody[i]
- if (keywords.some(k => {
- return e.innerText.toLowerCase().indexOf(k) >= 0
- })) {
- e.style.setProperty('background-color', '#3299CC', )
- }
- }
- keywords = ['E3 1230 V3','E3 1220 V3','E3 1231 V3','4770','4790','4430','4440','4450','4570','4590','1225L','1245L','G3220','G3230','G3240','G3250','G3260','4130','4140','4150','4160','4170']
- for (let i = 0; i < $tbody.length; i++) {
- let e = $tbody[i]
- if (keywords.some(k => {
- return e.innerText.toLowerCase().indexOf(k) >= 0
- })) {
- e.style.setProperty('background-color', '#A4C7FF', )
- }
- }
- keywords = ['售完','已出','已售','完成','完毕','交易中','暂出']
- for (let i = 0; i < $tbody.length; i++) {
- let e = $tbody[i]
- if (keywords.some(k => {
- return e.innerText.indexOf(k) >= 0
- })) {
- e.style.setProperty('display', 'none', 'important')
- }
- }
- })();
复制代码
|
|