1234567891011121314151617181920212223242526272829303132333435363738 |
- (function ($) {
- Drupal.behaviors.splash = {
- attach: function(context, settings) {
- var source = settings.splash.source;
- var destination = settings.splash.destination;
- var timeout = 0 + settings.splash.timeout;
- var body = settings.splash.body;
- var jBody = $('<div />').html(body);
- var sourceChildren = $(source).children();
- sourceChildren.detach();
- jBody.appendTo($(source));
- if (timeout) {
- setTimeout(function() {
- Drupal.behaviors.splash.timeoutCallback(settings, sourceChildren);
- }, timeout);
- }
- },
- timeoutCallback: function(settings, sourceChildren) {
- var source = settings.splash.source;
- var destination = settings.splash.destination;
- var timeout = 0 + settings.splash.timeout;
- var jSource = $(source);
- var jSplash = jSource.children();
- jSplash.detach();
- sourceChildren.appendTo(jSource);
- if (timeout) {
- jSplash.appendTo($(destination));
- }
- }
- };
- })(jQuery);
|