Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Chatovod usuarios
- // @version 0.2
- // @description Mejoras para usuarios Chatovod
- // @author ArtEze
- // @include /^https?:\/\/.+chatovod.+users.+/
- // @grant none
- // ==/UserScript==
- window.href_sumar = function(cantidad){
- var p_href = location.href.split("/")
- var p_fin = p_href.slice(-1)[0].split("&")
- var p_cant = p_fin[0].split("=")
- p_cant[1]=(+p_cant[1])+cantidad
- p_cant = p_cant.join("=")
- p_fin[0] = p_cant
- p_fin = p_fin.join("&")
- p_href[p_href.length-1] = p_fin
- p_href = p_href.join("/")
- location.href = p_href
- }
- window.acomodar_columnas = function(){
- var tabla = document.createElement("table")
- var tr = document.createElement("tr")
- var td_1 = document.createElement("td")
- var td_2 = document.createElement("td")
- var td_3 = document.createElement("td")
- td_2.appendChild(document.querySelector(".nickSearchResult"))
- var porcentaje = 5
- td_1.style.width = porcentaje+"%"
- td_1.style["background-color"]="black"
- td_1.addEventListener("click",function(){
- window.href_sumar(-20)
- })
- td_3.style.width = porcentaje+"%"
- td_3.style["background-color"]="black"
- td_3.addEventListener("click",function(){
- window.href_sumar(20)
- })
- tr.appendChild(td_1)
- tr.appendChild(td_2)
- tr.appendChild(td_3)
- tabla.appendChild(tr)
- document.querySelector(".container").appendChild(tabla)
- document.querySelector(".container.contentPopup .row").remove()
- document.querySelector(".container.contentPopup").style = "width: auto"
- }
- window.mejorar_estilo = function(){
- window.lista_usuarios = Array.from(document.querySelectorAll(".list-unstyled .clearfix"))
- .map(function(x){return [x.querySelector(".info"),x.querySelector("a")]})
- var div = document.createElement("div")
- window.lista_usuarios.map(function(x){
- var contenedor = document.createElement("li")
- var tabla = document.createElement("table")
- var tr_1 = document.createElement("tr")
- var tr_2 = document.createElement("tr")
- var td_1 = document.createElement("td")
- var td_2 = document.createElement("td")
- contenedor.style.width = "169px"
- contenedor.style.height = "190px"
- x[0].classList.remove("info")
- td_1.appendChild(x[0])
- td_2.appendChild(x[1])
- tr_1.appendChild(td_1)
- tr_2.appendChild(td_2)
- tabla.appendChild(tr_1)
- tabla.appendChild(tr_2)
- contenedor.appendChild(tabla)
- div.appendChild(contenedor)
- })
- document.querySelector(".list-unstyled").innerHTML = div.innerHTML
- document.querySelector("h5").innerHTML+=" "
- document.querySelector("h5").appendChild(document.querySelector("a"))
- document.querySelector(".headerPopup.clearfix").remove()
- document.querySelector(".container.contentPopup").style.paddingTop="0px"
- }
- var h5 = document.querySelector("h5")
- var texto = h5.textContent
- var num = +texto.match(/\d+/g).join("")
- var paginas = Math.ceil(num/20)
- var actual = Math.ceil((+location.href.match(/\d+/)[0])/20)+1
- h5.innerHTML += " - " + actual + " de " + paginas + " páginas. "
- var boton = document.createElement("button")
- boton.innerHTML = "Con foto"
- boton.addEventListener("click",function(){
- location.href = location.origin + "/es/users/?p=0&s=0&f=1&_a=on"
- })
- h5.appendChild(boton)
- window.acomodar_columnas()
- window.window.mejorar_estilo()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement