CM_MODULES = { openModuleEditor: function(section){ if(window.name=="wga-contentmanager-iframe"){ parent.BI.dialog.show('content-modules', parent.document.body, {mode:'edit', section:section}) } else alert("Please open page in OpenWGA Content Manager"); }, loadScript: function(url){ try{ var el = document.createElement("script"); var head = document.getElementsByTagName("head")[0]; head.appendChild(el); el.src=url; } catch(e){ alert("unable to load script:\n" + e); } } }; /* * jquery-plugin modal * * This script is part of the OpenWGA CMS plattform. * (c) Innovation Gate */ !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; console.log("hideModal callback", callback, onclose); } var fn = $.wga_modal.effect == "slide" ? "slideUp" : "fadeOut" bodyMask.fadeOut({duration: 200}); $(currentModal)[fn]({ duration: 200, complete: function(){ if(onclose) onclose(); $(this).trigger("modal-closed"); if(triggerEl) $(triggerEl).trigger("close", currentModal); triggerEl=null; } }); } function showModal(id, callback){ currentModal=id; maskBody(); if(callback) onload=callback; var fn = $.wga_modal.effect == "slide" ? "slideDown" : "fadeIn" $(id)[fn]({ duration: 200, complete: function(){ if(onload) onload(); $(this).trigger("modal-shown", triggerEl); if(triggerEl) $(triggerEl).trigger("load", id); } }); } $.fn.wga_modal = function(config){ var config = config||{}; return this.each(function(){ $(this).on("click", function(e){ e.preventDefault(); onload = config.onload; onclose = config.onclose; triggerEl=this; var target = config.target || this.hash if(config.width){ $(target).css({ width: config.width, marginLeft: -config.width/2 }) } showModal(target); }) }) } $(document).on('click.wga_modal_close', ".modal-popup > .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.hash || $(this).data("target")); }) // Globals $.wga_modal={ hide: hideModal, show: showModal, effect: "fade" } }(window.jQuery); $(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) }) } }) });