diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2011-09-23 13:44:35 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2011-09-23 13:44:35 -0300 |
commit | 45748d73b5e784ad3e79350564eb68dcac71aa45 (patch) | |
tree | edafc25882f15975ee4e6b3717ca70dcee50f398 /js | |
download | muambeiro-45748d73b5e784ad3e79350564eb68dcac71aa45.tar.gz muambeiro-45748d73b5e784ad3e79350564eb68dcac71aa45.tar.bz2 |
Initial import
Diffstat (limited to 'js')
-rwxr-xr-x | js/scripts.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/js/scripts.js b/js/scripts.js new file mode 100755 index 0000000..75bb991 --- /dev/null +++ b/js/scripts.js @@ -0,0 +1,40 @@ +// $Id$ +(function ($) { + +/** + * Toggles the collapsible region. + */ +Drupal.behaviors.skyAdminToggle = { + attach: function (context, settings) { + $('.collapsible-toggle a, context').click(function() { + $('#section-collapsible').toggleClass('toggle-active').find('.region-collapsible').slideToggle('fast'); + return false; + }); + } +} + +/** + * CSS Help for IE. + * - Adds even odd striping and containers for images in posts. + * - Adds a .first-child class to the first paragraph in each wrapper. + * - Adds a prompt containing the link to a comment for the permalink. + */ +Drupal.behaviors.skyPosts = { + attach: function (context, settings) { + // Detects IE6-8. + if (!jQuery.support.leadingWhitespace) { + $('.content p:first-child').addClass('first-child'); + $('article .content img, context').parent(':not(.field-item, .user-picture)').each(function(index) { + var stripe = (index/2) ? 'even' : 'odd'; + $(this).wrap('<div class="content-image-' + stripe + '"></div>'); + }); + } + // Comment link copy promt. + $("header span a.permalink").click( function() { + prompt('Link to this comment:', this.href); + return false; + }); + } +} + +})(jQuery); |