mirror of
https://github.com/LizardByte/Sunshine.git
synced 2024-11-16 14:09:43 +00:00
c892026454
Some checks failed
CI / GitHub Env Debug (push) Has been cancelled
CI / Setup Release (push) Has been cancelled
CI / Setup Flatpak Matrix (push) Has been cancelled
CI Docker / Check Dockerfiles (push) Has been cancelled
CodeQL / Get language matrix (push) Has been cancelled
Build GH-Pages / update_pages (push) Has been cancelled
CI / Linux Flatpak (push) Has been cancelled
CI / Linux ${{ matrix.type }} (--appimage-build, 22.04, AppImage) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 12) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 13) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 14) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (ubuntu, latest) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (ubuntu, latest, true) (push) Has been cancelled
CI / Macports (macOS-${{ matrix.os_version }}) (12, true) (push) Has been cancelled
CI / Macports (macOS-${{ matrix.os_version }}) (13) (push) Has been cancelled
CI / Macports (macOS-${{ matrix.os_version }}) (14) (push) Has been cancelled
CI / Windows (push) Has been cancelled
CI Docker / Setup Release (push) Has been cancelled
CI Docker / Docker${{ matrix.tag }} (push) Has been cancelled
CodeQL / Analyze (${{ matrix.name }}) (push) Has been cancelled
38 lines
1.3 KiB
JavaScript
38 lines
1.3 KiB
JavaScript
/**
|
|
* @brief Add a button to open the configuration option for each table
|
|
*/
|
|
document.addEventListener("DOMContentLoaded", function() {
|
|
const tables = document.querySelectorAll("table");
|
|
tables.forEach(table => {
|
|
if (table.className !== "doxtable") {
|
|
return;
|
|
}
|
|
|
|
let previousElement = table.previousElementSibling;
|
|
while (previousElement && previousElement.tagName !== "H2") {
|
|
previousElement = previousElement.previousElementSibling;
|
|
}
|
|
if (previousElement && previousElement.textContent) {
|
|
const sectionId = previousElement.textContent.trim().toLowerCase();
|
|
const newRow = document.createElement("tr");
|
|
|
|
const newCell = document.createElement("td");
|
|
newCell.setAttribute("colspan", "3");
|
|
|
|
const newCode = document.createElement("code");
|
|
newCode.className = "open-button";
|
|
newCode.setAttribute("onclick", `window.open('https://${document.getElementById('host-authority').value}/config/#${sectionId}', '_blank')`);
|
|
newCode.textContent = "Open";
|
|
|
|
newCell.appendChild(newCode);
|
|
newRow.appendChild(newCell);
|
|
|
|
// get the table body
|
|
const tbody = table.querySelector("tbody");
|
|
|
|
// Insert at the beginning of the table
|
|
tbody.insertBefore(newRow, tbody.firstChild);
|
|
}
|
|
});
|
|
});
|