Old Github languages bar

move the languages bar to the top like the old github

Verze ze dne 10. 08. 2023. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Old Github languages bar
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  move the languages bar to the top like the old github
// @author       jrvgr
// @match        https://github.com/*/*
// @exclude      https://github.com/*/*/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant        window.onurlchange
// ==/UserScript==

(function() {
    'use strict';

    shiftLayout()
    if (window.onurlchange === null) addEventListener('urlchange', shiftLayout);

    function shiftLayout() {
    setTimeout(() => {
    const langs = document.querySelector(".BorderGrid-row ul:has(li > .mr-3 > svg)")
    const bar = document.querySelector(".mb-2:has(.Progress > span.Progress-item.color-bg-success-emphasis)")
    const legacyNewPlace = document.querySelector(".Layout-main div")
    const newPlace = document.querySelector("div[data-selector='repos-split-pane-content'] div:has(div + div) div")
    if (newPlace) {
        newPlace.insertAdjacentElement("afterEnd", bar)
        bar.insertAdjacentElement("afterEnd", langs)
    } else {
        legacyNewPlace.insertAdjacentElement("afterEnd", bar)
        bar.insertAdjacentElement("afterEnd", langs)
    }
    langs.setAttribute('style', 'margin-bottom: 1em !important; display: flex; justify-content: space-evenly; flex-wrap: wrap; background: var(--color-notifications-row-read-bg); border-radius: 5px; border: var(--color-bg-discussions-row-emoji-box) 1px solid; box-sizing: border-box; padding: 5px; padding-bottom: 3px; margin-top: 10px;');
    }, 200)

/*    const langs = document.querySelector(".BorderGrid-row ul:has(li > a > svg)")
    const oldnewLangsPlace = document.querySelector("div.Layout-sidebar > div > div.BorderGrid-row.hide-sm.hide-md > div > h3");
    const newLangsPlace = document.querySelector("div[data-selector='repos-split-pane-content'] div:has(div + div) div")

    newLangsPlace.insertAdjacentElement("afterEnd", langs)
    */
    }
})();