Changed the release link to appear on all releases sections

This commit is contained in:
George Sokianos 2023-02-08 16:04:50 +00:00
parent c1c96806ff
commit 9ed8ca2d91
1 changed files with 7 additions and 9 deletions

View File

@ -1,5 +1,5 @@
// GitHub CSS fixes // GitHub CSS fixes
// version 1.5 // version 1.6
// 2023-02-08 // 2023-02-08
// Copyright (c) 2021 Created by Georgios Sokianos // Copyright (c) 2021 Created by Georgios Sokianos
// Released under the GPL license // Released under the GPL license
@ -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.5 (08.02.2023) // @version $VER: GitHub CSS fixes 1.6 (08.02.2023)
// @url https://ko-fi.com/walkero // @url https://ko-fi.com/walkero
// ==/UserScript== // ==/UserScript==
@ -99,23 +99,21 @@ window.onload = function () {
archiveLink.appendChild(archiveText); archiveLink.appendChild(archiveText);
archiveLink.title = "Download as a ZIP file"; archiveLink.title = "Download as a ZIP file";
archiveLink.href = archiveUrl + ".zip"; archiveLink.href = archiveUrl + ".zip";
container.appendChild(archiveLink); container.appendChild(archiveLink);
} }
} }
// Add assets URL in a release // Add assets URL in the releases
var fragment = document.querySelector("include-fragment[loading='lazy']"); var fragments = document.querySelectorAll("include-fragment[loading='lazy']");
if (fragment !== null) { for (i = 0; i < fragments.length; ++i) {
var assetUrl = fragment.getAttribute('src'); var assetUrl = fragments[i].getAttribute('src');
if (assetUrl !== null) { if (assetUrl !== null) {
var assetUrlText = document.createTextNode(assetUrl); var assetUrlText = document.createTextNode(assetUrl);
var assetLink = document.createElement("a"); var assetLink = document.createElement("a");
assetLink.appendChild(assetUrlText); assetLink.appendChild(assetUrlText);
assetLink.title = "List of assets"; assetLink.title = "List of assets";
assetLink.href = assetUrl; assetLink.href = assetUrl;
fragments[i].appendChild(assetLink);
fragment.appendChild(assetLink);
} }
} }
} }