2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00

fixed wrong escape sequences in strings

again, LuaJIT will choke on these, Lua-5.1.n did just ignore them
This commit is contained in:
HW 2012-06-03 01:52:16 +02:00
parent b07470535f
commit e35339a398
6 changed files with 18 additions and 18 deletions

View File

@ -335,7 +335,7 @@ function CREReader:_drawReadingInfo()
cur_section = "Section: "..cur_section
end
-- NuPogodi 15.05.12: Rewrite the following renderUtf8Text() in order to fix too long strings
local footer = "Position: "..load_percent.."\%".." "..cur_section
local footer = "Position: "..load_percent.."%".." "..cur_section
if sizeUtf8Text(10, fb.bb:getWidth(), face, footer, true).x < (fb.bb:getWidth() - 20) then
renderUtf8Text(fb.bb, 10, ypos+6, face, footer, true)
else
@ -408,7 +408,7 @@ function CREReader:adjustCreReaderCommands()
self.line_space_percent = self.line_space_percent + 10
self.line_space_percent = math.min(self.line_space_percent, 200)
end
InfoMessage:show("line spacing "..self.line_space_percent.."\%", 0)
InfoMessage:show("line spacing "..self.line_space_percent.."%", 0)
debug("line spacing set to", self.line_space_percent)
-- NuPogodi, 15.05.12: storing old document height
self.old_doc_height = self.doc:getFullHeight()

View File

@ -52,7 +52,7 @@ end
function BatteryLevel()
local fn, battery = "./data/temporary", "?"
-- NuPogodi, 18.05.12: This command seems to work even without Amazon Kindle framework
os.execute("\(gasgauge-info ".."-s\) ".."> "..fn)
os.execute("(gasgauge-info ".."-s) ".."> "..fn)
if io.open(fn,"r") then
for lines in io.lines(fn) do battery = " " .. lines end
else

View File

@ -34,9 +34,9 @@ function FileInfo:FileSize(size)
if size < 1024 then
return size.." Bytes"
elseif size < 2^20 then
return string.format("%.2f", size/2^10).."KB \("..size.." Bytes\)"
return string.format("%.2f", size/2^10).."KB ("..size.." Bytes)"
else
return string.format("%.2f", size/2^20).."MB \("..size.." Bytes\)"
return string.format("%.2f", size/2^20).."MB ("..size.." Bytes)"
end
end -- end of changes (NuPogodi, 26.05.12)
@ -87,9 +87,9 @@ function FileInfo:init(path,fname)
info_entry = {dir = "Last Read", name = FileInfo:FileCreated(history,"change")}
table.insert(self.result, info_entry)
local file_type = string.lower(string.match(self.pathfile, ".+%.([^.]+)"))
local to_search, add, factor = "\[\"last_percent\"\]", "\%", 100
local to_search, add, factor = "[\"last_percent\"]", "%", 100
if ext:getReader(file_type) ~= CREReader then
to_search = "\[\"last_page\"\]"
to_search = "[\"last_page\"]"
add = " pages"
factor = 1
end

View File

@ -193,11 +193,11 @@ function InputBox:setLayoutsTable()
{ KEY_W, "W", "w", "2", "?", "Ж", "ж", "2", "?", },
{ KEY_E, "E", "e", "3", "#", "Е", "е", "3", "«", },
{ KEY_R, "R", "r", "4", "@", "Р", "р", "4", "»", },
{ KEY_T, "T", "t", "5", "\%", "Т", "т", "5", ":", },
{ KEY_T, "T", "t", "5", "%", "Т", "т", "5", ":", },
{ KEY_Y, "Y", "y", "6", "", "Ы", "ы", "6", ";", },
{ KEY_U, "U", "u", "7", "\'", "У", "у", "7", "~", },
{ KEY_I, "I", "i", "8", "`", "И", "и", "8", "\(",},
{ KEY_O, "O", "o", "9", ":", "О", "о", "9", "\)",},
{ KEY_I, "I", "i", "8", "`", "И", "и", "8", "(",},
{ KEY_O, "O", "o", "9", ":", "О", "о", "9", ")",},
{ KEY_P, "P", "p", "0", ";", "П", "п", "0", "=", },
-- middle raw
{ KEY_A, "A", "a", "+", "", "А", "а", "Ш", "ш", },
@ -210,12 +210,12 @@ function InputBox:setLayoutsTable()
{ KEY_K, "K", "k", "ˆ", "\"", "К", "к", "Ќ", "ќ", },
{ KEY_L, "L", "l", ">", "~", "Л", "л", "Љ", "љ", },
-- lowest raw
{ KEY_Z, "Z", "z", "\(", "$", "З", "з", "Щ", "щ", },
{ KEY_X, "X", "x", "\)", "", "Х", "х", "", "@", },
{ KEY_C, "C", "c", "\{", "¥", "Ц", "ц", "Џ", "џ", },
{ KEY_V, "V", "v", "\}", "£", "В", "в", "Ў", "ў", },
{ KEY_B, "B", "b", "\[", "", "Б", "б", "Ћ", "ћ", },
{ KEY_N, "N", "n", "\]", "", "Н", "н", "Њ", "њ", },
{ KEY_Z, "Z", "z", "(", "$", "З", "з", "Щ", "щ", },
{ KEY_X, "X", "x", ")", "", "Х", "х", "", "@", },
{ KEY_C, "C", "c", "{", "¥", "Ц", "ц", "Џ", "џ", },
{ KEY_V, "V", "v", "}", "£", "В", "в", "Ў", "ў", },
{ KEY_B, "B", "b", "[", "", "Б", "б", "Ћ", "ћ", },
{ KEY_N, "N", "n", "]", "", "Н", "н", "Њ", "њ", },
{ KEY_M, "M", "m", "&", "", "М", "м", "Ї", "ї", },
{ KEY_DOT, ".", ",", ".", ",", ".", ",", "Є", "є", },
-- Let us make key 'Space' the same for all layouts

View File

@ -145,7 +145,7 @@ function SplitString(text)
local words = {}
local word = ""
for uchar in string.gfind(text, "([%z\1-\127\194-\244][\128-\191]*)") do
if uchar == "/" or uchar == " " or uchar == "-" or uchar == "_" or uchar == "\." then
if uchar == "/" or uchar == " " or uchar == "-" or uchar == "_" or uchar == "." then
words[#words+1] = word .. uchar
word = ""
else

View File

@ -9,7 +9,7 @@ function DocToHistory(fullname)
j = i
end
local f = string.sub(fullname,j+1,-1)
if j>0 then return "./history/\["..string.gsub(string.sub(fullname,1,j),"/","#").."\] "..f..".lua"
if j>0 then return "./history/["..string.gsub(string.sub(fullname,1,j),"/","#").."] "..f..".lua"
else return "./settings"..f..".lua" end
end