src/hg/hgTracks/config.c 1.81

1.81 2009/06/27 01:21:31 larrym
fix dragZoomingConfig so it works when hgTracks is called from command line
Index: src/hg/hgTracks/config.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTracks/config.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -b -B -U 4 -r1.80 -r1.81
--- src/hg/hgTracks/config.c	18 Jun 2009 17:55:05 -0000	1.80
+++ src/hg/hgTracks/config.c	27 Jun 2009 01:21:31 -0000	1.81
@@ -445,8 +445,12 @@
 // Returns TRUE if drag-and-zoom is currently on
 {
 // dragZooming defaults to on, except for AppleWebKit browsers (Chrome and Safari), where drag-and-zoom
 // does not currently work (may want to use "KHTML" as the test string instead of "AppleWebKit").
+// This code is overly conservative, because drag-and-zoom did work with older (pre 4.0) versions of
+// safari. Unfortunately, safari numbering is weird; e.g. version 1.3.2 shows up as 
+// "Safari/312.6" in the web logs, so for now, I'm defaulting drag-and-zoom to off
+// for all versions of Safari.
 
 char *ua = cgiUserAgent();
-return cartUsualBoolean(cart, "dragZooming", !stringIn("AppleWebKit", ua));
+return cartUsualBoolean(cart, "dragZooming", ua == NULL || !stringIn("AppleWebKit", ua));
 }