jee.js 939 B

123456789101112131415161718192021222324252627282930
  1. Drupal.behaviors.init_theme = function (context) {
  2. // Growl-style system messages
  3. $('#messages-and-help > div.messages:not(.processed)')
  4. .addClass('processed')
  5. .each(function() {
  6. // If a message meets these criteria, we don't autoclose
  7. // - contains a link
  8. // - is an error or warning
  9. // - contains a lenghthy amount of text
  10. if ($('a', this).size() || $(this).is('.error') || $(this).is('.warning') || $(this).text().length > 100) {
  11. $(this).prepend("<span class='close'>X</span>");
  12. $('span.close', this).click(function() {
  13. $(this).parent().slideUp('fast');
  14. });
  15. }
  16. else {
  17. // This essentially adds a 3 second pause before hiding the message.
  18. $(this).animate({opacity:1}, 5000, 'linear', function() {
  19. $(this).slideUp('fast');
  20. });
  21. }
  22. });
  23. };
  24. jQuery(document).ready(function($) {
  25. console.log('Hello Jee');
  26. });