Added assets link in releases and made changes at the menus to look better

This commit is contained in:
George Sokianos 2022-11-25 20:51:50 +00:00
parent 630cae9cfd
commit 54800274c3
1 changed files with 28 additions and 6 deletions

View File

@ -1,6 +1,6 @@
// GitHub CSS fixes // GitHub CSS fixes
// version 1.3 // version 1.4
// 2022-06-04 // 2022-11-25
// Copyright (c) 2021 Created by Georgios Sokianos // Copyright (c) 2021 Created by Georgios Sokianos
// Released under the GPL license // Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html // http://www.gnu.org/copyleft/gpl.html
@ -10,7 +10,7 @@
// @namespace none // @namespace none
// @description Fixes css in GitHub // @description Fixes css in GitHub
// @include https://github.com/* // @include https://github.com/*
// @version $VER: GitHub CSS fixes 1.3 (03.11.2022) // @version $VER: GitHub CSS fixes 1.4 (25.11.2022)
// @url https://ko-fi.com/walkero // @url https://ko-fi.com/walkero
// ==/UserScript== // ==/UserScript==
@ -35,10 +35,17 @@ ul.d-lg-flex > li, \
ul.d-flex > li { display: inline-block !important; vertical-align: top; } \ ul.d-flex > li { display: inline-block !important; vertical-align: top; } \
header nav { display: inline-block !important; } \ header nav { display: inline-block !important; } \
.Box--overlay, \ .Box--overlay, \
header nav li.d-block .dropdown-menu { background-color: white !important; } \ header nav li.d-block .dropdown-menu { background-color: #cacaca !important; padding: 10px !important;} \
header nav li summary { color: black !important; } \ header nav li summary { color: black !important; } \
li.HeaderMenu-item button { color: blue !important; } \ li.HeaderMenu-item button, \
a.HeaderMenu-link { color: blue !important; } \ a.HeaderMenu-link { color: blue !important; } \
a.HeaderMenu-link:hover, \
a.HeaderMenu-dropdown-link:hover, \
a.HeaderMenu-dropdown-link div:hover { color: red !important; } \
a.HeaderMenu-dropdown-link { margin-bottom: 5px; } \
a.HeaderMenu-dropdown-link > svg, \
a.HeaderMenu-dropdown-link > div { vertical-align: top; display: inline-block !important;} \
.HeaderMenu-dropdown ul.list-style-none li.h4.color-fg-default { margin-top: 10px; font-size: 14px !important; color: black !important; } \
summary.HeaderMenu-link svg { display: none !important; } \ summary.HeaderMenu-link svg { display: none !important; } \
input.header-search-input { color: black; border: #323232; } \ input.header-search-input { color: black; border: #323232; } \
#responsive-meta-container > div > div { display: inline-block !important; } \ #responsive-meta-container > div > div { display: inline-block !important; } \
@ -70,6 +77,7 @@ if (style.styleSheet){
} }
window.onload = function () { window.onload = function () {
// Add a download zip file url in a branch
var canonicalElem = document.querySelector("link[rel='canonical']"); var canonicalElem = document.querySelector("link[rel='canonical']");
if (canonicalElem !== null) { if (canonicalElem !== null) {
var canonicalUrl = canonicalElem.href; var canonicalUrl = canonicalElem.href;
@ -95,5 +103,19 @@ window.onload = function () {
container.appendChild(archiveLink); container.appendChild(archiveLink);
} }
} }
}
// Add assets URL in a release
var fragment = document.querySelector("include-fragment[data-test-selector='lazy-asset-list-fragment']");
if (fragment !== null) {
var assetUrl = fragment.getAttribute('src');
if (assetUrl !== null) {
var assetUrlText = document.createTextNode(assetUrl);
var assetLink = document.createElement("a");
assetLink.appendChild(assetUrlText);
assetLink.title = "List of assets";
assetLink.href = assetUrl;
fragment.appendChild(assetLink);
}
}
}