mirror of
https://github.com/Yetangitu/owncloud-apps.git
synced 2025-10-03 14:59:19 +02:00
OC8 port, 'should be compatible' with OC7 - please test...
Reader: ported to appframework, new version of epub.js
This commit is contained in:
parent
ba221c1d61
commit
c4d1ace999
50 changed files with 653 additions and 6064 deletions
31
files_reader/js/lib/blob.js
Normal file
31
files_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