Codeexpander-Helper

[codeexpander]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Codeexpander-Helper
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  [codeexpander]
// @author       You
// @match        https://gist.github.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    const update = () => {
       const fileNames = document.getElementsByClassName('css-truncate-target');
       const description = document.getElementsByClassName('description');
       const description02 = document.getElementsByClassName('repository-meta-content');
       const description03 = document.querySelectorAll("#gist-pjax-container > div.container.new-discussion-timeline.experiment-repo-nav > div.repository-content.gist-content > div > div[itemprop='about']");
       for(var i = 0; i < fileNames.length; i++) {
           fileNames[i].textContent = fileNames[i].textContent.split("&env")[0];
           fileNames[i].textContent = fileNames[i].textContent.split("|-|&tag=")[0] ? fileNames[i].textContent.split("|-|&tag=")[0] : "No Description";
       }
       for(var j = 0; j < description.length; j++) {
           description[j].textContent = description[j].textContent.split("|-|&tag=")[0].trim() ? description[j].textContent.split("|-|&tag=")[0] : "No Description";
       }
       for(var k = 0; k < description02.length; k++) {
           description02[k].textContent = description02[k].textContent.split("|-|&tag=")[0].trim() ? description02[k].textContent.split("|-|&tag=")[0] : "No Description";
       }
       for(var h = 0; h < description03.length; h++) {
           description03[h].textContent = description03[h].textContent.split("|-|&tag=")[0].trim() ? description03[h].textContent.split("|-|&tag=")[0] : "No Description";
       }
    };
    update();
    window.addEventListener("click", function (event) {
        setTimeout(()=> { update(); } , 1000);
    });
})();