MCPcopy Index your code
hub / github.com/csev/py4e / loadFile

Function loadFile

tools/pythonauto/static/codemirrorepl/codemirrorepl.js:666–679  ·  view source on GitHub ↗
(file, i)

Source from the content-addressed store, hash-verified

664 if (!pos || options.readOnly) return;
665 if (files && files.length && window.FileReader && window.File) {
666 function loadFile(file, i) {
667 var reader = new FileReader;
668 reader.onload = function() {
669 text[i] = reader.result;
670 if (++read == n) {
671 pos = clipPos(pos);
672 operation(function() {
673 var end = replaceRange(text.join(""), pos, pos);
674 setSelectionUser(pos, end);
675 })();
676 }
677 };
678 reader.readAsText(file);
679 }
680 var n = files.length, text = Array(n), read = 0;
681 for (var i = 0; i < n; ++i) loadFile(files[i], i);
682 }

Callers 1

onDropFunction · 0.70

Calls 4

setSelectionUserFunction · 0.85
clipPosFunction · 0.70
operationFunction · 0.70
replaceRangeFunction · 0.70

Tested by

no test coverage detected