Projet

Général

Profil

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

root / drupal7 / sites / all / modules / lightbox2 / js / lightbox_modal.js @ 73ab1d0a

1
(function ($) {
2

    
3
function lightbox2_login() {
4

    
5
  $("a[href*='/user/login'], a[href*='?q=user/login']").each(function() {
6
    $(this).attr({
7
      href: this.href.replace(/user\/login?/,"user/login/lightbox2"),
8
      rel: 'lightmodal[|width:250px; height:210px;]'
9
    });
10
    $(this).addClass('lightmodal-login');
11
  });
12
}
13

    
14
function lightbox2_contact() {
15
  $("a[href$='/contact'], a[href$='?q=contact']").each(function() {
16
    if (!this.href.match('admin/build/contact')) {
17
      $(this).attr({
18
        href: this.href.replace(/contact?/,"contact/lightbox2"),
19
        rel: 'lightmodal[|width:450px; height:450px;]'
20
      });
21
      $(this).addClass('lightmodal-contact');
22
    }
23
  });
24
}
25

    
26
Drupal.behaviors.initLightboxModal = {
27
  attach: function(context, settings) {
28
    if (settings.lightbox2.enable_login) {
29
      lightbox2_login();
30
    }
31
    if (settings.lightbox2.enable_contact) {
32
     lightbox2_contact();
33
    }
34
  }
35
};
36
//End jQuery block
37
}(jQuery));