|
|
|
@ -30,15 +30,36 @@ end
|
|
|
|
|
function ReaderSearch:onShowFulltextSearchInput()
|
|
|
|
|
self:onInput{
|
|
|
|
|
title = _("Enter text to search for"),
|
|
|
|
|
ok_text = _("Search all text"),
|
|
|
|
|
type = "text",
|
|
|
|
|
callback = function(input)
|
|
|
|
|
self:onShowSearchDialog(input)
|
|
|
|
|
buttons = {
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
text = _("Cancel"),
|
|
|
|
|
callback = function()
|
|
|
|
|
self:closeInputDialog()
|
|
|
|
|
end,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text = "◁",
|
|
|
|
|
callback = function()
|
|
|
|
|
self:onShowSearchDialog(self.input_dialog:getInputText(), 1)
|
|
|
|
|
self:closeInputDialog()
|
|
|
|
|
end,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text = "▷",
|
|
|
|
|
is_enter_default = true,
|
|
|
|
|
callback = function()
|
|
|
|
|
self:onShowSearchDialog(self.input_dialog:getInputText(), 0)
|
|
|
|
|
self:closeInputDialog()
|
|
|
|
|
end,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function ReaderSearch:onShowSearchDialog(text)
|
|
|
|
|
function ReaderSearch:onShowSearchDialog(text, direction)
|
|
|
|
|
local neglect_current_location = false
|
|
|
|
|
local current_page
|
|
|
|
|
local do_search = function(search_func, _text, param)
|
|
|
|
@ -122,19 +143,19 @@ function ReaderSearch:onShowSearchDialog(text)
|
|
|
|
|
buttons = {
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
text = "|<",
|
|
|
|
|
text = "▕◁",
|
|
|
|
|
callback = do_search(self.searchFromStart, text),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text = "<",
|
|
|
|
|
text = "◁",
|
|
|
|
|
callback = do_search(self.searchNext, text, 1),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text = ">",
|
|
|
|
|
text = "▷",
|
|
|
|
|
callback = do_search(self.searchNext, text, 0),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text = ">|",
|
|
|
|
|
text = "▷▏",
|
|
|
|
|
callback = do_search(self.searchFromEnd, text),
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
@ -145,7 +166,7 @@ function ReaderSearch:onShowSearchDialog(text)
|
|
|
|
|
UIManager:setDirty(self.dialog, "ui")
|
|
|
|
|
end,
|
|
|
|
|
}
|
|
|
|
|
do_search(self.searchFromCurrent, text, 0)()
|
|
|
|
|
do_search(self.searchFromCurrent, text, direction)()
|
|
|
|
|
UIManager:show(self.search_dialog)
|
|
|
|
|
--- @todo regional
|
|
|
|
|
UIManager:setDirty(self.dialog, "partial")
|
|
|
|
|