// ==UserScript== // @name vim-fmi точки // @description Добавя брой натиснати клавиши във всяка страница на решения // // @version 1.1 // @license MIT // @author Syndamia // // @source https://gitlab.com/Syndamia/userscripts/-/blob/main/vim-fmi-keystrokes.js // @supportURL https://gitlab.com/Syndamia/userscripts/-/issues // @homepage https://gitlab.com/Syndamia/userscripts/ // @icon https://vim-fmi.bg/favicon.png // // @namespace Syndamia // @match *://*vim-fmi.bg/tasks/* // @run-at document-body // ==/UserScript== if (window.location.pathname.endsWith('solutions')) { document.getElementsByTagName('tbody')[0].childNodes.forEach((x) => { if (x.tagName != "TR") return; var countElem = document.createElement('div'); countElem.style.display = 'inline-block'; countElem.style.fontWeight = 'bold'; countElem.innerText = x.children[1].children[0].children.length; x.children[1].insertBefore(countElem, x.children[1].firstChild); }); } else { document.getElementsByTagName('ul')[3].childNodes.forEach((x) => { if (x.tagName != 'LI') return; var countElem = document.createElement('span'); countElem.style.verticalAlign = 'middle'; countElem.innerText = x.children[0].children.length; x.insertBefore(countElem, x.firstChild); }); }