MCPcopy Create free account
hub / github.com/Milkyroad/SCiPNET / loadFile

Function loadFile

public/src/js/utils.js:88–112  ·  view source on GitHub ↗
(quote1, quote2)

Source from the content-addressed store, hash-verified

86}
87
88function loadFile(quote1, quote2) {
89 inBar = true
90 scroll()
91 var progressNo = 0;
92 var percentage = 0;
93 var chunks;
94 var progress = `█---------------`;
95 var loadProgress = window.setInterval(
96 function() {
97 if (progressNo != 16) {
98 progressNo += 1
99 progress = `█${progress.slice(0, -1)}`
100 percentage = progressNo / 16 * 100
101 chunks = Math.round((percentage / 100) * 600)
102 $d.find("#fileSize").replaceWith(`<blockquote id='fileSize'>${quote1}: |<span style="font-family:monospace">${progress}</span>| ${percentage}% || ${chunks}/600 chunks loaded </blockquote>`)
103 } else {
104 clearInterval(loadProgress)
105 $d.find("#fileSize").after(`<blockquote id="waitingToAdd">${quote2}...</blockquote>`);
106 addDot()
107 scroll()
108 $d.find("#fileSize").removeAttr("id", "fileSize")
109 inBar = false
110 }
111 }, 30);
112}
113export {
114 appendError,
115 appendWarn,

Callers 2

accessFunction · 0.90
locateFunction · 0.90

Calls 2

scrollFunction · 0.85
addDotFunction · 0.85

Tested by

no test coverage detected