if(typeof(require)==="undefined"){ // create dummy require(): window.require = function(deps, callback){ callback(); } } /* * jquery-plugin accordion * * This script is part of the OpenWGA CMS plattform. * (c) Innovation Gate */ !function(root, factory) { if(typeof define === 'function' && define.amd) define("jquery-accordion", ["jquery"], factory); else factory(root.jQuery); }(window, function($){ function expand(panel, speed, index){ panel.addClass("active").next().slideDown({ duration: speed, complete: function(){ panel.trigger("activated", [this, index]); } }); // give child elements a chance to resize if necessary: $(window).trigger("resize"); } function collapse(panel, speed, index){ panel.removeClass("active").next().slideUp({ duration: speed, complete: function(){ panel.trigger("deactivated", [this, index]); } }); } function activate(el, index){ var header = $("> .accordion-header", el).eq(index) var isActive = header.hasClass("active"); var speed = el.data("accordion-effect-speed") || "fast" $("> .accordion-header", el).removeClass("active").next().slideUp(speed); if(!isActive) expand(header, speed, index) } var exports={ activate: activate } $.fn.wga_accordion = function(config){ var config = config||{}; return this.each(function(){ var el = $(this); if(typeof(config)=="string"){ try{ var f = exports[config.toLowerCase()] return f.apply(el, [el].concat(args)); } catch(e){ throw("jquery plugin wga_accordion: method '" + config + "' not found.") return null; } } else{ var speed = config.effectSpeed||'fast'; el.data("accordion-effect-speed", speed) if(config.active!=undefined){ if(config.delay){ setTimeout(function(){ expand($("> .accordion-header", el).eq(config.active), speed, config.active) }, config.delay); } else expand($("> .accordion-header", el).eq(config.active), speed, config.active) } $("> .accordion-header", el).click(function(ev){ ev.preventDefault(); var $this = $(this); var isActive = $this.hasClass("active"); if(config.multiple){ if(isActive) collapse($this, speed, $("> .accordion-header", el).index($this)); else expand($this, speed, $("> .accordion-header", el).index($this)); } else{ var current = $("> .accordion-header.active", el).first() current && collapse(current, speed, $("> .accordion-header", el).index(current)); if(!isActive) expand($this, speed, $("> .accordion-header", el).index($this)); } }) } }) } // data interface: $(document).on('click.wga_accordion_activate', "[data-accordion='activate']", function(e){ e.preventDefault(); var root_el = $(this).data("target") || $(this).parents(".accordion") var index = $(this).data("index") || this.hash.substr(1) || 0 activate(root_el, index); }) }); /* * jquery-plugin modal * * This script is part of the OpenWGA CMS plattform. * (c) Innovation Gate */ !function(root, factory) { if(typeof define === 'function' && define.amd) define("jquery-modal", ["jquery"], factory); else factory(root.jQuery); }(window, function($){ var bodyMask; var currentModal; var onload; var onclose; var triggerEl; function maskBody(){ if(!bodyMask){ $("body").append('') bodyMask = $("#modal-body-mask").on("click.hide-modal", function(){hideModal()}) } bodyMask.fadeIn({duration: 200}) } function hideModal(callback){ if(callback){ onclose=callback; } var fn = $.wga_modal.effect == "slide" ? "slideUp" : "fadeOut" bodyMask && bodyMask.fadeOut({duration: 200}); currentModal[fn]({ duration: 200, complete: function(){ $("body").removeClass("modal-open"); if(onclose){ onclose.call(currentModal); onclose=null } $(this).trigger("modal-closed", currentModal); if(triggerEl){ $(triggerEl).trigger("modal-closed", currentModal); $(triggerEl).trigger("close", currentModal); // deprecated triggerEl=null; } } }); } function showModal(id, callback){ var el = $(id); if(!el.length){ if(callback) callback.call(el); return alert("Modal with ID " + id + " not found"); } if(!el.hasClass("modal-popup")) el.addClass("modal-popup"); currentModal=el; maskBody(); if(callback) onload=callback; var fn = $.wga_modal.effect == "slide" ? "slideDown" : "fadeIn" el[fn]({ duration: 200, complete: function(){ $("body").addClass("modal-open"); if(onload){ onload.call(el); onload=null; } $(this).trigger("modal-shown", [el[0], triggerEl && $(triggerEl).data()]); if(triggerEl){ $(triggerEl).trigger("load", el); // deprecated $(triggerEl).trigger("modal-shown", el); } } }); } var exports={ show: showModal, hide: function(el, callback){ hideModal(callback); } } $.fn.wga_modal = function(config){ var config = config||{}; var args = []; for(i=1; i .close, .modal-popup a.close-modal, [data-modal='hide']", function(e){ e.preventDefault(); hideModal(); }) // data interface: $(document).on('click.wga_modal_show', "[data-modal='show']", function(e){ e.preventDefault(); triggerEl=this; showModal($(this).data("target") || this.hash); }) // Globals $.wga_modal={ hide: hideModal, show: showModal, effect: "fade" } return $.wga_modal }); $(function(){ $(".module-waldmann_slideshow .slideshow").each(function(){ var $this = $(this), pause_time = $this.data("pause") || 3000, fade_time = $this.data("fade") || 5000, images = $(this).find(".module-cm_image"), i=0; images.eq(0).show() setTimeout(slideshow, pause_time) function slideshow(){ images.eq(i++).fadeOut(fade_time) if(i>=images.length) i=0; images.eq(i).fadeIn(fade_time, function(){ setTimeout(slideshow, pause_time) }) } }) });