2 #*******************************************************************************
3 # Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
4 # Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
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 #*******************************************************************************
23 defined($GTID) or $GTID="UA-9060947-1";
26 <script type="text/javascript">
27 var gaJsHost = (("https:" == document.location.protocol) ?
28 "https://ssl." : "http://www.");
29 document.write(unescape("%3Cscript src=\'" + gaJsHost +
30 "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));
32 <script type="text/javascript">
34 var pageTracker = _gat._getTracker("'$GTID'");
35 pageTracker._trackPageview();
44 if (system("grep","-v","-q",'"'.$GTID.'"',$f)) {
45 if (open OF,">$f.".$GTID) {
49 $_=~s!<body>!$SCRIPT!;
51 # $_=~s!href="([~"]+)"!href="$1" onclick="
57 rename($f,$f.".old.".$GTID) or die("Couldn't rename $f to $f".".old.".$GTID,$@);
58 rename($f.".$GTID",$f) or die("Couldn't rename $f.".$GTID." to $f",$@);
59 unlink($f.".old.".$GTID) or die("Couldn't delete ".$f.".old.".$GTID,$@);
61 warn("Can't open $f for reading.",$@);
64 warn("Couldn't open new edited file $f.$GTID",$@);