/* * speedo.popup.min.js * * Speedo Popup v2.0.1 * * Speedo Popup is a lightweight $j plugin * with powerful customization settings. * * http://www.artflow.ro * http://www.agapastudio.com * * Copyright (c) 2012-2013 By Artflow & Agapa Studio.All rights reserved. */ (function(b,j){var e=function(){return new e.fn.init};e.fn=e.prototype={version:"1.0.1",constructor:e,init:function(){return this}};e.fn.init.prototype=e.fn;j.speedo=e})($j,window); (function(b,j){var e=j.fn,c={},a=["opera","chrome","safari","firefox"],h;h=document.createElement("div");h.innerHTML="\x3c!--[if IE]>=a.startCount)return;e++;j().utility.set_cookie("speedo-popup-start-count",e,a.interval)}b("body").addClass("speedo-popup-ready");f=b(document.createElement("div"));f.addClass("speedo-container"+g);d.container=f;a.css3Effects&&"none"!=a.css3Effects&&f.addClass("speedo-effect-"+a.css3Effects.toLowerCase());f.css({display:"none",width:a.width?a.width: "auto",height:a.height?a.height:"auto","min-width":150,"min-height":150,left:"center"==a.left?"50%":a.left,top:"center"==a.top?"50%":a.top});f.appendTo("body");a.caption&&""!=a.caption&&(e=b(document.createElement("p")),e.addClass("speedo-popup-caption"),e.html(a.caption),f.append(e));s=b(document.createElement("div"));s.addClass("speedo-popup-loading");f.append(s);r=b(document.createElement("div"));r.addClass("speedo-content-holder");r.appendTo(f);var k;e=a.buttons;if(b.isArray(e)&&0=k&&(k=f.width(),m=f.height(),150'+('');m+='';m+="";l=b(m);r.append(l);setTimeout(function(){a.onComplete(f.get(0),n);k(f.get(0),n);f.css({"max-width":"auto"!=a.width?a.width:l.width(),"max-height":"auto"!=a.height? a.height:l.height()});d.centerPopup();s.hide()},80)}else r.html(e),a.onComplete(f.get(0),n),k(f.get(0),n),d.centerPopup(),s.hide()};this.width=function(a,b){var d=k;a&&(k=a,void 0==b||b?f.animate({width:a,left:Math.floor(a/2)},"slow"):f.css("width",a));return d};this.height=function(a,b){var d=m;a&&(m=a,void 0==b||b?f.animate({height:a,top:Math.floor(a/2)},"slow"):f.css("height",a));return d};this.remove_embeded_object=function(){n&&r.html(" ")};this.get_box_size=function(){return{left:l,top:p,width:k, height:m}};return this}};c.fn.init.prototype=c.fn;c.fn.events=new function(){var a=$j(this);this.bind=function(b,c,d){return a.bind(b,c,d)};this.unbind=function(b,c){return a.unbind(b,c)};this.trigger=function(b,c){return a.trigger(b,c)}};j.fn.popup=c})($j,speedo); $j.fn.speedoPopup=function(b){b.href&&null==b.useFrame&&(b.useFrame=!0);if("random"==b.css3Effects){var j="none zoomIn zoomOut flip flipInHor flipInVer bounceIn pageTop flyIn fadeInScale scaleDown fadeSpin pulse leftSpeedIn rollIn rollOut pulseBody fadeSpinBody".split(" ");b.css3Effects=j[Math.floor(Math.random()*(j.length-1))]}b=$j.extend(!0,{width:null,height:null,left:"center",top:"center",close:!0,closeCaption:"",theme:"default",htmlContent:"

Default content

",esc:!0,overlay:{opacity:0.75, zindex:1E5},caption:null,href:null,overlayClose:!0,autoClose:!1,autoShow:!1,startCount:0,interval:30,effectIn:"none",effectOut:"none",css3Effects:!1,showOnEvent:"click",useFrame:!1,useAjax:!1,loadingImage:!1,unload:!1,draggable:!1,responsive:!0,ajaxContent:{url:"",type:"POST",data:null},groupGallery:!1,groupIndex:0,groupAutoPlay:!0,groupWait:5E3,loop:!0,buttons:null,onBeforeShow:function(){},onShow:function(){},onComplete:function(){},onHide:function(){},onClose:function(){}},b);var e=null;!this.data("unique-speedo-instance")|| b.unload?(e=speedo().popup(b),b.autoShow?setTimeout(function(){e.create_popup()},b.autoShow):e.create_popup(),this.data("unique-speedo-instance",e)):(e=this.data("unique-speedo-instance"),b.autoShow?setTimeout(function(){e.showPopup()},b.autoShow):(e.showPopup(),e.centerPopup()));return e}; $j(function(){$j.speedoPopup={};$j.speedoPopup.smartSkins={};$j.speedoPopup.browser_ie=speedo().browser.is_ie;$j.speedoPopup.registerSmartSkin=function(b,j){$j.speedoPopup.smartSkins[b]=j};$j(document).on("click tap",".speedo-popup",function(b){b.preventDefault();var j=$j(this);b=j.attr("href");var e=[],c=j.attr("rel");c&&""!=c&&$j('.speedo-popup[rel="'+c+'"]').each(function(){var a=$j(this);a.get(0);j.get(0);e.push({url:a.attr("href"),title:a.attr("title")})});c=void 0!=$j(this).data("speedoOptions")?$j(this).data("speedoOptions"): speedo().utility.query_parameters(b);c=$j.extend({htmlContent:!1,effectIn:"fade",effectOut:"fade"},c);c.useAjax&&(c.ajaxContent={url:b,type:"GET",data:null});c.href=b;$j(this).speedoPopup(c)})}); (function(b,j){var e=function(){return new e.fn.init};e.fn=e.prototype={version:"1.0.1",constructor:e,init:function(){var c={};this.register_module=function(a,b){c[a]=b};this.deregister_module=function(a){c[a]=null};this.clear=function(){c={}};this.execute=function(a,e){for(key in c){var g=c[key];b.isFunction(g)&&(g=g.apply(a,[e]),null!=g&&g.init())}return null};return this}};e.fn.init.prototype=e.fn;j.fn.modules=e()})($j,speedo().popup); (function(b,j){j.fn.modules.register_module("draggable",function(e){function c(b){var c=l.position();d.bind("mousemove",{startX:b.clientX,startY:b.clientY,offset:c},a).bind("mouseup",h)}function a(a){var b=a.data.offset;l.css({left:a.clientX-a.data.startX+b.left,top:a.clientY-a.data.startY+b.top})}function h(){d.unbind("mousemove",a).unbind("mouseup",h)}var g=null,d=b(window),l=this.container;this.init=function(){e.draggable&&(g=b(document.createElement("div")),g.addClass("speedo-popup-drag-area"), g.bind("mousedown",c),l.append(g))};return this})})($j,speedo().popup); (function(b,j,e){j.fn.modules.register_module("effects",function(c){function a(a,f,h,g,k){if(f&&"none"!=f&&(!e().browser.is_ie||9=e().browser.version.high&&l.get(0).style.removeAttribute("filter",!1)})};return j})})($j,speedo().popup,speedo); (function(b,j,e,c){j.fn.modules.register_module("smartskin",function(a){function e(){j.SmartSkin.run_skin(a.theme,l);if(void 0!=b.speedoPopup.smartSkins[a.theme])b.speedoPopup.smartSkins[a.theme](d,g)}b(c);var g=this.container,d=this.overlay,l=this;this.init=function(){l.extend.add_action("show",e)};return l});j.SmartSkin=new function(){var a={};this.register_skin=function(b,c){a[b]=c};this.run_skin=function(b,c){if(void 0!=a[b])a[b](c.overlay,c.container)}}})($j,speedo().popup,speedo,window); (function(b,j,e,c){j.fn.modules.register_module("audio",function(a){function e(){d.load_audio(a.mp3Path,a.oggPath)}function g(){d.audio_element.stop().animate({volume:0},"slow",function(){d.audio_element.remove()})}b(c);var d=this;this.audio_element=null;this.init=function(){a=b.extend(a,{autoplayAudio:!0,loop:!1,mp3Path:void 0,oggPath:void 0,volume:1,onAudioStart:function(){},onAudioStop:function(){}});if(void 0!=a.mp3Path||void 0!=a.oggPath)d.extend.add_action("show",e),d.extend.add_action("hide", g)};this.load_audio=function(c,e){var g=b(document.createElement("audio"));a.autoplayAudio&&g.attr("autoplay","autoplay");a.loop&&g.attr("loop","loop");g.get(0).volume=0;g.bind("play",function(b){a.onAudioStart(b);d.audio_element.stop().animate({volume:a.volume},2E3)});g.bind("stop pause ended",a.onAudioStop);var h=b(document.createElement("source"));h.attr("src",e).attr("type","audio/ogg");g.append(h);h=b(document.createElement("source"));h.attr("src",c).attr("type","audio/mpeg");g.append(h);b("body").append(g); d.audio_element=g};this.play_audio=function(){null!=d.audio_element&&d.audio_element.get(0).play()};this.stop_audio=function(){null!=d.audio_element&&d.audio_element.get(0).pause()};this.get_audio_element=function(){return this.audio_element};return d})})($j,speedo().popup,speedo,window);