您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Фильтр групповых боёв
当前为
// ==UserScript== // @name CT_groupwar_filter // @namespace CheckT // @author CheckT // @description Фильтр групповых боёв // @version 1.0 // @encoding utf-8 // @homepage https://gf.qytechs.cn/en/scripts/376330-ct-pers-note // @include https://www.heroeswm.ru/group_wars.php* // @include https://www.lordswm.com/group_wars.php* // @include http://178.248.235.15/group_wars.php* // @grant GM_getValue // @grant GM_setValue // ==/UserScript== (function(){ var gm_prefix = 'ctgf_'; initGm(); var is_filter_hunt = gm_get_bool('is_filter_hunt'); var is_filter_clan = gm_get_bool('is_filter_clan'); var filter_clan = gm_get('filter_clan'); var dom_ff_form = document.querySelector("form[name='ff']"); if(!dom_ff_form){ console.log("dom_ff_form not found"); return; } var filtered = false; var tr_header = dom_ff_form.parentNode.parentNode.parentNode; create_header(); filter_rows(); return; function create_header(){ var td_players = tr_header.childNodes[6]; td_players.innerHTML = '<span title="Оставить только охоты">охоты:' +'<input type="checkbox"' + html_if_checked(is_filter_hunt) + html_add_id('is_filter_hunt') + '/></span>' +'| <span title="Оставить только указанный клан (например, 9761)">клан:' +'<input type="checkbox"' + html_if_checked(is_filter_clan) + html_add_id('is_filter_clan') + '/>' +'<input style="width:70px"' + html_add_id('filter_clan') + html_add_positive_value(filter_clan) + '/></span>'; addClickEvent_GM('is_filter_hunt', update_filter); addClickEvent_GM('is_filter_clan', update_filter); addChangeEvent_GM('filter_clan', update_filter); } function update_filter(){ is_filter_hunt = getBoolField_GM('is_filter_hunt'); is_filter_clan = getBoolField_GM('is_filter_clan'); filter_clan = $$GM('filter_clan').value.trim(); if(filter_clan.indexOf('#')==0) filter_clan = filter_clan.substring(1); gm_set_bool('is_filter_hunt', is_filter_hunt); gm_set_bool('is_filter_clan', is_filter_clan); gm_set('filter_clan', filter_clan); filter_rows(); } function filter_rows(){ var tr = tr_header; if(is_filter_hunt || (is_filter_clan && filter_clan>0) ){ filtered = true; while (tr = tr.nextSibling){ var curr_style = 'none'; if(is_filter_hunt){ if(tr.childNodes[3].innerHTML=='Охотник') curr_style = ''; } if(is_filter_clan && filter_clan>0){ if(tr.childNodes[1].innerHTML.indexOf('#'+filter_clan)>=0) curr_style = ''; } tr.style.display = curr_style; } } else if (filtered) { filtered = false; while (tr = tr.nextSibling){ tr.style.display = ''; } } } //--------------------- function $$GM(id) { return document.getElementById(gm_prefix+id); } function addClickEvent_GM(id, func){ addEvent($$GM(id), "click", func); } function addChangeEvent_GM(id, func){ addEvent($$GM(id), "change", func); } function addEvent(elem, evType, fn) { if(elem && fn){ if (elem.addEventListener) elem.addEventListener(evType, fn, false); else if (elem.attachEvent) elem.attachEvent("on" + evType, fn); else elem["on" + evType] = fn; } } function getBoolField_GM(key, def){ var val = $$GM(key); return val ? val.checked : def; } function gm_get(key){ return GM_getValue(gm_prefix+key, ''); } function gm_set(key, val){ return GM_setValue(gm_prefix+key, val); } // 1 -> true; otherwise false function GM_load_bool_from_num(key, def){ var val = Number(GM_getValue(key, def)); return isNaN(val) ? false : val==1; } function GM_load_bool(key, def){ var val = GM_getValue(key, def); return val && (val===true || val == 'true'); } // true -> 1; otherwise 0 function GM_save_num_from_bool(key, val){ GM_setValue(key, val ? 1 : 0); } function gm_set_bool(key, val){ return GM_save_num_from_bool(gm_prefix+key, val); } function gm_get_bool(key, def){ return GM_load_bool_from_num(gm_prefix+key , def?1:0); } function html_if_checked(val){ return val ? ' checked' : ''; } function html_add_id(id){ return ' id="'+gm_prefix+id+'"'; } function html_add_positive_value(val){ return ' value="'+(val && val>0 ? val : '')+'"'; } function initGm(){ if (!this.GM_getValue || (this.GM_getValue.toString && this.GM_getValue.toString().indexOf("not supported")>-1)) { this.GM_getValue=function (key,def) { return localStorage[key] || def; }; this.GM_setValue=function (key,value) { return localStorage[key]=value; }; this.GM_deleteValue=function (key) { return delete localStorage[key]; }; } if (!this.GM_listValues || (this.GM_listValues.toString && this.GM_listValues.toString().indexOf("not supported")>-1)) { this.GM_listValues=function () { var keys=[]; for (var key in localStorage){ //в K-Meleon возвращаются все опции всех скриптов keys.push(key); } return keys; } } } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址