
bugs at lists
Mar 14, 2009, 9:08 AM
Post #12 of 12
(1891 views)
Permalink
|
|
[Bug 1390] story profile category auto complete will systematically delete elements & refuse to add more
[In reply to]
|
|
http://bugs.bricolage.cc/show_bug.cgi?id=1390 --- Comment #10 from Marshall Roch <marshall [at] mroch> 2009-03-14 16:08:27 --- (In reply to comment #9) > So that will always return either true or false - or is it just how I have it > written? I didn't find much when I was googling for that browser test. navigator.appVersion is something like: 5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16 In Safari 2, it's like: 0.5 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/419.3(KHTML, like Gecko) Safari/419.3 So it's not a simple version number. indexOf("AppleWebKit") is either -1 (not found) or the column where the text "AppleWebKit" starts, which is greater than 3 (49 for Safari 4, 39 for Safari 2 above). So before, it returned true iff the browser is Safari (indexOf returned anything other than -1). Now it returns true if the browser is NOT Safari (indexOf returns -1) and false for ALL versions of Safari (indexOf returns 49). To detect Safari versions you have to parse out the number after AppleWebKit (>500 is Safari 3+). See http://trac.webkit.org/wiki/DetectingWebKit. The overhead of the script they suggest seems pretty big. Maybe the simplest fix would be this: if(navigator.appVersion.indexOf('AppleWebKit/4') > -1) { which would only return true if the browser was between AppleWebKit/400 and AppleWebKit/499. Safari 2 is in the 400s, Safari 3 and 4 are in the 500s. Safari 1 ranges from 85 into the 200s, but we don't support Safari 1. > Marshall, can you go into more detail about the bug that your code fixes? It > looks like it's supposed to fix something in the list of choices, is that > right? Your comment of > > // This makes the selection go to the end. > > is sort of vague to me. IIRC, the bug was that when you hit enter, it autocompleted, but the cursor didn't move to the end of the new text. That is, if you typed "bri<enter>" you ended up with "bri<cursor>colage" instead of "bricolage<cursor>". -- Configure bugmail: http://bugs.bricolage.cc/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
|