var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); /** * @file * Adds some show/hide to the admin form to make the UXP easier. */ (function($){ Drupal.behaviors.video = { attach: function (context, settings) { //lets see if we have any jmedia movies if($.fn.media) { $('.jmedia').media(); } if(settings.video) { $.fn.media.defaults.flvPlayer = settings.video.flvplayer; } //lets setup our colorbox videos $('.video-box').each(function() { var url = $(this).attr('href'); var data = $(this).metadata(); var width = data.width; var height= data.height; var player = settings.video.player; //player can be either jwplayer or flowplayer. $(this).colorbox({ html: '', onComplete:function() { if(player == 'flowplayer') { flowplayer("video-overlay", settings.video.flvplayer, { clip: { autoPlay: settings.video.autoplay, autoBuffering: settings.video.autobuffer } }); } else { $('#video-overlay').media({ flashvars: { autostart: settings.video.autoplay }, width:width, height:height }); } } }); }); } }; // On change of the thumbnails when edit. Drupal.behaviors.videoEdit = { attach : function(context, settings) { function setThumbnail(widget, type) { var thumbnails = widget.find('.video-thumbnails input'); var defaultthumbnail = widget.find('.video-use-default-video-thumb'); var largeimage = widget.find('.video-preview img'); var activeThumbnail = thumbnails.filter(':checked'); if (activeThumbnail.length > 0 && type != 'default') { var smallimage = activeThumbnail.next('label.option').find('img'); largeimage.attr('src', smallimage.attr('src')); defaultthumbnail.attr('checked', false); } else if(defaultthumbnail.is(':checked')) { thumbnails.attr('checked', false); largeimage.attr('src', defaultthumbnail.data('defaultimage')); } else { // try to select the first thumbnail. if (thumbnails.length > 0) { thumbnails.first().attr('checked', 'checked'); setThumbnail(widget, 'thumb'); } } } $('.video-thumbnails input', context).change(function() { setThumbnail($(this).parents('.video-widget'), 'thumb'); }); $('.video-use-default-video-thumb', context).change(function() { setThumbnail($(this).parents('.video-widget'), 'default'); }); $('.video-widget', context).each(function() { setThumbnail($(this), 'both'); }); } } })(jQuery); ; (function ($) { /** * Retrieves the summary for the first element. */ $.fn.drupalGetSummary = function () { var callback = this.data('summaryCallback'); return (this[0] && callback) ? $.trim(callback(this[0])) : ''; }; /** * Sets the summary for all matched elements. * * @param callback * Either a function that will be called each time the summary is * retrieved or a string (which is returned each time). */ $.fn.drupalSetSummary = function (callback) { var self = this; // To facilitate things, the callback should always be a function. If it's // not, we wrap it into an anonymous function which just returns the value. if (typeof callback != 'function') { var val = callback; callback = function () { return val; }; } return this .data('summaryCallback', callback) // To prevent duplicate events, the handlers are first removed and then // (re-)added. .unbind('formUpdated.summary') .bind('formUpdated.summary', function () { self.trigger('summaryUpdated'); }) // The actual summaryUpdated handler doesn't fire when the callback is // changed, so we have to do this manually. .trigger('summaryUpdated'); }; /** * Sends a 'formUpdated' event each time a form element is modified. */ Drupal.behaviors.formUpdated = { attach: function (context) { // These events are namespaced so that we can remove them later. var events = 'change.formUpdated click.formUpdated blur.formUpdated keyup.formUpdated'; $(context) // Since context could be an input element itself, it's added back to // the jQuery object and filtered again. .find(':input').andSelf().filter(':input') // To prevent duplicate events, the handlers are first removed and then // (re-)added. .unbind(events).bind(events, function () { $(this).trigger('formUpdated'); }); } }; /** * Prepopulate form fields with information from the visitor cookie. */ Drupal.behaviors.fillUserInfoFromCookie = { attach: function (context, settings) { $('form.user-info-from-cookie').once('user-info-from-cookie', function () { var formContext = this; $.each(['name', 'mail', 'homepage'], function () { var $element = $('[name=' + this + ']', formContext); var cookie = $.cookie('Drupal.visitor.' + this); if ($element.length && cookie) { $element.val(cookie); } }); }); } }; })(jQuery); ; (function ($) { /** * Toggle the visibility of a fieldset using smooth animations. */ Drupal.toggleFieldset = function (fieldset) { var $fieldset = $(fieldset); if ($fieldset.is('.collapsed')) { var $content = $('> .fieldset-wrapper', fieldset).hide(); $fieldset .removeClass('collapsed') .trigger({ type: 'collapsed', value: false }) .find('> legend span.fieldset-legend-prefix').html(Drupal.t('Hide')); $content.slideDown({ duration: 'fast', easing: 'linear', complete: function () { Drupal.collapseScrollIntoView(fieldset); fieldset.animating = false; }, step: function () { // Scroll the fieldset into view. Drupal.collapseScrollIntoView(fieldset); } }); } else { $fieldset.trigger({ type: 'collapsed', value: true }); $('> .fieldset-wrapper', fieldset).slideUp('fast', function () { $fieldset .addClass('collapsed') .find('> legend span.fieldset-legend-prefix').html(Drupal.t('Show')); fieldset.animating = false; }); } }; /** * Scroll a given fieldset into view as much as possible. */ Drupal.collapseScrollIntoView = function (node) { var h = document.documentElement.clientHeight || document.body.clientHeight || 0; var offset = document.documentElement.scrollTop || document.body.scrollTop || 0; var posY = $(node).offset().top; var fudge = 55; if (posY + node.offsetHeight + fudge > h + offset) { if (node.offsetHeight > h) { window.scrollTo(0, posY); } else { window.scrollTo(0, posY + node.offsetHeight - h + fudge); } } }; Drupal.behaviors.collapse = { attach: function (context, settings) { $('fieldset.collapsible', context).once('collapse', function () { var $fieldset = $(this); // Expand fieldset if there are errors inside, or if it contains an // element that is targeted by the URI fragment identifier. var anchor = location.hash && location.hash != '#' ? ', ' + location.hash : ''; if ($fieldset.find('.error' + anchor).length) { $fieldset.removeClass('collapsed'); } var summary = $(''); $fieldset. bind('summaryUpdated', function () { var text = $.trim($fieldset.drupalGetSummary()); summary.html(text ? ' (' + text + ')' : ''); }) .trigger('summaryUpdated'); // Turn the legend into a clickable link, but retain span.fieldset-legend // for CSS positioning. var $legend = $('> legend .fieldset-legend', this); $('') .append($fieldset.hasClass('collapsed') ? Drupal.t('Show') : Drupal.t('Hide')) .prependTo($legend) .after(' '); // .wrapInner() does not retain bound events. var $link = $('') .prepend($legend.contents()) .appendTo($legend) .click(function () { var fieldset = $fieldset.get(0); // Don't animate multiple times. if (!fieldset.animating) { fieldset.animating = true; Drupal.toggleFieldset(fieldset); } return false; }); $legend.append(summary); }); } }; })(jQuery); ; (function($) { /** * Drupal FieldGroup object. */ Drupal.FieldGroup = Drupal.FieldGroup || {}; Drupal.FieldGroup.Effects = Drupal.FieldGroup.Effects || {}; Drupal.FieldGroup.groupWithfocus = null; Drupal.FieldGroup.setGroupWithfocus = function(element) { element.css({display: 'block'}); Drupal.FieldGroup.groupWithfocus = element; } /** * Implements Drupal.FieldGroup.processHook(). */ Drupal.FieldGroup.Effects.processFieldset = { execute: function (context, settings, type) { if (type == 'form') { // Add required fields mark to any fieldsets containing required fields $('fieldset.fieldset', context).once('fieldgroup-effects', function(i) { if ($(this).is('.required-fields') && $(this).find('.form-required').length > 0) { $('legend span.fieldset-legend', $(this)).eq(0).append(' ').append($('.form-required').eq(0).clone()); } if ($('.error', $(this)).length) { $('legend span.fieldset-legend', $(this)).eq(0).addClass('error'); Drupal.FieldGroup.setGroupWithfocus($(this)); } }); } } } /** * Implements Drupal.FieldGroup.processHook(). */ Drupal.FieldGroup.Effects.processAccordion = { execute: function (context, settings, type) { $('div.field-group-accordion-wrapper', context).once('fieldgroup-effects', function () { var wrapper = $(this); wrapper.accordion({ autoHeight: false, active: '.field-group-accordion-active', collapsible: true, changestart: function(event, ui) { if ($(this).hasClass('effect-none')) { ui.options.animated = false; } else { ui.options.animated = 'slide'; } } }); if (type == 'form') { var $firstErrorItem = false; // Add required fields mark to any element containing required fields wrapper.find('div.field-group-accordion-item').each(function(i) { if ($(this).is('.required-fields') && $(this).find('.form-required').length > 0) { $('h3.ui-accordion-header a').eq(i).append(' ').append($('.form-required').eq(0).clone()); } if ($('.error', $(this)).length) { // Save first error item, for focussing it. if (!$firstErrorItem) { $firstErrorItem = $(this).parent().accordion("activate" , i); } $('h3.ui-accordion-header').eq(i).addClass('error'); } }); // Save first error item, for focussing it. if (!$firstErrorItem) { $('.ui-accordion-content-active', $firstErrorItem).css({height: 'auto', width: 'auto', display: 'block'}); } } }); } } /** * Implements Drupal.FieldGroup.processHook(). */ Drupal.FieldGroup.Effects.processHtabs = { execute: function (context, settings, type) { if (type == 'form') { // Add required fields mark to any element containing required fields $('fieldset.horizontal-tabs-pane', context).once('fieldgroup-effects', function(i) { if ($(this).is('.required-fields') && $(this).find('.form-required').length > 0) { $(this).data('horizontalTab').link.find('strong:first').after($('.form-required').eq(0).clone()).after(' '); } if ($('.error', $(this)).length) { $(this).data('horizontalTab').link.parent().addClass('error'); Drupal.FieldGroup.setGroupWithfocus($(this)); $(this).data('horizontalTab').focus(); } }); } } } /** * Implements Drupal.FieldGroup.processHook(). */ Drupal.FieldGroup.Effects.processTabs = { execute: function (context, settings, type) { if (type == 'form') { // Add required fields mark to any fieldsets containing required fields $('fieldset.vertical-tabs-pane', context).once('fieldgroup-effects', function(i) { if ($(this).is('.required-fields') && $(this).find('.form-required').length > 0) { $(this).data('verticalTab').link.find('strong:first').after($('.form-required').eq(0).clone()).after(' '); } if ($('.error', $(this)).length) { $(this).data('verticalTab').link.parent().addClass('error'); Drupal.FieldGroup.setGroupWithfocus($(this)); $(this).data('verticalTab').focus(); } }); } } } /** * Implements Drupal.FieldGroup.processHook(). * * TODO clean this up meaning check if this is really * necessary. */ Drupal.FieldGroup.Effects.processDiv = { execute: function (context, settings, type) { $('div.collapsible', context).once('fieldgroup-effects', function() { var $wrapper = $(this); // Turn the legend into a clickable link, but retain span.field-group-format-toggler // for CSS positioning. var $toggler = $('span.field-group-format-toggler:first', $wrapper); var $link = $(''); $link.prepend($toggler.contents()); // Add required field markers if needed if ($(this).is('.required-fields') && $(this).find('.form-required').length > 0) { $link.append(' ').append($('.form-required').eq(0).clone()); } $link.appendTo($toggler); // .wrapInner() does not retain bound events. $link.click(function () { var wrapper = $wrapper.get(0); // Don't animate multiple times. if (!wrapper.animating) { wrapper.animating = true; var speed = $wrapper.hasClass('speed-fast') ? 300 : 1000; if ($wrapper.hasClass('effect-none') && $wrapper.hasClass('speed-none')) { $('> .field-group-format-wrapper', wrapper).toggle(); } else if ($wrapper.hasClass('effect-blind')) { $('> .field-group-format-wrapper', wrapper).toggle('blind', {}, speed); } else { $('> .field-group-format-wrapper', wrapper).toggle(speed); } wrapper.animating = false; } $wrapper.toggleClass('collapsed'); return false; }); }); } }; /** * Behaviors. */ Drupal.behaviors.fieldGroup = { attach: function (context, settings) { if (settings.field_group == undefined) { return; } // Execute all of them. $.each(Drupal.FieldGroup.Effects, function (func) { // We check for a wrapper function in Drupal.field_group as // alternative for dynamic string function calls. var type = func.toLowerCase().replace("process", ""); if (settings.field_group[type] != undefined && $.isFunction(this.execute)) { this.execute(context, settings, settings.field_group[type]); } }); // Fixes css for fieldgroups under vertical tabs. $('.fieldset-wrapper .fieldset > legend').css({display: 'block'}); $('.vertical-tabs fieldset.fieldset').addClass('default-fallback'); // Add a new ID to each fieldset. $('.group-wrapper fieldset').each(function() { // Tats bad, but we have to keep the actual id to prevent layouts to break. var fieldgorupID = 'field_group-' + $(this).attr('id') + ' ' + $(this).attr('id'); $(this).attr('id', fieldgorupID); }) // Set the hash in url to remember last userselection. $('.group-wrapper ul li').each(function() { var fieldGroupNavigationListIndex = $(this).index(); $(this).children('a').click(function() { var fieldset = $('.group-wrapper fieldset').get(fieldGroupNavigationListIndex); // Grab the first id, holding the wanted hashurl. var hashUrl = $(fieldset).attr('id').replace(/^field_group-/, '').split(' ')[0]; window.location.hash = hashUrl; }); }); } }; })(jQuery);; (function ($) { /** * A progressbar object. Initialized with the given id. Must be inserted into * the DOM afterwards through progressBar.element. * * method is the function which will perform the HTTP request to get the * progress bar state. Either "GET" or "POST". * * e.g. pb = new progressBar('myProgressBar'); * some_element.appendChild(pb.element); */ Drupal.progressBar = function (id, updateCallback, method, errorCallback) { var pb = this; this.id = id; this.method = method || 'GET'; this.updateCallback = updateCallback; this.errorCallback = errorCallback; // The WAI-ARIA setting aria-live="polite" will announce changes after users // have completed their current activity and not interrupt the screen reader. this.element = $('
').attr('id', id); this.element.html(' ' + '' + ' '); }; /** * Set the percentage and status message for the progressbar. */ Drupal.progressBar.prototype.setProgress = function (percentage, message) { if (percentage >= 0 && percentage <= 100) { $('div.filled', this.element).css('width', percentage + '%'); $('div.percentage', this.element).html(percentage + '%'); } $('div.message', this.element).html(message); if (this.updateCallback) { this.updateCallback(percentage, message, this); } }; /** * Start monitoring progress via Ajax. */ Drupal.progressBar.prototype.startMonitoring = function (uri, delay) { this.delay = delay; this.uri = uri; this.sendPing(); }; /** * Stop monitoring progress via Ajax. */ Drupal.progressBar.prototype.stopMonitoring = function () { clearTimeout(this.timer); // This allows monitoring to be stopped from within the callback. this.uri = null; }; /** * Request progress data from server. */ Drupal.progressBar.prototype.sendPing = function () { if (this.timer) { clearTimeout(this.timer); } if (this.uri) { var pb = this; // When doing a post request, you need non-null data. Otherwise a // HTTP 411 or HTTP 406 (with Apache mod_security) error may result. $.ajax({ type: this.method, url: this.uri, data: '', dataType: 'json', success: function (progress) { // Display errors. if (progress.status == 0) { pb.displayError(progress.data); return; } // Update display. pb.setProgress(progress.percentage, progress.message); // Schedule next timer. pb.timer = setTimeout(function () { pb.sendPing(); }, pb.delay); }, error: function (xmlhttp) { pb.displayError(Drupal.ajaxError(xmlhttp, pb.uri)); } }); } }; /** * Display errors on the page. */ Drupal.progressBar.prototype.displayError = function (string) { var error = $('').html(string); $(this.element).before(error).hide(); if (this.errorCallback) { this.errorCallback(this); } }; })(jQuery); ; /** * @file * * Implement a modal form. * * @see modal.inc for documentation. * * This javascript relies on the CTools ajax responder. */ (function ($) { // Make sure our objects are defined. Drupal.CTools = Drupal.CTools || {}; Drupal.CTools.Modal = Drupal.CTools.Modal || {}; /** * Display the modal * * @todo -- document the settings. */ Drupal.CTools.Modal.show = function(choice) { var opts = {}; if (choice && typeof choice == 'string' && Drupal.settings[choice]) { // This notation guarantees we are actually copying it. $.extend(true, opts, Drupal.settings[choice]); } else if (choice) { $.extend(true, opts, choice); } var defaults = { modalTheme: 'CToolsModalDialog', throbberTheme: 'CToolsModalThrobber', animation: 'show', animationSpeed: 'fast', modalSize: { type: 'scale', width: .8, height: .8, addWidth: 0, addHeight: 0, // How much to remove from the inner content to make space for the // theming. contentRight: 25, contentBottom: 45 }, modalOptions: { opacity: .55, background: '#fff' } }; var settings = {}; $.extend(true, settings, defaults, Drupal.settings.CToolsModal, opts); if (Drupal.CTools.Modal.currentSettings && Drupal.CTools.Modal.currentSettings != settings) { Drupal.CTools.Modal.modal.remove(); Drupal.CTools.Modal.modal = null; } Drupal.CTools.Modal.currentSettings = settings; var resize = function(e) { // When creating the modal, it actually exists only in a theoretical // place that is not in the DOM. But once the modal exists, it is in the // DOM so the context must be set appropriately. var context = e ? document : Drupal.CTools.Modal.modal; if (Drupal.CTools.Modal.currentSettings.modalSize.type == 'scale') { var width = $(window).width() * Drupal.CTools.Modal.currentSettings.modalSize.width; var height = $(window).height() * Drupal.CTools.Modal.currentSettings.modalSize.height; } else { var width = Drupal.CTools.Modal.currentSettings.modalSize.width; var height = Drupal.CTools.Modal.currentSettings.modalSize.height; } // Use the additionol pixels for creating the width and height. $('div.ctools-modal-content', context).css({ 'width': width + Drupal.CTools.Modal.currentSettings.modalSize.addWidth + 'px', 'height': height + Drupal.CTools.Modal.currentSettings.modalSize.addHeight + 'px' }); $('div.ctools-modal-content .modal-content', context).css({ 'width': (width - Drupal.CTools.Modal.currentSettings.modalSize.contentRight) + 'px', 'height': (height - Drupal.CTools.Modal.currentSettings.modalSize.contentBottom) + 'px' }); } if (!Drupal.CTools.Modal.modal) { Drupal.CTools.Modal.modal = $(Drupal.theme(settings.modalTheme)); if (settings.modalSize.type == 'scale') { $(window).bind('resize', resize); } } resize(); $('span.modal-title', Drupal.CTools.Modal.modal).html(Drupal.CTools.Modal.currentSettings.loadingText); Drupal.CTools.Modal.modalContent(Drupal.CTools.Modal.modal, settings.modalOptions, settings.animation, settings.animationSpeed); $('#modalContent .modal-content').html(Drupal.theme(settings.throbberTheme)); }; /** * Hide the modal */ Drupal.CTools.Modal.dismiss = function() { if (Drupal.CTools.Modal.modal) { Drupal.CTools.Modal.unmodalContent(Drupal.CTools.Modal.modal); } }; /** * Provide the HTML to create the modal dialog. */ Drupal.theme.prototype.CToolsModalDialog = function () { var html = '' html += '