mirror of
https://github.com/Yetangitu/owncloud-apps.git
synced 2025-10-04 15:09:17 +02:00
reader: files_reader evolved with multiple format support (epub and cbr/cbz for now), session (position and preferences) store/restore and more
This commit is contained in:
parent
6e1bd38409
commit
57a76be890
81 changed files with 22806 additions and 0 deletions
31
reader/js/lib/blob.js
Normal file
31
reader/js/lib/blob.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
Blob = (function() {
|
||||
var nativeBlob = Blob;
|
||||
|
||||
// Add unprefixed slice() method.
|
||||
if (Blob.prototype.webkitSlice) {
|
||||
Blob.prototype.slice = Blob.prototype.webkitSlice;
|
||||
}
|
||||
else if (Blob.prototype.mozSlice) {
|
||||
Blob.prototype.slice = Blob.prototype.mozSlice;
|
||||
}
|
||||
|
||||
// Temporarily replace Blob() constructor with one that checks support.
|
||||
return function(parts, properties) {
|
||||
try {
|
||||
// Restore native Blob() constructor, so this check is only evaluated once.
|
||||
Blob = nativeBlob;
|
||||
return new Blob(parts || [], properties || {});
|
||||
}
|
||||
catch (e) {
|
||||
// If construction fails provide one that uses BlobBuilder.
|
||||
Blob = function (parts, properties) {
|
||||
var bb = new (WebKitBlobBuilder || MozBlobBuilder), i;
|
||||
for (i in parts) {
|
||||
bb.append(parts[i]);
|
||||
}
|
||||
|
||||
return bb.getBlob(properties && properties.type ? properties.type : undefined);
|
||||
};
|
||||
}
|
||||
};
|
||||
}());
|
Loading…
Add table
Add a link
Reference in a new issue