Greasy Fork is available in English.

Github Liste des langages de code afficher tout

Développer Github Liste des langues sur le référentiel,Afficher chaque langue,Au lieu de cacher de petites pièces“autre”Vers le bas

// ==UserScript==
// @name              Github List of code languages show all
// @description       Expand Github List of languages on the repository,Show each language,Instead of hiding small parts in“other”Down
// @name:zh-CN        Github 代码语言列表显示全部
// @description:zh-CN 扩展 Github 存储库上的语言列表,显示每种语言,而不是将小部分隐藏在“其他”下
// @name:ar           Github قائمة لغات الكود إظهار الكل
// @description:ar    يوسع Github قائمة اللغات في المستودع,إظهار كل لغة,بدلاً من إخفاء الأجزاء الصغيرة فيها“آخر”تحت
// @name:bg           Github Списък с кодови езици, покажи всички
// @description:bg    Разширяване Github Списък на езиците в хранилището,Покажете всеки език,Вместо да криете малки части в“друго”Надолу
// @name:cs           Github Seznam kódových jazyků zobrazuje vše
// @description:cs    Rozšířit Github Seznam jazyků v úložišti,Zobrazit každý jazyk,Místo schovávání malých částí“ostatní”Dolů
// @name:da           Github Liste over kodesprog viser alle
// @description:da    Udvide Github Liste over sprog på lageret,Vis hvert sprog,I stedet for at gemme små dele ind“andre”Ned
// @name:de           Github Liste der Codesprachen alle anzeigen
// @description:de    Expandieren Github Liste der Sprachen im Repository,Jede Sprache anzeigen,Anstatt kleine Teile darin zu verstecken“andere”Runter
// @name:el           Github Η λίστα των γλωσσών κώδικα εμφανίζει όλα
// @description:el    Διαστέλλω Github Λίστα γλωσσών στο αποθετήριο,Εμφάνιση κάθε γλώσσας,Αντί να κρύβεις μικρά κομμάτια“άλλος”Κάτω
// @name:en           Github List of code languages show all
// @description:en    Expand Github List of languages on the repository,Show each language,Instead of hiding small parts in“other”Down
// @name:eo           Github Listo de kodlingvoj montras ĉion
// @description:eo    Vastigi Github Listo de lingvoj sur la deponejo,Montru ĉiun lingvon,Anstataŭ kaŝi malgrandajn partojn en“aliaj”Malsupren
// @name:es           Github Lista de lenguajes de código mostrar todo
// @description:es    Expandir Github Lista de idiomas en el repositorio,Mostrar cada idioma,En lugar de esconder piezas pequeñas en“otro”Abajo
// @name:fi           Github Luettelo koodikielistä näyttää kaikki
// @description:fi    Laajentaa Github Luettelo arkiston kielistä,Näytä jokainen kieli,Sen sijaan, että piilottaisit pieniä osia“muu”Alas
// @name:fr           Github Liste des langages de code afficher tout
// @description:fr    Développer Github Liste des langues sur le référentiel,Afficher chaque langue,Au lieu de cacher de petites pièces“autre”Vers le bas
// @name:he           Github רשימת שפות הקוד מציגה הכל
// @description:he    לְהַרְחִיב Github רשימת השפות במאגר,הצג כל שפה,במקום להחביא חלקים קטנים“אַחֵר”לְמַטָה
// @name:hr           Github Popis kodnih jezika prikaži sve
// @description:hr    Proširiti Github Popis jezika u repozitoriju,Prikaži svaki jezik,Umjesto skrivanja malih dijelova“drugo”dolje
// @name:hu           Github A kódnyelvek listája az összeset mutatja
// @description:hu    Bontsa ki Github Az adattárban található nyelvek listája,Minden nyelv megjelenítése,Ahelyett, hogy apró alkatrészeket rejtene el“más”Le
// @name:id           Github Daftar bahasa kode menunjukkan semuanya
// @description:id    Memperluas Github Daftar bahasa di repositori,Tunjukkan setiap bahasa,Daripada menyembunyikan bagian-bagian kecil di dalamnya“lainnya”Turun
// @name:it           Github L’elenco delle lingue del codice mostra tutto
// @description:it    Espandere Github Elenco delle lingue nel repository,Mostra ogni lingua,Invece di nascondere piccole parti“altro”Giù
// @name:ja           Github コード言語のリストをすべて表示
// @description:ja    拡大する Github リポジトリ上の言語のリスト,各言語を表示,小さな部品を隠すのではなく、“他の”下
// @name:ka           Github კოდის ენების სია აჩვენებს ყველაფერს
// @description:ka    გაფართოება Github ენების სია საცავში,აჩვენე თითოეული ენა,მცირე ნაწილების დამალვის ნაცვლად“სხვა”ქვემოთ
// @name:ko           Github 코드 언어 목록 모두 표시
// @description:ko    확장하다 Github 저장소의 언어 목록,각 언어 표시,작은 부품을 숨기는 것보다“다른”아래에
// @name:nl           Github Lijst met codetalen laat alles zien
// @description:nl    Uitbreiden Github Lijst met talen in de repository,Toon elke taal,In plaats van kleine onderdelen erin te verstoppen“ander”Omlaag
// @name:nb           Github Liste over kodespråk viser alle
// @description:nb    Utvide Github Liste over språk på depotet,Vis hvert språk,I stedet for å gjemme små deler i“annen”Ned
// @name:pl           Github Lista języków kodowych pokaż wszystko
// @description:pl    Zwiększać Github Lista języków w repozytorium,Pokaż każdy język,Zamiast ukrywać małe części w“Inny”W dół
// @name:pt-BR        Github Lista de linguagens de código mostra todas
// @description:pt-BR Expandir Github Lista de idiomas no repositório,Mostrar cada idioma,Em vez de esconder pequenas peças“outro”Abaixo
// @name:ro           Github Lista de limbaje de cod arată toate
// @description:ro    Extinde Github Lista limbilor din depozit,Arată fiecare limbă,În loc să ascundă piese mici“alte”Jos
// @name:ru           Github Список языков программирования показать все
// @description:ru    Расширять Github Список языков в репозитории,Показать каждый язык,Вместо того, чтобы прятать мелкие детали в“другой”Вниз
// @name:sk           Github Zoznam kódovacích jazykov zobrazuje všetko
// @description:sk    Rozbaliť Github Zoznam jazykov v úložisku,Zobraziť každý jazyk,Namiesto skrývania malých častí“iné”Dole
// @name:sr           Github Листа кодних језика приказује све
// @description:sr    Прошири Github Листа језика у спремишту,Прикажи сваки језик,Уместо да кријете мале делове унутра“друго”Доле
// @name:sv           Github Lista över kodspråk visar alla
// @description:sv    Expandera Github Lista över språk på förvaret,Visa varje språk,Istället för att gömma smådelar i“andra”Ner
// @name:th           Github รายการรหัสภาษาแสดงทั้งหมด
// @description:th    ขยาย Github รายชื่อภาษาในพื้นที่เก็บข้อมูล,แสดงแต่ละภาษา,แทนที่จะซ่อนส่วนเล็กๆ ไว้ข้างใน“อื่น”ลง
// @name:tr           Github Kod dilleri listesi tümünü göster
// @description:tr    Genişletmek Github Depodaki dillerin listesi,Her dili göster,Küçük parçaları saklamak yerine“diğer”Aşağı
// @name:ug           Github كود تىللىرىنىڭ تىزىملىكى ھەممىنى كۆرسىتىدۇ
// @description:ug    كېڭەيتىش Github ئامباردىكى تىللارنىڭ تىزىملىكى,ھەر بىر تىلنى كۆرسەت,كىچىك قىسىملارنى يوشۇرۇشنىڭ ئورنىغا“other”تۆۋەنگە
// @name:uk           Github Список мов коду показати всі
// @description:uk    Розгорнути Github Список мов у репозиторії,Показати кожну мову,Замість того, щоб ховати дрібні деталі“інші”вниз
// @name:vi           Github Danh sách ngôn ngữ mã hiển thị tất cả
// @description:vi    Mở rộng Github Danh sách ngôn ngữ trên kho lưu trữ,Hiển thị từng ngôn ngữ,Thay vì giấu những phần nhỏ trong“khác”Xuống
// @name:zh-TW        Github 代碼語言列表顯示全部
// @description:zh-TW 擴充 Github 儲存庫上的語言列表,顯示每種語言,而不是將小部分隱藏在“其他”下
// @name:zh-HK        Github 代碼語言列表顯示全部
// @description:zh-HK 擴充 Github 儲存庫上的語言列表,顯示每種語言,而不是將小部分隱藏在“其他”下
// @name:fr-CA        Github Liste des langages de code afficher tout
// @description:fr-CA Développer Github Liste des langues sur le référentiel,Afficher chaque langue,Au lieu de cacher de petites pièces“autre”Vers le bas
// @match             https://github.com/*
// @author            Davoleo,人民的勤务员 <china.qinwuyuan@gmail.com>
// @namespace         https://github.com/ChinaGodMan/UserScripts
// @supportURL        https://github.com/ChinaGodMan/UserScripts/issues
// @homepageURL       https://github.com/ChinaGodMan/UserScripts
// @license           MIT
// @icon              data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAAAsTAAALEwEAmpwYAAAc6klEQVR4nO2deXBb13XGaTedTDxNp532j04z0yaTTpvpdGrLsjZLXAGCIPbtYd93ggRAkAC4kyK1y/JuybG1WJQsyZZsSd4X2dp3iqJkWd7kLXWdrWmcNMk0jWOfzrnAA+4FHkCIpCq55pv5hos4JPX9Ptx337nnXlZVzV6z1+w1e81es9fk100md2DU5An+3uQOfMK5fC/q7J40Z/P889fVvPom1T9VS9XtNc3a/TUy1UfVzerf18jUD6NXM/7DDA4fZ/GFweINEZk9QSKTJwicO/CWzukdUdr936v6f34tkun+vk6h66uTaS7VybVQK9dkJFM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r/jCBtfp1cl1PmD6/pQaTQg0SDkwF8teKDJa76+cnCCR5D4I50ZjuYU8RoTxnz8XPY29Ost5Ehh2kzz5j/JbPMeC0vqdbEyTnbL4Xm/Tgs4V+Va00OMAdrtHRkXgmM+bH8x4EopeyZEIFomsjfhurKvI1mzoRA4ce+rPDvwBDltori+5mzI3KKpDLKflzS/AIAuB212WAnewCYDRZ8m3m1+D/m1DQqq/4vryaT6bvNevOpkkcL6M3kb7R425LkVYGnmpBXAmV+iAJSyvwMADS/i5jPAxA0H99vTYOPB5A9vEPI/AyAzE4WDw+AMh/PgMZmWlxomddAjpgp2GDHm99w6NaFDd+puk7XTY0azt6sN39S7mCNZp2FnD6CN2wEEohOYn6sq6T5/twrohBAsfl5ABnz6VdEkfktKbKNVGP1kiXEhaJmpuhGm58F8O9zqhtC13S8r/TCv2LXpDGubtKZflNJyRk/j0/VOrsPTO4WsPqiBI4nnABfWxK8rUliLELJmN81ufn4MQ+gwPxMohOkaw3HfjxcFdOtsnhAqrOS+8VCsbzoqVcQQE3jr26vEQ+VXNW6ntd8qfTPJVpjVKI1vnsjHKyxuMJ5f6myA2N+jfjK3FpJ9621tZOf/Xn9r6Gbm1ScvFHDbWnUcD+5VsfK1FQw9SwsOZd78Cosut1RJ/n0jnrJD+fWSBq/yn+i/aZGnXGxWKVfKVZzr4pVhl/cqOmfVy/5+by6phfm1TctnVstmf9VNr3sVa/RfF+s1BvrFbpUg1K3vk6he6ZeoRurV2g/qJNpf1Sv0H1WJ9P8bqbSv0gs++1CseyzRWLZR4tEzVcWiJvPzK9v3ju/Xnrf/HppYoFYpltQ2/Td6+3L7DV7zV6z1+xV9bW6/hcSd2EeG4WLWAAAAABJRU5ErkJggg==
// @compatible        chrome
// @compatible        firefox
// @compatible        edge
// @compatible        opera
// @compatible        safari
// @version           1.1.0.0
// @require           https://unpkg.com/js-yaml@4.1.0/dist/js-yaml.min.js
// @resource          languageColors https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml
// @grant             GM_getResourceText
// @grant             GM_log
// @grant             GM_xmlhttpRequest
// @grant             GM_getValue
// @grant             GM_setValue
// @grant             GM_addStyle
// @grant             GM_registerMenuCommand
// @run-at            document-idle
// @connect           api.github.com
// @noframes          
// @Created           2024-09-24 04:33:03
// @modified          2024-09-24 04:33:03
// ==/UserScript==
let TOKEN = GM_getValue('githubToken', '')
GM_addStyle(`
    .expand-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.5);display:flex;justify-content:center;align-items:center;z-index:1000;}
    .expand-content{background:white;padding:20px;border-radius:8px;width:400px;box-shadow:0 4px 15px rgba(0,0,0,0.2);position:relative;}
    .expand-title{margin:0 0 10px 0;font-size:20px;}
    .expand-description{margin-bottom:20px;font-size:14px;color:#666;}
    .expand-description a{color:#007bff;text-decoration:underline;}
    #github-token-input{width:100%;padding:8px;border:1px solid #ccc;border-radius:4px;margin-bottom:20px;font-size:14px;}
    #ex-save-token{background-color:#28a745;color:white;border:none;padding:10px 20px;cursor:pointer;border-radius:4px;margin-right:10px;}
    #ex-cancel-token{background-color:#dc3545;color:white;border:none;padding:10px 20px;cursor:pointer;border-radius:4px;}
`)
function createexpand() {
    const expandHTML = `
        <div class="expand-overlay">
            <div class="expand-content">
                <h2 class="expand-title">Set GitHub Token</h2>
                <p class="expand-description">
                    Enter your GitHub personal access token with "repo" scope.
                    <a href="https://github.com/settings/tokens/new?description=GitHub-Linguist-Expand-UserScript&scopes=repo" target="_blank" rel="noopener noreferrer">
                        Click here to create a new token
                    </a>
                </p>
                <input type="text" id="github-token-input" placeholder="Enter your GitHub personal access token">
                <button id="ex-save-token">Save</button>
                <button id="ex-cancel-token" class="cancel">Cancel</button>
            </div>
        </div>
    `
    const expandContainer = document.createElement('div')
    expandContainer.innerHTML = expandHTML
    document.body.appendChild(expandContainer)
    const input = document.getElementById('github-token-input')
    input.value = GM_getValue('githubToken', '')
    document.getElementById('ex-save-token').addEventListener('click', () => {
        const token = input.value.trim()

        GM_setValue('githubToken', token)
        expandContainer.remove()
        TOKEN = token

    })
    document.getElementById('ex-cancel-token').addEventListener('click', () => expandContainer.remove())
}
GM_registerMenuCommand('Set GitHub Token', function () {
    createexpand()
})
//Loads languages.yml (from Github's linguist repo) the most updated, official and complete collection of github languages and their colors
//loaded into a JS object via jsyaml (a library to parse yaml inside of javascript)
const languages = jsyaml.load(GM_getResourceText('languageColors'))
//Contains information about languages and their percentages in the repository
let langPercentagesMap = {}
//Contains information about languages and their colors
let langColorsMap = {}
/**
 * Function to standardize and modernize GM_xmlhttpRequest to work with promises
 * @param {String} url of the endpoint
 * @param {Object} options Contains extra information about the request
 * @returns a promise with the requested content
 */
function request(url, options = {}) {
    return new Promise((resolve, reject) => {
        GM_xmlhttpRequest({
            url,
            method: options.method || 'GET',
            headers: options.headers || {
                Accept: 'application/json',
                'Content-Type': 'application/json'
            },
            responseType: options.responseType || 'json',
            data: options.body || options.data,
            onload: res => resolve(res.response),
            onerror: reject
        })
    })
}
/**
 * Retrieve information about the languages of a repository via the Github API
 * @param {String} user owner of the repository
 * @param {String} repo name
 * @returns the languages of the repository as a JS Object | null if the promise is rejected for any reason.
 */
async function retrieveLanguages(user, repo) {
    try {
        return await request(`https://api.github.com/repos/${user}/${repo}/languages`, {
            headers: {
                Accept: 'application/vnd.github.v3+json',
                ...(TOKEN ? { authorization: `token ${TOKEN}` } : {})
            }
        })
    }
    catch (e) {
        return null
    }
}
/**
 * Builds language bar segments assigning the correct colors and width depending on the language and it's frequency in the repository
 * @param {string} name of the language
 * @param {string} color of the language
 * @param {number} percentage of the language in the repository code
 * @returns a segment span of the language bar with the correct width and color
 */
function buildBarSegmentSpan(name, color, percentage) {
    const segment = document.createElement('span')
    segment.style.setProperty('background-color', color, 'important')
    segment.style.width = percentage + '%'
    //Removes any margin which would make the language bar otherwise inaccurate
    segment.style.setProperty('margin', '0', 'important')
    //Make sure there's at least 1px of width in the bar segment (fixes width of 0.0% segments)
    //TODO: investigate a better way to do this
    segment.style.paddingLeft = '1px'
    segment.setAttribute('itemprop', 'keywords')
    segment.setAttribute('aria-label', name + ' ' + percentage)
    segment.setAttribute('data-view-component', 'true')
    segment.setAttribute('class', 'Progress-item color-bg-success-inverse lingustexpand')
    return segment
}
/**
 * Builds a chip for each language containing
 * - The Color of the language in the bar
 * - The Name of the language
 * - The Percentage of the language in repository files
 * @param {String} owner of the repository
 * @param {String} repo name
 * @param {String} name of the language
 * @param {String} color of the language
 * @param {number} percentage percentage of the language in the repository code
 * @returns A chip components featured as legend for the language bar
 */
function buildLanguageChip(owner, repo, name, color, percentage) {
    const chip = document.createElement('li')
    chip.classList.add('d-inline')
    const chipLink = document.createElement('a')
    chipLink.classList.add('d-inline-flex', 'flex-items-center', 'flex-nowrap', 'Link--secondary', 'no-underline', 'text-small', 'mr-3')
    chipLink.href = `/${owner}/${repo}/search?l=${name}` //Chip link should bring you to the search query with the correct language in place
    //Parse SVG BALL directly injecting the correct color as in-line style
    const svgText = `
    <svg style="color:${color};" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1"
            width="16" data-view-component="true" class="octicon octicon-dot-fill mr-2">
        <path fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8z"></path>
    </svg>
    `
    const svgTMP = document.createElement('template')
    svgTMP.innerHTML = svgText
    chipLink.append(svgTMP.content)
    //^ uses a template HTMLElement to parse HTML into its respective DOM elements
    //Adds language name to the chip
    const chipName = document.createElement('span')
    chipName.classList.add('color-fg-default', 'text-bold', 'mr-1')
    chipName.textContent = name
    chipLink.append(chipName)
    //Adds Language percentage to the chip
    const chipValue = document.createElement('span')
    chipValue.textContent = percentage + '%'
    chipLink.append(chipValue)
    chip.append(chipLink)
    return chip
}
/**
 * Builds the custom language stats section and returns it
 * @returns The full section with complete repository language stats
 */
function buildLanguagesSection(owner, repo) {
    const languageSection = document.createElement('div')
    languageSection.classList.add('mb-3', 'mt-1')
    const bar = document.createElement('span')
    bar.classList.add('Progress', 'mb-2')
    bar.setAttribute('data-view-component', 'true')
    Object.keys(langColorsMap).forEach((lang, i) => {
        const segment = buildBarSegmentSpan(lang, langColorsMap[lang], langPercentagesMap[lang])
        //if (i !== 0) {
        //    segment.style.setProperty('margin-left', '1px');
        //}
        console.log(`当前语言为第${i}个`)
        bar.appendChild(segment)
    })
    languageSection.append(bar)
    const languageUL = document.createElement('ul')
    Object.keys(langColorsMap).forEach((lang) => {
        const languageChip = buildLanguageChip(owner, repo, lang, langColorsMap[lang], langPercentagesMap[lang])
        languageUL.append(languageChip)
    })
    languageSection.append(languageUL)
    return languageSection
}
//MAIN ENTRY POINT
function insertCustomLangStats() {
    if (document.querySelector('.Progress.mb-2')) return
    langPercentagesMap = {}
    langColorsMap = {}
    //Selects the box element that contains files and folders on the repo page
    const mainContent = document.querySelector('.Box-sc-g0xbh4-0.iNSVHo')
    if (!mainContent)
        throw Error('mainContent Hook Selector is dead!')
    //The original language bar in the sidebar
    const originalLangBar = document.querySelector('div.Layout-sidebar span.Progress')
    //array that is generated from the tab URL, it's structured this way: ["", "<repo_owner>", "<repo_name>"]
    const ownerRepo = window.location.pathname.split('/')

    //only works against github.com/ABC/DEF links
    if (ownerRepo.length === 3) {
        //retrieves necessary information about the repository's languages
        retrieveLanguages(ownerRepo[1], ownerRepo[2]).then((lang_vals) => {
            //assume request is successful if object is not null and it doesn't contain 'message' in its keys
            if (lang_vals !== null && !lang_vals.message) {
                //Sum of all language values
                const total = Object.values(lang_vals).reduce((prev, curr) => prev + curr)
                //for each language in the object
                Object.keys(lang_vals).forEach((lang) => {
                    langColorsMap[lang] = languages[lang].color
                    langPercentagesMap[lang] = ((lang_vals[lang] / total) * 100).toFixed(1)
                })
            } else return //Short Circuit
            //Build the new custom lang stats
            const languageSection = buildLanguagesSection(ownerRepo[1], ownerRepo[2])
            mainContent.insertAdjacentElement('beforebegin', languageSection)
            //^ inserts our custom language stats before the box containing directories and files
            //Remove original Language Section (sidebar)
            originalLangBar.parentElement.parentElement.remove()
        })
    }
}
insertCustomLangStats()
function observeUrlChanges(callback, delay = 2000) {
    let lastUrl = location.href
    const observer = new MutationObserver(() => {
        const url = location.href
        if (url !== lastUrl) {
            lastUrl = url
            setTimeout(() => {
                //  console.log("页面发生变动,允许执行")
                callback()
            }, delay)
        }
    })
    observer.observe(document, { subtree: true, childList: true })
    return observer
}
observeUrlChanges(insertCustomLangStats)