Move piwik code to a static JS asset
This commit is contained in:
parent
24453e7230
commit
7c0055b5d7
6 changed files with 30 additions and 15 deletions
|
@ -11,6 +11,9 @@
|
|||
<%= tag("link", { :rel => "publisher", :href => "https://plus.google.com/111953119785824514010" }) %>
|
||||
<%= tag("link", { :rel => "search", :type => "application/opensearchdescription+xml", :title => "OpenStreetMap Search", :href => asset_path("osm.xml") }) %>
|
||||
<%= tag("meta", { :name => "description", :content => "OpenStreetMap is the free wiki world map." }) %>
|
||||
<% if flash[:piwik_goal] -%>
|
||||
<%= tag("meta", :name => "piwik-goal", :content => flash[:piwik_goal]) %>
|
||||
<% end -%>
|
||||
<%= style_rules %>
|
||||
<%= yield :head %>
|
||||
<%= csrf_meta_tag %>
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
<script type="text/javascript">
|
||||
var _paq = _paq || [];
|
||||
(function(){ var u="<%= request.protocol %><%= PIWIK_LOCATION %>/";
|
||||
_paq.push(['setSiteId', <%= PIWIK_SITE %>]);
|
||||
_paq.push(['setTrackerUrl', u+'piwik.php']);
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
<% if flash[:piwik_goal] -%>
|
||||
_paq.push(['trackGoal', <%= flash[:piwik_goal] %>);
|
||||
<% end -%>
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.defer=true; g.async=true; g.src=u+'piwik.js';
|
||||
s.parentNode.insertBefore(g,s); })();
|
||||
</script>
|
||||
<noscript><p><img src="<%= request.protocol %><%= PIWIK_LOCATION %>/piwik.php?idsite=<%= PIWIK_SITE %>" style="border:0" alt="" /></p></noscript>
|
|
@ -144,7 +144,7 @@
|
|||
</div>
|
||||
|
||||
<% if defined?(PIWIK_LOCATION) and defined?(PIWIK_SITE) -%>
|
||||
<%= render :partial => "layouts/piwik" %>
|
||||
<noscript><p><img src="<%= request.protocol %><%= PIWIK_LOCATION %>/piwik.php?idsite=<%= PIWIK_SITE %>" style="border:0" alt="" /></p></noscript>
|
||||
<% end -%>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue