/** * hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+ * * * @param f onMouseOver function || An object with configuration options * @param g onMouseOut function || Nothing (use configuration options object) * @author Brian Cherne */ (function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY)) 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); // Get the index to set active. var active_index = false; wrapper.find('.accordion-item').each(function(i) { if ($(this).hasClass('field-group-accordion-active')) { active_index = i; } }); wrapper.accordion({ // heightStyle: "content", heightStyle: "content", // jQuery UI >= v1.9 autoHeight: false, // jQuery UI < v1.9 active: active_index, 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') { var errorFocussed = false; // 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'); // Focus the first tab with error. if (!errorFocussed) { Drupal.FieldGroup.setGroupWithfocus($(this)); $(this).data('verticalTab').focus(); errorFocussed = true; } } }); } } } /** * 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) { settings.field_group = settings.field_group || Drupal.settings.field_group; 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 .horizontal-tabs-panes > fieldset', context).once('group-wrapper-panes-processed', function() { // Tats bad, but we have to keep the actual id to prevent layouts to break. var fieldgroupID = 'field_group-' + $(this).attr('id'); $(this).attr('id', fieldgroupID); }); // Set the hash in url to remember last userselection. $('.group-wrapper ul li').once('group-wrapper-ul-processed', 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); ; /* * sf-Touchscreen v1.2b - Provides touchscreen compatibility for the jQuery Superfish plugin. * * Developer's note: * Built as a part of the Superfish project for Drupal (http://drupal.org/project/superfish) * Found any bug? have any cool ideas? contact me right away! http://drupal.org/user/619294/contact * * jQuery version: 1.3.x or higher. * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ (function($){ $.fn.sftouchscreen = function(options){ options = $.extend({ mode: 'inactive', breakpoint: 768, useragent: '' }, options); function activate(menu){ // Select hyperlinks from parent menu items. menu.find('li > ul').closest('li').children('a').each(function(){ var item = $(this); // No .toggle() here as it's not possible to reset it. item.click(function(event){ // Already clicked? proceed to the URL. if (item.hasClass('sf-clicked')){ window.location = item.attr('href'); } // Prevent it otherwise. else { event.preventDefault(); item.addClass('sf-clicked'); } }).closest('li').mouseleave(function(){ // Reset everything. item.removeClass('sf-clicked'); }); }); } // Return original object to support chaining. return this.each(function(){ var menu = $(this), mode = options.mode; // The rest is crystal clear, isn't it? :) switch (mode){ case 'always_active' : activate(menu); break; case 'window_width' : if ($(window).width() < options.breakpoint){ activate(menu); } var timer; $(window).resize(function(){ clearTimeout(timer); timer = setTimeout(function(){ if ($(window).width() < options.breakpoint){ activate(menu); } }, 100); }); break; case 'useragent_custom' : if (options.useragent != ''){ if (navigator.userAgent.match(options.useragents)){ activate(menu); } } break; case 'useragent_predefined' : if (navigator.userAgent.match(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i)){ activate(menu); } break; } }); }; })(jQuery);; /* * Supposition v0.2 - an optional enhancer for Superfish jQuery menu widget. * * Copyright (c) 2008 Joel Birch - based mostly on work by Jesse Klaasse and credit goes largely to him. * Special thanks to Karl Swedberg for valuable input. * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ /* * This is not the original jQuery Supersubs plugin. * Please refer to the README for more information. */ (function($){ $.fn.supposition = function(){ var $w = $(window), /*do this once instead of every onBeforeShow call*/ _offset = function(dir) { return window[dir == 'y' ? 'pageYOffset' : 'pageXOffset'] || document.documentElement && document.documentElement[dir=='y' ? 'scrollTop' : 'scrollLeft'] || document.body[dir=='y' ? 'scrollTop' : 'scrollLeft']; }, onHide = function(){ this.css({bottom:''}); }, onBeforeShow = function(){ this.each(function(){ var $u = $(this); $u.css('display','block'); var menuWidth = $u.width(), menuParentWidth = $u.closest('li').outerWidth(true), menuParentLeft = $u.closest('li').offset().left, totalRight = $w.width() + _offset('x'), menuRight = $u.offset().left + menuWidth, exactMenuWidth = (menuRight > (menuParentWidth + menuParentLeft)) ? menuWidth - (menuRight - (menuParentWidth + menuParentLeft)) : menuWidth; if ($u.parents('.sf-js-enabled').hasClass('rtl')) { if (menuParentLeft < exactMenuWidth) { $u.css('left', menuParentWidth + 'px'); $u.css('right', 'auto'); } } else { if (menuRight > totalRight && menuParentLeft > menuWidth) { $u.css('right', menuParentWidth + 'px'); $u.css('left', 'auto'); } } var windowHeight = $w.height(), offsetTop = $u.offset().top, menuParentShadow = ($u.closest('.sf-menu').hasClass('sf-shadow') && $u.css('padding-bottom').length > 0) ? parseInt($u.css('padding-bottom').slice(0,-2)) : 0, menuParentHeight = ($u.closest('.sf-menu').hasClass('sf-vertical')) ? '-' + menuParentShadow : $u.parent().outerHeight(true) - menuParentShadow, menuHeight = $u.height(), baseline = windowHeight + _offset('y'); var expandUp = ((offsetTop + menuHeight > baseline) && (offsetTop > menuHeight)); if (expandUp) { $u.css('bottom', menuParentHeight + 'px'); $u.css('top', 'auto'); } $u.css('display','none'); }); }; return this.each(function() { var o = $.fn.superfish.o[this.serial]; /* get this menu's options */ /* if callbacks already set, store them */ var _onBeforeShow = o.onBeforeShow, _onHide = o.onHide; $.extend($.fn.superfish.o[this.serial],{ onBeforeShow: function() { onBeforeShow.call(this); /* fire our Supposition callback */ _onBeforeShow.call(this); /* fire stored callbacks */ }, onHide: function() { onHide.call(this); /* fire our Supposition callback */ _onHide.call(this); /* fire stored callbacks */ } }); }); }; })(jQuery);; /* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) * Licensed under the MIT License (LICENSE.txt). * * Version 2.1.2 */ (function(a){a.fn.bgiframe=(a.browser.msie&&/msie 6\.0/i.test(navigator.userAgent)?function(d){d=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},d);var c='