3 # Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
4 # Copyright (C) 2014 The Jalview Authors
6 # This file is part of Jalview.
8 # Jalview is free software: you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License
10 # as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
12 # Jalview is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty
14 # of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 # PURPOSE. See the GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
18 # The Jalview Authors are detailed in the 'AUTHORS' file.
24 defined($GTID) or $GTID="UA-9060947-1";
27 <script type="text/javascript">
28 var gaJsHost = (("https:" == document.location.protocol) ?
29 "https://ssl." : "http://www.");
30 document.write(unescape("%3Cscript src=\'" + gaJsHost +
31 "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));
33 <script type="text/javascript">
35 var pageTracker = _gat._getTracker("'$GTID'");
36 pageTracker._trackPageview();
45 if (system("grep","-v","-q",'"'.$GTID.'"',$f)) {
46 if (open OF,">$f.".$GTID) {
50 $_=~s!<body>!$SCRIPT!;
52 # $_=~s!href="([~"]+)"!href="$1" onclick="
58 rename($f,$f.".old.".$GTID) or die("Couldn't rename $f to $f".".old.".$GTID,$@);
59 rename($f.".$GTID",$f) or die("Couldn't rename $f.".$GTID." to $f",$@);
60 unlink($f.".old.".$GTID) or die("Couldn't delete ".$f.".old.".$GTID,$@);
62 warn("Can't open $f for reading.",$@);
65 warn("Couldn't open new edited file $f.$GTID",$@);