mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +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 += "<br>\n";
|
||||||
});
|
});
|
||||||
textToSave += "</body></html>";
|
textToSave += "</body></html>";
|
||||||
var hiddenElement = document.createElement('a');
|
|
||||||
hiddenElement.href = 'data:attachment/text,' + encodeURI(textToSave);
|
|
||||||
hiddenElement.target = '_blank';
|
|
||||||
|
|
||||||
var fileprefix = "log";
|
var fileprefix = "log";
|
||||||
var extension =".html";
|
var extension =".html";
|
||||||
@@ -671,14 +668,17 @@ function start_vue() {
|
|||||||
var filename = fileprefix+datesegment+extension;
|
var filename = fileprefix+datesegment+extension;
|
||||||
|
|
||||||
//Unlikely to work unfortunately, not supported in any version of IE, only Edge
|
//Unlikely to work unfortunately, not supported in any version of IE, only Edge
|
||||||
|
var hiddenElement = document.createElement('a');
|
||||||
if (hiddenElement.download !== undefined) {
|
if (hiddenElement.download !== undefined) {
|
||||||
hiddenElement.download = filename;
|
hiddenElement.href = 'data:attachment/text,' + encodeURI(textToSave); //Has a problem in byond 512 due to weird unicode handling
|
||||||
hiddenElement.click();
|
hiddenElement.target = '_blank';
|
||||||
//Probably what will end up getting used
|
hiddenElement.download = filename;
|
||||||
} else {
|
hiddenElement.click();
|
||||||
let blob = new Blob([textToSave], {type: 'text/html;charset=utf8;'});
|
//Probably what will end up getting used
|
||||||
saved = window.navigator.msSaveOrOpenBlob(blob, filename);
|
} else {
|
||||||
}
|
var blob = new Blob([textToSave], {type: 'text/html;charset=utf8;'});
|
||||||
|
saved = window.navigator.msSaveOrOpenBlob(blob, filename);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
do_latency_test: function() {
|
do_latency_test: function() {
|
||||||
send_latency_check();
|
send_latency_check();
|
||||||
|
|||||||
Reference in New Issue
Block a user