Skip to content

Commit

Permalink
javascript changes to allow site root
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Apr 5, 2012
1 parent 3229619 commit adfa2c2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ckan/templates/layout_base.html
Expand Up @@ -266,13 +266,16 @@ <h3 class="widget-title">Meta</h3>
<script type="text/javascript">
$(function (){
// Tracking
$.ajax({url : '/_tracking',
var url = location.pathname;
// remove any site root from url
url = url.substring(CKAN.SITE_URL.length, url.length - 1);
$.ajax({url : CKAN.SITE_URL + '/_tracking',
type : 'POST',
data : {url:location.pathname, type:'page'},
data : {url:url, type:'page'},
timeout : 300 });
$('a.resource-url-analytics').click(function (e){
var url = $(e.target).closest('a').attr('href');
$.ajax({url : '/_tracking',
$.ajax({url : CKAN.SITE_URL + '/_tracking',
data : {url:url, type:'resource'},
type : 'POST',
complete : function () {location.href = url;},
Expand Down

0 comments on commit adfa2c2

Please sign in to comment.