(bez virsraksta)
« previous entry | next entry »
Dec. 7., 2021 | 01:12 am
// ==UserScript==
// @name LCF
// @namespace https://gist.github.com/mindbound
// @version 0.3.5
// @description Filters out idiots and spammers in the latest posts page
// @author mindbound
// @license WTFPL; http://www.wtfpl.net/
// @match http://klab.lv/stats/latest.bml
// @icon data:image/png;base64,iVBORw0KGgoAAAANSU hEUgAAABAAAAAQCAYAAAAf8/9hAAAB7ElEQVQ4jW NgGF7AwEBA4M/zwPj/rwKX/3sesPb9Te/GqlSZ8h Q/oeJEb8HMSFe+SAdjXhsGBgY2DM0lUcI5O6ep/b x3yOb/g2MO/x+edP7/6LTL/wenXP4fWW36/8Q6s/8 n15r8Pzhf+/+sMskdGAb05Mjlv9pm8P/tdq3/r7e q/3+1Re3/y00qGPj5OpX/m1plNqDrZ55Zpbvx3xn P/5/2Gv//tMfo/6e9Rv/f7dT9/2qz6v+Xm1T+P12 j8v/hYtX/Dxaq/d9dp7yDgYGBCa47P0Kh8NdJz//f D1tjtRUd35un9r8xXCIRpp9l73STF//Pev1/s02L KAMeLVP9v6JA4RYDAwMjAysrg+GHA87//5xyJUrz y00q/x8uUf1/ql31PwMDgzEDJyeD9c/jbv9/HLUn 2oC7c9T+X+vX+C/KzxzCwMDAwHdkjvH3j3uMidL8 fL3K/+sTNf7vq1f+z8DAYAQJxBCBvmcblIky4M4s iO25HiK7kaORrT5JZPvzDbg1vtgA0Xy+S/1/qa/Y SQYGBlH0tMAR6cK3an2b1O8n6xCuebEREmgHmpX/1 4WIv9WS4VjMwMAggi0rcLIwMLgwMzAk8HMzddjqc 8z3teZZ6W7Is1RXln0KExNDPgsDgzsDA4M+AwMDO 0wTAOkmi+x6U2zHAAAAAElFTkSuQmCC
// @require https://raw.githubusercontent.com/sizzl emctwizzle/GM_config/master/gm_config.js
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_registerMenuCommand
// @run-at document-end
// ==/UserScript==
"use strict";
const cfg = new GM_configStruct({
id: "LCFConfig",
title: `
`,
events: {
open: function () {
makeDraggable(LCFConfig, LCFConfig_header);
LCFConfig_header.style.cursor = "move";
},
save: function () {
apply();
}
},
fields: {
filterList: {
section: ["Filter List", "Create a list of user accounts to filter"],
type: "textarea",
default: "",
save: true
}
},
frame: document.body.appendChild(document.creat eElement("div")),
css: `
#LCFConfig {
background-color: #f3f6f4;
}
#LCFConfig textarea {
margin-left: auto;
margin-right: auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
height: 325px;
resize: none;
font-size: 12px;
}
#LCFConfig_header p.lcftitle {
font-size: 20px;
font-weight: bold;
margin-bottom: 20px;
}
`
});
function makeDraggable(element, handle) {
if (!element) {
return;
}
let mdX = 0, mdY = 0, mdeX = 0, mdeY = 0;
(handle ?? element).onmousedown = function (event) {
this.style.userSelect = "none";
mdX = event.clientX;
mdY = event.clientY;
mdeX = element.offsetLeft;
mdeY = element.offsetTop;
onmouseup = () => {
onmousemove = null;
this.style.userSelect = "";
};
onmousemove = (evt) => {
element.style.left = `${mdeX + evt.clientX - mdX}px`;
element.style.top = `${mdeY + evt.clientY - mdY}px`;
};
};
}
function apply() {
const filterList = cfg.get("filterList").split("\n").filter( (e) => e.length > 0);
if (filterList.length !== 0) {
for (let tr of document.querySelectorAll("tr[valign='to p']")) {
if (filterList.some(
(s) => tr
.querySelectorAll("td")[1]
.querySelector("span.ljuser")
.getElementsByTagName("a")[0]
.getAttribute("href")
.includes(s)
)) {
tr.parentNode.removeChild(tr);
}
}
}
}
function openConfig() {
cfg.open();
LCFConfig.style = `
height: 75%;
max-height: 500px;
top: calc(50% - 200px);
width: 300px;
left: calc(50% - 150px);
border: 1px solid #000000;
border-radius: 5px;
margin: 0px;
opacity: 1.0;
overflow: auto;
padding: 10px;
position: fixed;
z-index: 65536;
display: block;
right: auto;
bottom: auto;
`;
}
(function () {
GM_registerMenuCommand("Settings", openConfig);
apply();
})();
// @name LCF
// @namespace https://gist.github.com/mindbound
// @version 0.3.5
// @description Filters out idiots and spammers in the latest posts page
// @author mindbound
// @license WTFPL; http://www.wtfpl.net/
// @match http://klab.lv/stats/latest.bml
// @icon data:image/png;base64,iVBORw0KGgoAAAANSU
// @require https://raw.githubusercontent.com/sizzl
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_registerMenuCommand
// @run-at document-end
// ==/UserScript==
"use strict";
const cfg = new GM_configStruct({
id: "LCFConfig",
title: `
`,
events: {
open: function () {
makeDraggable(LCFConfig, LCFConfig_header);
LCFConfig_header.style.cursor = "move";
},
save: function () {
apply();
}
},
fields: {
filterList: {
section: ["Filter List", "Create a list of user accounts to filter"],
type: "textarea",
default: "",
save: true
}
},
frame: document.body.appendChild(document.creat
css: `
#LCFConfig {
background-color: #f3f6f4;
}
#LCFConfig textarea {
margin-left: auto;
margin-right: auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
height: 325px;
resize: none;
font-size: 12px;
}
#LCFConfig_header p.lcftitle {
font-size: 20px;
font-weight: bold;
margin-bottom: 20px;
}
`
});
function makeDraggable(element, handle) {
if (!element) {
return;
}
let mdX = 0, mdY = 0, mdeX = 0, mdeY = 0;
(handle ?? element).onmousedown = function (event) {
this.style.userSelect = "none";
mdX = event.clientX;
mdY = event.clientY;
mdeX = element.offsetLeft;
mdeY = element.offsetTop;
onmouseup = () => {
onmousemove = null;
this.style.userSelect = "";
};
onmousemove = (evt) => {
element.style.left = `${mdeX + evt.clientX - mdX}px`;
element.style.top = `${mdeY + evt.clientY - mdY}px`;
};
};
}
function apply() {
const filterList = cfg.get("filterList").split("\n").filter(
if (filterList.length !== 0) {
for (let tr of document.querySelectorAll("tr[valign='to
if (filterList.some(
(s) => tr
.querySelectorAll("td")[1]
.querySelector("span.ljuser")
.getElementsByTagName("a")[0]
.getAttribute("href")
.includes(s)
)) {
tr.parentNode.removeChild(tr);
}
}
}
}
function openConfig() {
cfg.open();
LCFConfig.style = `
height: 75%;
max-height: 500px;
top: calc(50% - 200px);
width: 300px;
left: calc(50% - 150px);
border: 1px solid #000000;
border-radius: 5px;
margin: 0px;
opacity: 1.0;
overflow: auto;
padding: 10px;
position: fixed;
z-index: 65536;
display: block;
right: auto;
bottom: auto;
`;
}
(function () {
GM_registerMenuCommand("Settings", openConfig);
apply();
})();
(bez virsraksta)
from: multipimp
date: Dec. 7., 2021 - 01:15 am
Link
Atbildēt | Diskusija
(bez virsraksta)
from: bauda
date: Dec. 7., 2021 - 01:25 am
Link
Atbildēt | Iepriekšējais
(bez virsraksta)
from: anonymous
date: Dec. 7., 2021 - 01:41 am
Link
Atbildēt | Iepriekšējais | Diskusija
(bez virsraksta)
from: doom
date: Dec. 7., 2021 - 02:03 am
Link
Atbildēt | Iepriekšējais | Diskusija
(bez virsraksta)
from: anonymous
date: Dec. 7., 2021 - 02:11 am
Link
Atbildēt | Iepriekšējais | Diskusija
(bez virsraksta)
from: anonymous
date: Dec. 7., 2021 - 02:18 am
Link
Atbildēt | Iepriekšējais