//Priority plugins first! Quickly! Shave those milliseconds! /* Newer One function to load dynamic images */ if(typeof sircon.funcs.loadDynamicImages === 'undefined'){ (function(h){var b=window.sircon||{};b.funcs=b.funcs||{};b.funcs.loadDynamicImages=function(){h("[data-sircontheme_dynamicimage=1]").each(function(){var a=h(this),e=a.width(),b=a.outerHeight(),l=a.attr("data-alt"),f=a.attr("data-formatnames").split(";"),c=a.attr("data-currentformat"),g="",d=[];smallestSize=9999;smallestFormat="";largestSize=0;largestFormat="";hasLoadedAtleastOnce=a.attr("src")||0e?2:1,k=0,m=f.length;klargestSize&&(largestSize=d,largestFormat=g),!(d=smallestSize||(9999===smallestSize&&(smallestSize=largestSize,smallestFormat=largestFormat),"string"!==typeof a.attr(smallestFormat)?console.error("Sircontheme dynamic image seems to be missing its sources!"):(f=a.attr(smallestFormat).split(";"),c=new Image,e*=f[3],hasLoadedAtleastOnce||a.css("height",e+"px"),c.onload=function(){a.attr("data-currentFormat",smallestFormat);a.css("backgroundImage","url("+this.src+")");a.html(this);hasLoadedAtleastOnce||a.css("height","");setTimeout(function(){a.addClass("dynamic-image-is-loaded")},1)},c.src=f[0],c.alt=l))})};h(window).resize(b.funcs.loadDynamicImages)})(window.jQuery); }else{ console.log('Sircon Load dynamic images already loaded, skipping loading minified version'); } /* One plugin to keep track of element widths, this is ment to mimic @media queries on specific elements */ if(typeof sircon.plugins.mediaQueryElement === 'undefined'){ sircon.plugins.mediaQueryElement=function(c,e,f,n){var k=window.jQuery,l=f||[480,640,780,1024,1280],m=0,g=n,h,a;g||(g="");e||(e=c);this.runWidthCheck=function(){var b=k(c),d=k(e);m=b.width();for(var b=0,f=l.length;b=h?d.hasClass(a)||d.addClass(a):d.hasClass(a)&&d.removeClass(a)};this.runWidthCheck()};setInterval(function(){for(var c in sircon.objects.mediaQueryElement)sircon.objects.mediaQueryElement[c].runWidthCheck()},180); }else{ console.log('Sircon plugin mediaQueryElement already loaded, skipping loading minified version'); } /* CUSTOM SELECT BOXES . Comment this entire plugin to disable custom select boxes. Go on, don't worry! */ /*! * jquery.customSelect() - v0.5.1 * http://adam.co/lab/jquery/customselect/ * 2014-04-19 * * Copyright 2013 Adam Coulombe * @license http://www.opensource.org/licenses/mit-license.html MIT License * @license http://www.gnu.org/licenses/gpl.html GPL2 License */ (function(a){a.fn.extend({customSelect:function(c){if(typeof document.body.style.maxHeight==="undefined"){return this}var e={customClass:"customSelect",mapClass:true,mapStyle:true},c=a.extend(e,c),d=c.customClass,f=function(h,k){var g=h.find(":selected"),j=k.children(":first"),i=g.html()||" ";j.html(i);if(g.attr("disabled")){k.addClass(b("DisabledOption"))}else{k.removeClass(b("DisabledOption"))}setTimeout(function(){k.removeClass(b("Open"));a(document).off("mouseup.customSelect")},60)},b=function(g){return d+g};return this.each(function(){var g=a(this),i=a("").addClass(b("Inner")),h=a("");g.after(h.append(i));h.addClass(d);if(c.mapClass){h.addClass(g.attr("class"))}if(c.mapStyle){h.attr("style",g.attr("style"))}g.addClass("hasCustomSelect").on("render.customSelect",function(){f(g,h);g.css("width","");var k=parseInt(g.outerWidth(),10)-(parseInt(h.outerWidth(),10)-parseInt(h.width(),10));h.css({display:"inline-block"});var j=h.outerHeight();if(g.attr("disabled")){h.addClass(b("Disabled"))}else{h.removeClass(b("Disabled"))}i.css({width:k,display:"inline-block"});g.css({"-webkit-appearance":"menulist-button",width:h.outerWidth(),position:"absolute",opacity:0,height:j,fontSize:h.css("font-size")})}).on("change.customSelect",function(){h.addClass(b("Changed"));f(g,h)}).on("keyup.customSelect",function(j){if(!h.hasClass(b("Open"))){g.trigger("blur.customSelect");g.trigger("focus.customSelect")}else{if(j.which==13||j.which==27){f(g,h)}}}).on("mousedown.customSelect",function(){h.removeClass(b("Changed"))}).on("mouseup.customSelect",function(j){if(!h.hasClass(b("Open"))){if(a("."+b("Open")).not(h).length>0&&typeof InstallTrigger!=="undefined"){g.trigger("focus.customSelect")}else{h.addClass(b("Open"));j.stopPropagation();a(document).one("mouseup.customSelect",function(k){if(k.target!=g.get(0)&&a.inArray(k.target,g.find("*").get())<0){g.trigger("blur.customSelect")}else{f(g,h)}})}}}).on("focus.customSelect",function(){h.removeClass(b("Changed")).addClass(b("Focus"))}).on("blur.customSelect",function(){h.removeClass(b("Focus")+" "+b("Open"))}).on("mouseenter.customSelect",function(){h.addClass(b("Hover"))}).on("mouseleave.customSelect",function(){h.removeClass(b("Hover"))}).trigger("render.customSelect")})}})})(jQuery);