mirror of
https://github.com/koreader/koreader
synced 2024-10-31 21:20:20 +00:00
dddbea89df
The decision whether ext:getReader(ftype) returns CREReader or nil for documents with improper file extentions now depends on the new parameter FileChooser.filemanager_expert_mode. Improper files are now related to CREReader only for advances users.
27 lines
608 B
Lua
27 lines
608 B
Lua
-- List of acceptable extentions
|
|
|
|
ext = {
|
|
djvuRead = ";djvu;",
|
|
pdfRead = ";pdf;xps;cbz;",
|
|
creRead = ";epub;txt;rtf;htm;html;mobi;prc;azw;fb2;chm;pdb;doc;tcr;zip;"
|
|
-- seems to accept pdb-files for PalmDoc only
|
|
}
|
|
|
|
|
|
function ext:getReader(ftype)
|
|
local s = ";"
|
|
if ftype == "" then
|
|
return nil
|
|
elseif string.find(self.pdfRead,s..ftype..s) then
|
|
return PDFReader
|
|
elseif string.find(self.djvuRead,s..ftype..s) then
|
|
return DJVUReader
|
|
elseif FileChooser.filemanager_expert_mode > FileChooser.BEGINNERS_MODE
|
|
or string.find(self.creRead,s..ftype..s) then
|
|
return CREReader
|
|
else
|
|
return nil
|
|
end
|
|
end
|
|
|