Projet

Général

Profil

Paste
Télécharger (1,43 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / themes / sky / js / scripts.js @ 4b706e38

1
// $Id$
2
(function ($) {
3

    
4
/**
5
 * Toggles the collapsible region.
6
 */
7
Drupal.behaviors.skyCollapsRegionToggle = {
8
  attach: function (context, settings) {
9
    $('.collapsible-toggle a, context').click(function() {
10
      $('#section-collapsible').toggleClass('toggle-active').find('.region-collapsible').slideToggle('fast');
11
      return false;
12
    });
13
  }
14
}
15

    
16
Drupal.behaviors.skyCollapsMenuToggle = {
17
  attach: function (context, settings) {
18
    $('.menu-toggle a, context').click(function() {
19
      $('#menu-bar').toggleClass('toggle-active').find('nav').slideToggle('fast');
20
      return false;
21
    });
22
  }
23
}
24

    
25
/**
26
 * CSS Help for IE.
27
 * - Adds even odd striping and containers for images in posts.
28
 * - Adds a .first-child class to the first paragraph in each wrapper.
29
 * - Adds a prompt containing the link to a comment for the permalink.
30
 */
31
Drupal.behaviors.skyPosts = {
32
  attach: function (context, settings) {
33
    // Detects IE6-8.
34
    if (!jQuery.support.leadingWhitespace) {
35
      $('.article-content p:first-child').addClass('first-child');
36
      $('.article-content img, context').parent(':not(.field-item, .user-picture)').each(function(index) {
37
        var stripe = (index/2) ? 'even' : 'odd';
38
        $(this).wrap('<div class="content-image-' + stripe  + '"></div>');
39
      });
40
    }
41
    // Comment link copy promt.
42
    $("time span a").click( function() {
43
      prompt('Link to this comment:', this.href);
44
      return false;
45
    });
46
  }
47
}
48

    
49
})(jQuery);