|
@@ -1715,10 +1715,15 @@ module.exports = {
|
|
|
'sc' :{full:'Scolie', dim:'Scol.'},
|
|
|
}
|
|
|
],
|
|
|
+
|
|
|
+ loaded_by_file:{},
|
|
|
+
|
|
|
+ loader: document.getElementById('db-loaded'),
|
|
|
|
|
|
load(callback) {
|
|
|
|
|
|
for (var i = 0; i < this.langs.length; i++) {
|
|
|
+ this.loaded_by_file[this.langs[i].lc] = 0;
|
|
|
this.loadJSON(this.langs[i].lc, '/assets/jsondb/'+this.langs[i].db, callback)
|
|
|
}
|
|
|
},
|
|
@@ -1728,6 +1733,24 @@ module.exports = {
|
|
|
xobj.overrideMimeType("application/json");
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ xobj.addEventListener("progress", function(oEvent){
|
|
|
+ if (oEvent.lengthComputable) {
|
|
|
+ var percentComplete = oEvent.loaded / oEvent.total * 100;
|
|
|
+ console.log(lc+' loaded :',percentComplete);
|
|
|
+ this.loaded_by_file[lc] = percentComplete;
|
|
|
+ var totalloaded = 0;
|
|
|
+ for (var i = 0; i < this.langs.length; i++) {
|
|
|
+ totalloaded += this.loaded_by_file[this.langs[i].lc];
|
|
|
+ }
|
|
|
+ this.loader.style.width = (totalloaded/this.langs.length)+"%";
|
|
|
+ } else {
|
|
|
+
|
|
|
+ console.log('no progress');
|
|
|
+ }
|
|
|
+ }.bind(this));
|
|
|
+
|
|
|
xobj.onreadystatechange = function () {
|
|
|
|
|
|
switch(xobj.readyState){
|