[open-ils-commits] [GIT] Evergreen ILS branch master updated. 503c7c67128190a6f0e45395a3c55c1f2f55c46f

Evergreen Git git at git.evergreen-ils.org
Wed Sep 28 17:33:29 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  503c7c67128190a6f0e45395a3c55c1f2f55c46f (commit)
      from  a1ca1de82d94bfccb695194944b63f5220f1cb81 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 503c7c67128190a6f0e45395a3c55c1f2f55c46f
Author: Bill Erickson <berick at esilibrary.com>
Date:   Wed Sep 28 17:23:13 2011 -0400

    TPac: move google analytics import to head
    
    Google Analytics documention recommends loading the JS in the page
    <head>.
    
    http://www.google.com/support/googleanalytics/bin/answer.py?answer=174090
    
    Use as directed by default.
    
    Also, moved the JS loading chunk to its own template to ease override by
    those who do not wish to use as directed.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/src/templates/opac/parts/base.tt2 b/Open-ILS/src/templates/opac/parts/base.tt2
index c66c74f..0a6c10c 100644
--- a/Open-ILS/src/templates/opac/parts/base.tt2
+++ b/Open-ILS/src/templates/opac/parts/base.tt2
@@ -9,6 +9,7 @@
         <link rel="stylesheet" type="text/css" href="[% ctx.media_prefix %]/css/skin/default/opac/style.css" />
         <title>[% l('Catalog - [_1]', ctx.page_title) %]</title>
         <link rel="unapi-server" type="application/xml" title="unAPI" href="/opac/extras/unapi" />
+        [% INCLUDE 'opac/parts/goog_analytics.tt2' %]
     </head>
     <body>
         [% content %] 
diff --git a/Open-ILS/src/templates/opac/parts/goog_analytics.tt2 b/Open-ILS/src/templates/opac/parts/goog_analytics.tt2
new file mode 100644
index 0000000..df69b43
--- /dev/null
+++ b/Open-ILS/src/templates/opac/parts/goog_analytics.tt2
@@ -0,0 +1,18 @@
+[%- PROCESS "opac/parts/config.tt2";
+    IF google_analytics.enabled == 'true' %]
+
+<!-- http://www.google.com/support/googleanalytics/bin/answer.py?answer=174090 -->
+<script type="text/javascript">
+    var _gaq = _gaq || [];
+    _gaq.push(['_setAccount', '[% google_analytics.code %]']);
+    _gaq.push(['_trackPageview']);
+
+    (function() {
+        var ga = document.createElement('script'); 
+        ga.type = 'text/javascript'; ga.async = true;
+        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+        var s = document.getElementsByTagName('script')[0]; 
+        s.parentNode.insertBefore(ga, s);
+    })();
+</script>
+[%- END %]
diff --git a/Open-ILS/src/templates/opac/parts/js.tt2 b/Open-ILS/src/templates/opac/parts/js.tt2
index 9dbbeac..35ff2bb 100644
--- a/Open-ILS/src/templates/opac/parts/js.tt2
+++ b/Open-ILS/src/templates/opac/parts/js.tt2
@@ -40,21 +40,3 @@
     IF CGI.https; url = url.replace('^http:', 'https:'); END; %]
 <script type='text/javascript' id='EIT' src='[% url %]'></script>
 [%- END %]
-
-[%- IF google_analytics.enabled == 'true' %]
-<!-- Google Analytics -->
-<script type="text/javascript">
-/* uncomment when ready */ /*
-  var _gaq = _gaq || [];
-  _gaq.push(['_setAccount', '[% google_analytics.code %]']);
-  _gaq.push(['_trackPageview']);
-
-  (function() {
-    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
-    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
-  })();
-*/
-</script>
-<!-- End Google Analytics -->
-[%- END %]

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/templates/opac/parts/base.tt2         |    1 +
 .../src/templates/opac/parts/goog_analytics.tt2    |   18 ++++++++++++++++++
 Open-ILS/src/templates/opac/parts/js.tt2           |   18 ------------------
 3 files changed, 19 insertions(+), 18 deletions(-)
 create mode 100644 Open-ILS/src/templates/opac/parts/goog_analytics.tt2


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list