add photo placeholder, mirrored camera capture, configurable footer, and student .url zip export
This commit is contained in:
@@ -93,6 +93,34 @@ function fallbackCopy(text, done) {
|
||||
document.body.removeChild(ta);
|
||||
}
|
||||
|
||||
function studentUrlContent(name) {
|
||||
const url = `${location.origin}/?nameInput=${encodeURIComponent(name)}`;
|
||||
return `[InternetShortcut]\r\nURL=${url}\r\n`;
|
||||
}
|
||||
|
||||
function safeWindowsName(name) {
|
||||
return String(name).replace(/[\\/:*?"<>|]/g, '_').replace(/\s+/g, '_');
|
||||
}
|
||||
|
||||
function downloadBlob(blob, filename) {
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
|
||||
async function exportStudentUrlZip(students, zipName) {
|
||||
if (typeof JSZip === 'undefined') { alert('JSZip не загружен'); return; }
|
||||
const zip = new JSZip();
|
||||
students.forEach(s => {
|
||||
zip.file(safeWindowsName(s.name) + '.url', studentUrlContent(s.name));
|
||||
});
|
||||
const blob = await zip.generateAsync({ type: 'blob' });
|
||||
downloadBlob(blob, zipName);
|
||||
}
|
||||
|
||||
function copyText(text) {
|
||||
const done = () => showToast('Скопировано: ' + text);
|
||||
if (navigator.clipboard && window.isSecureContext) {
|
||||
|
||||
Reference in New Issue
Block a user