JAL-715 - notify user of parsing problems for results from a service's URL
[jalview.git] / utils / patchGt.pl
index 07811b0..19cb131 100644 (file)
@@ -5,6 +5,7 @@ use Env qw($GTID);
 
 defined($GTID) or $GTID="UA-9060947-1";
 my $SCRIPT = <<FOO;
+<body>
 <script type="text/javascript">
     var gaJsHost = (("https:" == document.location.protocol) ?
        "https://ssl." : "http://www.");
@@ -17,7 +18,6 @@ try{
     pageTracker._trackPageview();
 } catch(err) {}
 </script>
-</body>
 FOO
                
 while (scalar @ARGV)
@@ -28,8 +28,10 @@ while (scalar @ARGV)
            if (open OF,">$f.".$GTID) {
                if (open IF,"$f") {
                while (<IF>) {
-                   if ($_=~m!</body>!) {
-                       $_=~s!</body>!$SCRIPT!;
+                   if ($_=~m!<body>!) {
+                       $_=~s!<body>!$SCRIPT!;
+                   } else {
+#                      $_=~s!href="([~"]+)"!href="$1" onclick="
                    }
                    print OF $_;
                }