ci: use Gitea API for releases #2
+8
-3
@@ -156,13 +156,18 @@
|
|||||||
if (!included.length) throw new Error('No enrolled courses found.');
|
if (!included.length) throw new Error('No enrolled courses found.');
|
||||||
const totalUnits = ISMIStools.sumUnits(included);
|
const totalUnits = ISMIStools.sumUnits(included);
|
||||||
const html = ISMIStools.buildStudyLoadHtml({ header, courses: included, totalUnits });
|
const html = ISMIStools.buildStudyLoadHtml({ header, courses: included, totalUnits });
|
||||||
const win = window.open('', '_blank');
|
const blob = new Blob([html], { type: 'text/html' });
|
||||||
|
const url = URL.createObjectURL(blob);
|
||||||
|
const win = window.open(url, '_blank');
|
||||||
if (!win) {
|
if (!win) {
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
showToast('Popup blocked — allow popups for this site, then try again.', true);
|
showToast('Popup blocked — allow popups for this site, then try again.', true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
win.document.write(html);
|
// The blob document runs its own onload → window.print(). Never touch
|
||||||
win.document.close();
|
// win.document here: if the new tab navigates cross-origin, accessing it
|
||||||
|
// throws "Permission denied".
|
||||||
|
setTimeout(() => URL.revokeObjectURL(url), 60000);
|
||||||
showToast('Opened printable Study Load.');
|
showToast('Opened printable Study Load.');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
showToast('Error: ' + ((err && err.message) || err), true);
|
showToast('Error: ' + ((err && err.message) || err), true);
|
||||||
|
|||||||
Reference in New Issue
Block a user