mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Fix chat exporting when someone has used unicode
Only affects clients still using 512
This commit is contained in:
@@ -641,9 +641,6 @@ function start_vue() {
|
||||
textToSave += "<br>\n";
|
||||
});
|
||||
textToSave += "</body></html>";
|
||||
var hiddenElement = document.createElement('a');
|
||||
hiddenElement.href = 'data:attachment/text,' + encodeURI(textToSave);
|
||||
hiddenElement.target = '_blank';
|
||||
|
||||
var fileprefix = "log";
|
||||
var extension =".html";
|
||||
@@ -671,12 +668,15 @@ function start_vue() {
|
||||
var filename = fileprefix+datesegment+extension;
|
||||
|
||||
//Unlikely to work unfortunately, not supported in any version of IE, only Edge
|
||||
var hiddenElement = document.createElement('a');
|
||||
if (hiddenElement.download !== undefined) {
|
||||
hiddenElement.href = 'data:attachment/text,' + encodeURI(textToSave); //Has a problem in byond 512 due to weird unicode handling
|
||||
hiddenElement.target = '_blank';
|
||||
hiddenElement.download = filename;
|
||||
hiddenElement.click();
|
||||
//Probably what will end up getting used
|
||||
} else {
|
||||
let blob = new Blob([textToSave], {type: 'text/html;charset=utf8;'});
|
||||
var blob = new Blob([textToSave], {type: 'text/html;charset=utf8;'});
|
||||
saved = window.navigator.msSaveOrOpenBlob(blob, filename);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user