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
// version 1.5
// version 1.6
// 2023-02-08
// Copyright (c) 2021 Created by Georgios Sokianos
// Released under the GPL license
@ -10,7 +10,7 @@
// @namespace none
// @description Fixes css in GitHub
// @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
// ==/UserScript==
@ -99,23 +99,21 @@ window.onload = function () {
archiveLink.appendChild(archiveText);
archiveLink.title = "Download as a ZIP file";
archiveLink.href = archiveUrl + ".zip";
container.appendChild(archiveLink);
}
}
// Add assets URL in a release
var fragment = document.querySelector("include-fragment[loading='lazy']");
if (fragment !== null) {
var assetUrl = fragment.getAttribute('src');
// Add assets URL in the releases
var fragments = document.querySelectorAll("include-fragment[loading='lazy']");
for (i = 0; i < fragments.length; ++i) {
var assetUrl = fragments[i].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);
fragments[i].appendChild(assetLink);
}
}
}