Skip to content

Instantly share code, notes, and snippets.

@sergey-tihon
Created March 26, 2012 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergey-tihon/2205810 to your computer and use it in GitHub Desktop.
Save sergey-tihon/2205810 to your computer and use it in GitHub Desktop.
preview fetching
FST_PreviewRequests = [];
function FST_RegisterDocPreviewFetch(a) {
ULShpi: ;
FST_PreviewRequests.push(a)
}
var gTotReq = 0,
gTotReqSent = 0;
function FST_StartDocPreviewFetch(b, c) {
ULShpi: ;
gTotReq = c;
for (var a = 0; a < b; a++) FST_DocPreviewFetch()
}
function FST_DocPreviewFetch() {
ULShpi: ;
if (FST_PreviewRequests.length > 0 && gTotReqSent < gTotReq) {
FST_PreviewRequests.shift().invoke();
gTotReqSent++
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment