Friendiqa/source-android/js/photoworker.js
2017-03-25 23:36:14 +01:00

16 lines
670 B
JavaScript

WorkerScript.onMessage = function(msg) {
if (msg.firstalbum==0){msg.model.clear();}
var limit=0; if (msg.albums.length-msg.firstalbum<20){limit=msg.albums.length} else{limit=msg.firstalbum+20}
for (var j=msg.firstalbum;j<limit;j++){
if (msg.albums[msg.firstalbum]) {
// print("album"+msg.albums[j].name);
if(msg.foreignPicture){
var albumname=msg.albums[j].name.trim();var albumlink=msg.albums[j].link
}else{
var albumname=msg.albums[j].toString();var albumlink=""}
msg.model.append({"albumlink":albumlink,"foreignPicture":msg.foreignPicture,"albumname":albumname});
msg.model.sync()
};
}
}