mirror of https://github.com/vector-im/riot-web
format
parent
4af8ec4d40
commit
566e7bc8d6
|
@ -324,20 +324,20 @@ export default class HTMLExporter extends Exporter {
|
||||||
public async export() {
|
public async export() {
|
||||||
console.info("Starting export process...");
|
console.info("Starting export process...");
|
||||||
console.info("Fetching events...");
|
console.info("Fetching events...");
|
||||||
|
|
||||||
const fetchStart = performance.now();
|
const fetchStart = performance.now();
|
||||||
const res = await this.getRequiredEvents();
|
const res = await this.getRequiredEvents();
|
||||||
const fetchEnd = performance.now();
|
const fetchEnd = performance.now();
|
||||||
|
|
||||||
console.log(`Fetched ${res.length} events in ${(fetchEnd - fetchStart)/1000}s`);
|
console.log(`Fetched ${res.length} events in ${(fetchEnd - fetchStart)/1000}s`);
|
||||||
console.info("Creating HTML...");
|
|
||||||
|
|
||||||
|
console.info("Creating HTML...");
|
||||||
const html = await this.createHTML(res);
|
const html = await this.createHTML(res);
|
||||||
|
|
||||||
this.addFile("index.html", new Blob([html]));
|
this.addFile("index.html", new Blob([html]));
|
||||||
this.addFile("css/style.css", new Blob([exportCSS]));
|
this.addFile("css/style.css", new Blob([exportCSS]));
|
||||||
this.addFile("js/script.js", new Blob([exportJS]));
|
this.addFile("js/script.js", new Blob([exportJS]));
|
||||||
|
|
||||||
|
|
||||||
for (const iconName in exportIcons) {
|
for (const iconName in exportIcons) {
|
||||||
this.addFile(`icons/${iconName}`, new Blob([exportIcons[iconName]]));
|
this.addFile(`icons/${iconName}`, new Blob([exportIcons[iconName]]));
|
||||||
}
|
}
|
||||||
|
@ -347,7 +347,10 @@ export default class HTMLExporter extends Exporter {
|
||||||
await this.downloadZIP();
|
await this.downloadZIP();
|
||||||
|
|
||||||
const exportEnd = performance.now();
|
const exportEnd = performance.now();
|
||||||
console.info(`Export Successful! Exported ${res.length} events in ${(exportEnd - fetchStart)/1000} seconds`);
|
|
||||||
|
console.info("Export successful!")
|
||||||
|
console.log(`Exported ${res.length} events in ${(exportEnd - fetchStart)/1000} seconds`);
|
||||||
|
|
||||||
window.removeEventListener("beforeunload", this.onBeforeUnload);
|
window.removeEventListener("beforeunload", this.onBeforeUnload);
|
||||||
window.removeEventListener("onunload", this.abortExport);
|
window.removeEventListener("onunload", this.abortExport);
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,13 +73,14 @@ ${json}
|
||||||
public async export() {
|
public async export() {
|
||||||
console.info("Starting export process...");
|
console.info("Starting export process...");
|
||||||
console.info("Fetching events...");
|
console.info("Fetching events...");
|
||||||
|
|
||||||
const fetchStart = performance.now();
|
const fetchStart = performance.now();
|
||||||
const res = await this.getRequiredEvents();
|
const res = await this.getRequiredEvents();
|
||||||
const fetchEnd = performance.now();
|
const fetchEnd = performance.now();
|
||||||
|
|
||||||
console.log(`Fetched ${res.length} events in ${(fetchEnd - fetchStart)/1000}s`);
|
console.log(`Fetched ${res.length} events in ${(fetchEnd - fetchStart)/1000}s`);
|
||||||
console.info("Creating output...");
|
|
||||||
|
|
||||||
|
console.info("Creating output...");
|
||||||
const text = await this.createOutput(res);
|
const text = await this.createOutput(res);
|
||||||
|
|
||||||
if (this.files.length) {
|
if (this.files.length) {
|
||||||
|
@ -91,8 +92,10 @@ ${json}
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportEnd = performance.now();
|
const exportEnd = performance.now();
|
||||||
console.info(`Export successful!`)
|
|
||||||
|
console.info("Export successful!")
|
||||||
console.log(`Exported ${res.length} events in ${(exportEnd - fetchStart)/1000} seconds`);
|
console.log(`Exported ${res.length} events in ${(exportEnd - fetchStart)/1000} seconds`);
|
||||||
|
|
||||||
window.removeEventListener("beforeunload", this.onBeforeUnload);
|
window.removeEventListener("beforeunload", this.onBeforeUnload);
|
||||||
window.removeEventListener("onunload", this.abortExport);
|
window.removeEventListener("onunload", this.abortExport);
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,13 +91,14 @@ export default class PlainTextExporter extends Exporter {
|
||||||
public async export() {
|
public async export() {
|
||||||
console.info("Starting export process...");
|
console.info("Starting export process...");
|
||||||
console.info("Fetching events...");
|
console.info("Fetching events...");
|
||||||
|
|
||||||
const fetchStart = performance.now();
|
const fetchStart = performance.now();
|
||||||
const res = await this.getRequiredEvents();
|
const res = await this.getRequiredEvents();
|
||||||
const fetchEnd = performance.now();
|
const fetchEnd = performance.now();
|
||||||
|
|
||||||
console.log(`Fetched ${res.length} events in ${(fetchEnd - fetchStart)/1000}s`);
|
console.log(`Fetched ${res.length} events in ${(fetchEnd - fetchStart)/1000}s`);
|
||||||
console.info("Creating Output...");
|
|
||||||
|
|
||||||
|
console.info("Creating output...");
|
||||||
const text = await this.createOutput(res);
|
const text = await this.createOutput(res);
|
||||||
|
|
||||||
if (this.files.length) {
|
if (this.files.length) {
|
||||||
|
@ -109,7 +110,10 @@ export default class PlainTextExporter extends Exporter {
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportEnd = performance.now();
|
const exportEnd = performance.now();
|
||||||
console.info(`Export Successful! Exported ${res.length} events in ${(exportEnd - fetchStart)/1000} seconds`);
|
|
||||||
|
console.info("Export successful!")
|
||||||
|
console.log(`Exported ${res.length} events in ${(exportEnd - fetchStart)/1000} seconds`);
|
||||||
|
|
||||||
window.removeEventListener("onunload", this.abortExport);
|
window.removeEventListener("onunload", this.abortExport);
|
||||||
window.removeEventListener("beforeunload", this.onBeforeUnload);
|
window.removeEventListener("beforeunload", this.onBeforeUnload);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue