Files
librechat-custom/assets/custom2.js
T

45 lines
1.2 KiB
JavaScript

// Co-op UI polish.
// The auth form and footer are client-rendered (React), so a plain `load`
// listener runs too early — a MutationObserver re-checks on every DOM change.
(function () {
function hideSignupPrompt() {
document.querySelectorAll('p').forEach(function (p) {
var link = p.querySelector('a[href*="register"]');
var text = (p.textContent || '');
if (link || text.indexOf("Don't have an account") !== -1) {
p.style.display = 'none';
}
});
}
// Footer: turn the plain co-op text (injected at build time) into the
// linked version — "Inference Cooperative" links to the homepage.
function fixFooter() {
var f = document.querySelector('footer');
if (!f || f.dataset.coopFooter) return;
f.dataset.coopFooter = '1';
f.innerHTML =
'<a href="https://inference.coop">Inference Cooperative</a>' +
' · Our AI, governed together';
}
function run() {
hideSignupPrompt();
fixFooter();
}
function start() {
run();
new MutationObserver(run).observe(document.body, {
childList: true,
subtree: true,
});
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', start);
} else {
start();
}
})();