MCPcopy Create free account
hub / github.com/Threadfin/Threadfin / restore

Function restore

ts/base_ts.ts:648–698  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

646}
647
648function restore() {
649
650 if (document.getElementById('upload')) {
651 document.getElementById('upload').remove()
652 }
653
654 var restore = document.createElement("INPUT");
655 restore.setAttribute("type", "file");
656 restore.setAttribute("class", "notVisible");
657 restore.setAttribute("name", "");
658 restore.id = "upload";
659
660 document.body.appendChild(restore);
661 restore.click();
662
663 restore.onchange = function () {
664
665 var filename = (restore as HTMLInputElement).files[0].name
666 var check = confirm("File: " + filename + "\n{{.confirm.restore}}");
667
668 if (check == true) {
669
670 var reader = new FileReader();
671 var file = (document.querySelector('input[type=file]') as HTMLInputElement).files[0];
672
673 if (file) {
674
675 reader.readAsDataURL(file);
676 reader.onload = function () {
677 console.log(reader.result);
678 var data = new Object();
679 var cmd = "ThreadfinRestore"
680 data["base64"] = reader.result
681
682 var server: Server = new Server(cmd)
683 server.request(data)
684
685 };
686
687 } else {
688 alert("File could not be loaded")
689 }
690
691 restore.remove()
692 return
693 }
694
695 }
696
697 return
698}
699
700function uploadLogo() {
701

Callers

nothing calls this directly

Calls 1

requestMethod · 0.95

Tested by

no test coverage detected