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

Function loadFile

tools/pythonauto/static/codemirror/codemirror.js:1913–1923  ·  view source on GitHub ↗
(file, i)

Source from the content-addressed store, hash-verified

1911 if (files && files.length && window.FileReader && window.File) {
1912 var n = files.length, text = Array(n), read = 0;
1913 var loadFile = function(file, i) {
1914 var reader = new FileReader;
1915 reader.onload = function() {
1916 text[i] = reader.result;
1917 if (++read == n) {
1918 pos = clipPos(cm.doc, pos);
1919 makeChange(cm.doc, {from: pos, to: pos, text: splitLines(text.join("\n")), origin: "paste"}, "around");
1920 }
1921 };
1922 reader.readAsText(file);
1923 };
1924 for (var i = 0; i < n; ++i) loadFile(files[i], i);
1925 } else {
1926 // Don't do a replace if the drop happened inside of the selected text.

Callers 1

onDropFunction · 0.70

Calls 2

clipPosFunction · 0.70
makeChangeFunction · 0.70

Tested by

no test coverage detected