On Dec 17, 5:56 am, anmldr <[email protected]> wrote:
> No need for anyone to waste their time looking at that page. I just
> found "Wink Toolkit" athttp://www.winktoolkit.org/ They have a
> search feature that works perfectly.
Dunno about "perfectly".
Given that it is a general purpose library, it should address the
issues I raised earlier. It only addresses 1 1/2 of them. It also does
things like adding HTML to the innerHTML of the element containing the
matched text, which is bound to cause issues from time to time
depending on the text it matches (e.g. try matching on a string that
is in an attribute of some element within the innerHTML).
Even their test page, which is simple ipsum lorem with no markup, is
quite clunky on iPhone and fails to scroll to the next match quite
often. Changing between landscape and portrait has some strange
outcomes. I couldn't test zooming because they've disabled it - which
makes me think they don't want me to zoom because that breaks their
scrolling.
Like so many similar scripts, they don't seem to be able to work with
native scrolling so they disable it and provide their own based on
javascript.
If you search on an empty string, it ends up in an endless loop
because of:
while(true)
{
var idxResult = lowerCaseText.indexOf(sLowerCase, idxSearch);
if(idxResult==-1)
{
break;
}
var before = lowerCaseText.substr(0, idxResult);
var lastLT = before.lastIndexOf('<');
var lastGT = before.lastIndexOf('>');
if(lastLT==-1 || (lastGT!=-1 && lastLT < lastGT))
{
idxResults.push(idxResult);
}
idxSearch = idxResult+sLowerCase.length;
}
...
so if the break condition is never met and both idxResult and
+sLowerCase.length are zero (such as when searching on an empty
string), so it goes into an endless loop. At least you can guard
against that when calling the function by testing the search string,
but it shouldn't be necessary.
<URL:
http://www.winktoolkit.org/documentation/wink/ux/search/test/test_search_scroller.html
>
--
Rob
--
You received this message because you are subscribed to the Google Groups
"iPhoneWebDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/iphonewebdev?hl=en.