Old Github languages bar

move the languages bar to the top like the old github

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Old Github languages bar
// @namespace    http://tampermonkey.net/
// @version      0.6
// @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 cell = document.querySelector(".BorderGrid-row:has(li > .mr-3 > svg")
    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;');
    cell.remove()
    }, 0)
    }
})();