1/** 2 * @file 3 * Loads report blocks via ajax. This is done because the API requests to Google 4 * Analytics can add signifigant latency to page loads otherwise. 5 */ 6 7Drupal.behaviors.googleAnalyticsReports = function(context) { 8 $('#block-google_analytics_reports-path_mini,#block-google_analytics_reports-dashboard', context).show(); 9 10 if ($('.google-analytics-reports-path-mini', context).length) { 11 $.ajax({ 12 url: Drupal.settings.googleAnalyticsReportsAjaxUrl + '/path-mini', 13 dataType: 'json', 14 data: ({ path: window.location.pathname + window.location.search }), 15 success: function(data) { 16 $('.google-analytics-reports-path-mini', context).html(data.content).hide().slideDown('fast'); 17 }, 18 error: function(data) { 19 // @TODO 20 } 21 }); 22 } 23 24 if ($('.google-analytics-reports-dashboard', context).length) { 25 $.ajax({ 26 url: Drupal.settings.googleAnalyticsReportsAjaxUrl + '/dashboard', 27 dataType: 'json', 28 success: function(data) { 29 $('.google-analytics-reports-dashboard', context).html(data.content).hide().slideDown('fast'); 30 }, 31 error: function(data) { 32 // @TODO 33 } 34 }); 35 } 36}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.