mod: add html support in crereader

pull/2/merge
Qingping Hou 12 years ago
parent 9389aad0c4
commit 1593c56803

@ -16,6 +16,9 @@ end
function CREReader:open(filename)
local ok
local file_type = string.lower(string.match(filename, ".+%.([^.]+)"))
if file_type == "html" then
file_type = "htm"
end
local style_sheet = "./data/"..file_type..".css"
ok, self.doc = pcall(cre.openDocument, filename, style_sheet,
width, height)

@ -54,7 +54,11 @@ function FileChooser:readDir()
table.insert(self.dirs, f)
else
local file_type = string.lower(string.match(f, ".+%.([^.]+)") or "")
if file_type == "djvu" or file_type == "pdf" or file_type == "xps" or file_type == "cbz" or file_type == "epub" or file_type == "txt" or file_type == "rtf" or file_type == "htm" or file_type == "fb2" or file_type == "chm" then
if file_type == "djvu"
or file_type == "pdf" or file_type == "xps" or file_type == "cbz"
or file_type == "epub" or file_type == "txt" or file_type == "rtf"
or file_type == "htm" or file_type == "html"
or file_type == "fb2" or file_type == "chm" then
table.insert(self.files, f)
end
end

@ -38,6 +38,7 @@ function FileSearcher:readDir()
or file_type == "xps" or file_type == "cbz"
or file_type == "epub" or file_type == "txt"
or file_type == "rtf" or file_type == "htm"
or file_type == "html"
or file_type == "fb2" or file_type == "chm" then
file_entry = {dir=d, name=f,}
table.insert(self.files, file_entry)

@ -43,7 +43,7 @@ function openFile(filename)
reader = DJVUReader
elseif file_type == "pdf" or file_type == "xps" or file_type == "cbz" then
reader = PDFReader
elseif file_type == "epub" or file_type == "txt" or file_type == "rtf" or file_type == "htm" or file_type == "fb2" or file_type == "chm" then
elseif file_type == "epub" or file_type == "txt" or file_type == "rtf" or file_type == "htm" or file_type == "html" or file_type == "fb2" or file_type == "chm" then
reader = CREReader
end
if reader then

Loading…
Cancel
Save