MCPcopy Create free account
hub / github.com/error311/FileRise / showVirusScanNotice

Function showVirusScanNotice

public/js/upload.js:62–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60let _virusScanNoticeDismissed = false;
61
62function showVirusScanNotice() {
63 if (!isVirusScanLikelyEnabled()) return;
64 if (_virusScanNoticeDismissed) return;
65
66 // If already visible, don't duplicate
67 let existing = document.getElementById('frVirusScanNotice');
68 if (existing) return;
69
70 const box = document.createElement('div');
71 box.id = 'frVirusScanNotice';
72 box.className = 'fr-virus-notice card';
73
74 // Minimal inline layout so we don't rely on extra CSS
75 Object.assign(box.style, {
76 position: 'fixed',
77 left: '50%',
78 top: '50%',
79 transform: 'translate(-50%, -50%)',
80 maxWidth: '420px',
81 width: 'calc(100% - 32px)', // nice on mobile too
82 zIndex: '11080',
83 padding: '16px 18px',
84 borderRadius: '10px',
85 boxShadow: '0 4px 24px rgba(0,0,0,0.35)',
86 backgroundColor: getComputedStyle(document.body).backgroundColor || '#fff',
87 color: getComputedStyle(document.body).color || '#111',
88 });
89
90 box.innerHTML = `
91 <div style="display:flex;align-items:center;justify-content:space-between;gap:8px;">
92 <div style="display:flex;align-items:center;gap:6px;flex:1;">
93 <span class="material-icons" style="font-size:20px;flex-shrink:0;">shield</span>
94 <div style="font-size:0.9rem;">
95 <div style="font-weight:600;margin-bottom:2px;">
96 ${escapeHTML(t ? t('clamav_scanning_title') || 'Scanning uploads for viruses…' : 'Scanning uploads for viruses…')}
97 </div>
98 <div style="font-size:0.8rem;opacity:0.8;">
99 ${escapeHTML(t ? t('clamav_scanning_desc') || 'Uploads may take a little longer while antivirus scanning is enabled.' : 'Uploads may take a little longer while antivirus scanning is enabled.')}
100 </div>
101 </div>
102 </div>
103 <button type="button"
104 id="frVirusScanNoticeClose"
105 class="btn btn-sm btn-outline-secondary"
106 style="flex-shrink:0;">
107 ${escapeHTML(t ? t('close') || 'Close' : 'Close')}
108 </button>
109 </div>
110 <div class="progress" style="height:6px;margin-top:8px;">
111 <div class="progress-bar progress-bar-striped progress-bar-animated" style="width:100%;"></div>
112 </div>
113 `;
114
115 document.body.appendChild(box);
116
117 const closeBtn = box.querySelector('#frVirusScanNoticeClose');
118 if (closeBtn) {
119 closeBtn.addEventListener('click', () => {

Callers 2

startResumableUploadNowFunction · 0.85
initUploadFunction · 0.85

Calls 4

isVirusScanLikelyEnabledFunction · 0.85
escapeHTMLFunction · 0.85
tFunction · 0.85
hideVirusScanNoticeFunction · 0.85

Tested by

no test coverage detected