Added new mooncore js dependencies. Added ace editor build
This commit is contained in:
13
Moonlight.Client/wwwroot/js/downloadService.js
Normal file
13
Moonlight.Client/wwwroot/js/downloadService.js
Normal file
@@ -0,0 +1,13 @@
|
||||
window.moonCoreDownloadService = {
|
||||
download: async function (fileName, contentStreamReference) {
|
||||
const arrayBuffer = await contentStreamReference.arrayBuffer();
|
||||
const blob = new Blob([arrayBuffer]);
|
||||
const url = URL.createObjectURL(blob);
|
||||
const anchorElement = document.createElement('a');
|
||||
anchorElement.href = url;
|
||||
anchorElement.download = fileName ?? '';
|
||||
anchorElement.click();
|
||||
anchorElement.remove();
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user