Projet

Général

Profil

Paste
Télécharger (930 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / piwik / piwik.js @ e9f59589

1
(function ($) {
2

    
3
$(document).ready(function() {
4

    
5
  // Attach mousedown, keyup, touchstart events to document only and catch
6
  // clicks on all elements.
7
  $(document.body).bind("mousedown keyup touchstart", function(event) {
8

    
9
    // Catch the closest surrounding link of a clicked element.
10
    $(event.target).closest("a,area").each(function() {
11

    
12
      if (Drupal.settings.piwik.trackMailto && $(this).is("a[href^='mailto:'],area[href^='mailto:']")) {
13
        // Mailto link clicked.
14
        _paq.push(["trackEvent", "Mails", "Click", this.href.substring(7)]);
15
      }
16

    
17
    });
18
  });
19

    
20
  // Colorbox: This event triggers when the transition has completed and the
21
  // newly loaded content has been revealed.
22
  $(document).bind("cbox_complete", function () {
23
    var href = $.colorbox.element().attr("href");
24
    if (href) {
25
      _paq.push(["setCustomUrl", href]);
26
      _paq.push(["trackPageView"]);
27
    }
28
  });
29

    
30
});
31

    
32
})(jQuery);