Search object
The
object with functions and properties used by the Search Bar template.
Addressing the Search object:
window.external.Search
Functions
DoSearch(Query,MainPagesOnly,AllWords,WholeWords,Highlight)
Searching through the files of eBook pages. After the search is
over, you can get Title and Location of pages meeting the search
query (see the procedures ResultTitle and ResultLocation below).
Parameters:
Query - a string with the search query
MainPagesOnly - true if only
files viewed in the Main Panel should be searched
AllWords - true
if all words of the search query must be present
WholeWords - true
to search for whole words only, false to search for parts of words
as well
Highlight - true to highlight matching words on pages.
Call: window.external.Search.DoSearch(Query,MainPagesOnly,AllWords,WholeWords,Highlight);
Return value: the number of found pages.
ResultTitle(ResultIdx)
Called only after DoSearch. The function for getting the Title of
the found page, where ResultIdx is the index of the found page (0 <=
ResultIdx < the number of pages).
Call: window.external.Search.ResultTitle(ResultIdx);
Return value: the string containing the page Title.
ResultLocation(ResultIdx)
Called only after DoSearch. The function for getting the URL referring
to the found page, where ResultIdx is the index of the found page
(0 <= ResultIdx < the number of pages).
Call: window.external.Search.ResultLocation(ResultIdx);
Return value: the string containing the URL.
Properties
HighlightEnabled
Call: window.external.Search.HighlightEnabled;
Returns true if the «Highlight search hits» option is
available. Otherwise returns false. |