OpaxViewer

Permet de cacher tous les messages du topic hormis ceux de l'auteur

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         OpaxViewer
// @namespace    http://tampermonkey.net/
// @version      1
// @description  Permet de cacher tous les messages du topic hormis ceux de l'auteur
// @author       You
// @match        https://onche.org/topic/*
// @icon         https://image.noelshack.com/fichiers/2021/43/4/1635454847-elton-john-tison-golem.png
// @grant        none
// @license      MIT
// ==/UserScript==

let barre = document.getElementsByClassName("title")[0].childNodes[1];
let bouAff = document.createElement("button");
let afficher = true;

bouAff.style = "background-color : #71c2fb; border-color : #71c2fb; border-radius: 4px; border-style : solid; ";
bouAff.style.width = "23px";
bouAff.style.length = "10px";
bouAff.innerHTML = "👀";
bouAff.style.fontSize = "xx-small";
bouAff.style.textAlign = "right";
bouAff.onclick = function (){
    afficher = !afficher;
    cacherafficher(afficher);
};

barre.appendChild(bouAff);
let verif = document.getElementsByClassName("messages")[0];
const styleMess = verif.childNodes[1].style.display;

function cacherafficher(etat){

      for(let i = 0; i < verif.childNodes.length ; i++){
          if(verif.childNodes[i].className != "message-anchor"){
              if(afficher) {
                  verif.childNodes[i].style.display = styleMess;
                  bouAff.style.backgroundColor = "#71c2fb";
                  bouAff.style.borderColor = "#71c2fb";
              }else if(verif.childNodes[i].getAttribute("data-username") != verif.childNodes[1].getAttribute("data-username")){
                  verif.childNodes[i].style.display = "none";
                  bouAff.style.backgroundColor = "#033b63";
                  bouAff.style.borderColor = "#033b63";
              }
      }
      }
}