(index, contains, callback, first = false, notFound = false, onlyFirstMeet = false)
| 4203 | |
| 4204 | //Returns an image depending on the type (Image, folder, blank) |
| 4205 | function eachImagesDistribution(index, contains, callback, first = false, notFound = false, onlyFirstMeet = false) |
| 4206 | { |
| 4207 | var img = false; |
| 4208 | if(contains && contains.indexOf('image') !== -1) |
| 4209 | img = true; |
| 4210 | |
| 4211 | var folder = false; |
| 4212 | if(contains && contains.indexOf('folder') !== -1) |
| 4213 | folder = true; |
| 4214 | |
| 4215 | var blank = false; |
| 4216 | if(contains && contains.indexOf('blank') !== -1) |
| 4217 | blank = true; |
| 4218 | |
| 4219 | if(typeof imagesDistribution[index] !== 'undefined') |
| 4220 | { |
| 4221 | each: |
| 4222 | for(let key in imagesDistribution[index]) |
| 4223 | { |
| 4224 | if(!contains || (img && !imagesDistribution[index][key].folder && !imagesDistribution[index][key].blank) || (folder && imagesDistribution[index][key].folder) || (blank && imagesDistribution[index][key].blank)) |
| 4225 | { |
| 4226 | callback(imagesDistribution[index][key]); |
| 4227 | |
| 4228 | if(onlyFirstMeet) |
| 4229 | break each; |
| 4230 | } |
| 4231 | |
| 4232 | if(first) |
| 4233 | break each; |
| 4234 | } |
| 4235 | } |
| 4236 | else if(notFound) |
| 4237 | { |
| 4238 | notFound(); |
| 4239 | } |
| 4240 | } |
| 4241 | |
| 4242 | function getImage(index = 0) |
| 4243 | { |
no test coverage detected