Add EPUB format to Zotero.MIME
This commit is contained in:
parent
d6547bab34
commit
ba1b1b0639
3 changed files with 10 additions and 1 deletions
|
@ -47,6 +47,7 @@ Zotero.MIME = new function(){
|
||||||
["FLV", "video/x-flv", 0],
|
["FLV", "video/x-flv", 0],
|
||||||
["\u0000\u0000\u0001\u0000", "image/vnd.microsoft.icon", 0],
|
["\u0000\u0000\u0001\u0000", "image/vnd.microsoft.icon", 0],
|
||||||
["SQLite format 3\u0000", "application/x-sqlite3", 0],
|
["SQLite format 3\u0000", "application/x-sqlite3", 0],
|
||||||
|
["mimetypeapplication/epub+zip", "application/epub+zip", 30],
|
||||||
];
|
];
|
||||||
|
|
||||||
var _extensions = {
|
var _extensions = {
|
||||||
|
@ -81,7 +82,8 @@ Zotero.MIME = new function(){
|
||||||
// OpenOffice/LibreOffice
|
// OpenOffice/LibreOffice
|
||||||
'odt': 'application/vnd.oasis.opendocument.text',
|
'odt': 'application/vnd.oasis.opendocument.text',
|
||||||
|
|
||||||
'pdf': 'application/pdf'
|
'pdf': 'application/pdf',
|
||||||
|
'epub': 'application/epub+zip'
|
||||||
};
|
};
|
||||||
|
|
||||||
var _textTypes = {
|
var _textTypes = {
|
||||||
|
@ -205,6 +207,9 @@ Zotero.MIME = new function(){
|
||||||
case 'audio/x-aiff':
|
case 'audio/x-aiff':
|
||||||
case 'sound/aiff':
|
case 'sound/aiff':
|
||||||
return 'aiff';
|
return 'aiff';
|
||||||
|
|
||||||
|
case 'application/epub+zip':
|
||||||
|
return 'epub';
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
BIN
test/tests/data/stub.epub
Normal file
BIN
test/tests/data/stub.epub
Normal file
Binary file not shown.
|
@ -18,5 +18,9 @@ describe("Zotero.MIME", function () {
|
||||||
it("should detect SQLite database", async function () {
|
it("should detect SQLite database", async function () {
|
||||||
await test('test.sqlite', 'application/x-sqlite3');
|
await test('test.sqlite', 'application/x-sqlite3');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should detect EPUB ebook", async function () {
|
||||||
|
await test('stub.epub', 'application/epub+zip');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue