Revision 45929001
Von Sven Schöling vor mehr als 3 Jahren hinzugefügt
js/kivi.FileDB.js | ||
---|---|---|
15 | 15 |
ns.create_image_store(event.target.result); |
16 | 16 |
}; |
17 | 17 |
request.onerror = ns.onerror; |
18 |
request.aftersuccess = []; |
|
18 | 19 |
request.onsuccess = () => { |
19 | 20 |
db = request.result; |
20 | 21 |
|
... | ... | |
32 | 33 |
}; |
33 | 34 |
} |
34 | 35 |
} |
36 |
|
|
37 |
request.aftersuccess.forEach(f => f()); |
|
35 | 38 |
}; |
36 | 39 |
|
37 | 40 |
ns.create_image_store = function (db) { |
... | ... | |
84 | 87 |
console.error("Error creating/accessing IndexedDB database"); |
85 | 88 |
console.error(event.errorState); |
86 | 89 |
}; |
90 |
|
|
91 |
ns.with_db = function(success) { |
|
92 |
if (db && db_version == db.version) { |
|
93 |
success(); |
|
94 |
} else { |
|
95 |
// assume the page load db init isn't done yet and push it onto the success |
|
96 |
request.aftersuccess.push(success); |
|
97 |
} |
|
98 |
}; |
|
87 | 99 |
}); |
Auch abrufbar als: Unified diff
ImageUpload: client side Scripte