Priorizar M贸dulo 18h (Top)

Size

1.4 KB

Version

Created

Mar 19, 2026

Updated

3 days ago

1// ==UserScript==
2// @name         Priorizar M贸dulo 18h (Top)
3// @match        *://www.proeis.rj.gov.br/FrmEventoAssociar.aspx*
4// @grant        none
5// ==/UserScript==
6
7(function() {
8    'use strict';
9
10    function organizarEventos() {
11        let tabela = document.querySelector("table");
12        if (!tabela) return;
13
14        let linhas = Array.from(tabela.querySelectorAll("tr"));
15
16        let prioridade = [];
17        let resto = [];
18
19        linhas.forEach(linha => {
20            let texto = linha.innerText.toUpperCase();
21
22            // 馃敟 REGRA: s贸 m贸dulo + 18h
23            if (
24                texto.includes("M脫DULO") &&
25                texto.includes("18:00:00")
26            ) {
27                prioridade.push(linha);
28            } else {
29                resto.push(linha);
30            }
31        });
32
33        let corpo = tabela.querySelector("tbody") || tabela;
34
35        // Mant茅m cabe莽alho
36        let header = corpo.querySelector("tr");
37        corpo.innerHTML = "";
38        if (header) corpo.appendChild(header);
39
40        // Primeiro os m贸dulos 18h
41        prioridade.forEach(linha => corpo.appendChild(linha));
42
43        // Depois o resto
44        resto.forEach(linha => corpo.appendChild(linha));
45
46        console.log("馃敟 M贸dulos 18h agora est茫o no topo!");
47    }
48
49    // Espera carregar bem (site 茅 lento)
50    setTimeout(organizarEventos, 4000);
51
52})();