Includes: API (Express/TypeScript), Astro site, Python workers, document generators, FCC compliance tools, Canada CRTC formation, Ansible infrastructure, and deployment scripts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
53 lines
2.4 KiB
JavaScript
53 lines
2.4 KiB
JavaScript
/**
|
|
* Content script for USAC E-File (forms.universalservice.org)
|
|
*
|
|
* Injects a guidance overlay when on the USAC access management pages
|
|
* to help the client grant filing access to filings@performancewest.net.
|
|
*/
|
|
(function() {
|
|
'use strict';
|
|
|
|
const PW_EMAIL = 'filings@performancewest.net';
|
|
|
|
// Wait for page to load
|
|
setTimeout(injectGuidance, 2000);
|
|
|
|
function injectGuidance() {
|
|
// Look for access management or user forms
|
|
const emailFields = document.querySelectorAll('input[type="text"][name*="email"], input[type="email"], input[name*="user"]');
|
|
|
|
// Inject floating helper banner
|
|
const banner = document.createElement('div');
|
|
banner.id = 'pw-usac-helper';
|
|
banner.innerHTML = `
|
|
<div style="position:fixed;bottom:20px;right:20px;z-index:99999;background:#1e3a5f;color:white;padding:16px 20px;border-radius:12px;box-shadow:0 4px 20px rgba(0,0,0,0.2);max-width:320px;font-family:-apple-system,sans-serif;">
|
|
<div style="display:flex;justify-content:space-between;align-items:start;">
|
|
<strong style="font-size:13px;">Performance West Helper</strong>
|
|
<button id="pw-close-usac" style="background:none;border:none;color:#94a3b8;cursor:pointer;font-size:18px;line-height:1;">×</button>
|
|
</div>
|
|
<p style="font-size:11px;color:#94a3b8;margin:8px 0;">Grant filing access to this email for your 499 Filer ID:</p>
|
|
<div style="background:#2d4a73;padding:8px 12px;border-radius:6px;font-family:monospace;font-size:13px;cursor:pointer;user-select:all;" id="pw-email-copy-usac">${PW_EMAIL}</div>
|
|
<p style="font-size:10px;color:#64748b;margin-top:8px;">Click to copy. Navigate to "Manage Users" or "Authorized Contacts" and add this email with filing permissions.</p>
|
|
</div>
|
|
`;
|
|
document.body.appendChild(banner);
|
|
|
|
document.getElementById('pw-close-usac')?.addEventListener('click', () => banner.remove());
|
|
|
|
document.getElementById('pw-email-copy-usac')?.addEventListener('click', () => {
|
|
navigator.clipboard.writeText(PW_EMAIL).then(() => {
|
|
const el = document.getElementById('pw-email-copy-usac');
|
|
if (el) { el.textContent = 'Copied!'; setTimeout(() => el.textContent = PW_EMAIL, 1500); }
|
|
});
|
|
});
|
|
|
|
// Auto-fill email fields if empty
|
|
emailFields.forEach(field => {
|
|
if (!field.value) {
|
|
field.value = PW_EMAIL;
|
|
field.style.backgroundColor = '#eff6ff';
|
|
field.style.borderColor = '#93c5fd';
|
|
}
|
|
});
|
|
}
|
|
})();
|