MediaWiki:BibleGet.js: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 1:
//avoid duplicate bibleQuote divs
let bibleQuoteCollection = [];
let domCheckInterval = null[];
let ajaxCount = 0;
(function($,mw){
Line 96:
}
}); //END for each
$(document).ajaxStop(function(){
console.log("ajaxStop has fired " + ++ajaxCount + " time(s)");
//just because ajax requests have finished doesn't mean the dom manipulation is done...
//let's create a check for all elements before doing any further manipulation
if(domCheckInterval.length === 0){
domCheckInterval[] = setInterval(onBGetDomElementsReady,100);
}
}); //END document ajaxStop
}
 
}); //END document ready
$(document).ajaxStop(function(){
console.log("ajaxStop has fired " + ++ajaxCount + " time(s)");
//just because ajax requests have finished doesn't mean the dom manipulation is done...
//let's create a check for all elements before doing any further manipulation
domCheckInterval = setInterval(onBGetDomElementsReady,100);
}); //END document ajaxStop
})(jQuery,mw);
Line 123 ⟶ 126:
if(checkDomElements() === true){
console.log('All expected dom elements are now accounted for!');
clearIntervalfor(let interval of domCheckInterval);{
clearInterval(interval);
}
doFurtherDomManipulation();
}