/*Scroll timer*/ (function ($) { var uniqueCntr = 0; $.fn.dexpScroll = function (waitTime, fn) { if (typeof waitTime === "function") { fn = waitTime; waitTime = 100; } var tag = "scrollTimer" + uniqueCntr++; this.scroll(function () { var self = $(this); var timer = self.data(tag); if (timer) { clearTimeout(timer); } timer = setTimeout(function () { self.removeData(tag); fn.call(self[0]); }, waitTime); self.data(tag, timer); }); } })(jQuery); ; Drupal.locale = { 'pluralFormula': function ($n) { return Number((($n==1)?(0):((((($n%10)>=2)&&(($n%10)<=4))&&((($n%100)<10)||(($n%100)>=20)))?(1):2))); }, 'strings': {"":{"An AJAX HTTP error occurred.":"Wyst\u0105pi\u0142 b\u0142\u0105d w AJAX HTTP.","HTTP Result Code: !status":"B\u0142\u0105d HTTP: !status","An AJAX HTTP request terminated abnormally.":"Zapytanie AJAX HTTP zosta\u0142o przerwane.","Debugging information follows.":"Informacje diagnostyczne.","Path: !uri":"\u015acie\u017cka: !uri","StatusText: !statusText":"StatusText: !statusText","ResponseText: !responseText":"ResponseText: !responseText","ReadyState: !readyState":"ReadyState: !readyState","CustomMessage: !customMessage":"CustomMessage: !customMessage","Previous":"Poprzednie","Next":"Dalej","Close":"Zamknij","Hide":"Ukryj","Show":"Poka\u017c","Edit":"Edytuj","Loading token browser...":"\u0141adowanie przegl\u0105darki wzorc\u00f3w...","Available tokens":"Dost\u0119pne \u017cetony","Insert this token into your form":"Wstaw ten wzorzec do formularza","First click a text field to insert your tokens into.":"Najpierw kliknij w pole tekstowe, do kt\u00f3rego b\u0119d\u0105 wstawione wzorce.","Cancel":"Anuluj","Disabled":"Wy\u0142\u0105czone","Enabled":"W\u0142\u0105czone","all":"wszystkie","none":"brak","Save":"Zapisz","Insert Teaser Break":"Wstaw podzia\u0142 na skr\u00f3t","Insert Page Break":"Wstaw podzia\u0142 strony","The document already contains a teaser break. Do you want to proceed by removing it first?":"Dokument zawiera ju\u017c podzia\u0142 na skr\u00f3t. Czy chcesz kontynuowa\u0107 usuwaj\u0105c go jako pierwszego?","Paste embed code here":"Wklej kod tutaj","Add":"Dodaj","Configure":"Konfiguruj","Loading...":"Wczytuj\u0119...","Loading":"\u0141adowanie","Upload":"Wy\u015blij plik","Done":"Gotowe","1 hour":"1 godzina","@count hours":"@count godziny","1 day":"1 dzie\u0144","@count days":"@count dni","OK":"OK","Select all rows in this table":"Zaznacza wszystkie wiersze tabeli","Deselect all rows in this table":"Cofa zaznaczenie wszystkich wierszy tabeli","Not published":"Nie do publikacji","Please wait...":"Prosz\u0119 czeka\u0107...","1 year":"1 rok","@count years":"@count lata","1 week":"1 tydzie\u0144","@count weeks":"@count tygodnie","1 min":"1 min","@count min":"@count minuty","1 sec":"1 sekunda","@count sec":"@count sekundy","1 month":"1 miesi\u0105c","@count months":"@count miesi\u0105ce","Only files with the following extensions are allowed: %files-allowed.":"Dozwolone s\u0105 jedynie pliki o nast\u0119puj\u0105cych rozszerzeniach: %files-allowed.","By @name on @date":"Przez @name w @date","By @name":"Przez @name","Not in menu":"Nie ma w menu","Alias: @alias":"Alias: @alias","No alias":"Brak aliasu","0 sec":"0 sek","New revision":"Nowa wersja","Drag to re-order":"Chwy\u0107, by zmieni\u0107 kolejno\u015b\u0107","Changes made in this table will not be saved until the form is submitted.":"Zmiany wprowadzone w tabeli zachowuje si\u0119 przyciskiem u do\u0142u formularza.","The changes to these blocks will not be saved until the \u003Cem\u003ESave blocks\u003C\/em\u003E button is clicked.":"Zmiany wprowadzone w blokach zachowuje si\u0119 przyciskiem u do\u0142u formularza.","Region settings":"Ustawienia regionu","This permission is inherited from the authenticated user role.":"Te uprawnienia s\u0105 dziedziczone wed\u0142ug roli zalogowanego u\u017cytkownika.","No revision":"Brak wersji","@number comments per page":"@number komentarzy na stronie","Requires a title":"Tytu\u0142 wymagany","Not restricted":"Bez ogranicze\u0144","(active tab)":"(aktywna karta)","Not customizable":"Niekonfigurowalne","Restricted to certain pages":"Ograniczenie do okre\u015blonych stron.","The block cannot be placed in this region.":"Blok nie mo\u017ce by\u0107 umieszczony w tym regionie.","Customize dashboard":"Dostosuj kokpit","Hide summary":"Ukryj podsumowanie","Edit summary":"Edycja podsumowania","Don\u0027t display post information":"Ukrycie informacji o wpisie","@title dialog":"@title dialog","The selected file %filename cannot be uploaded. Only files with the following extensions are allowed: %extensions.":"Wybrany plik %filename nie m\u00f3g\u0142 zosta\u0107 wys\u0142any. Dozwolone s\u0105 jedynie nast\u0119puj\u0105ce rozszerzenia: %extensions.","Re-order rows by numerical weight instead of dragging.":"Zmie\u0144 kolejno\u015b\u0107 wierszy podaj\u0105c warto\u015bci numeryczne zamiast przeci\u0105gaj\u0105c.","Show row weights":"Poka\u017c wagi wierszy","Hide row weights":"Ukryj wagi wierszy","Autocomplete popup":"Okienko autouzupe\u0142niania","Searching for matches...":"Wyszukiwanie pasuj\u0105cych...","The callback URL is not local and not trusted: !url":"Adres URL wywo\u0142ania zwrotnego nie jest lokalny i nie mo\u017cna uzna\u0107 go za zaufany: !url","Please select a file.":"Prosz\u0119 wybra\u0107 plik.","You are not allowed to operate on more than %num files.":"Nie s\u0105 dozwolone czynno\u015bci na wi\u0119cej ni\u017c %num plikach.","Please specify dimensions within the allowed range that is from 1x1 to @dimensions.":"Okre\u015bl wymiary w dopuszczalnym zakresie od 1x1 do @dimensions.","%filename is not an image.":"%filename nie jest obrazkiem.","Insert file":"Wstaw plik","Change view":"Zmie\u0144 widok","Show description":"Wy\u015bwietl opis","Hide description":"Ukryj opis","Layout settings":"Ustawienia widoku","Submit":"Zachowaj","Add file":"Dodaj plik","Select":"Wybierz","Automatic alias":"Alias automatyczny","Remove group":"Usu\u0144 grup\u0119","Apply (all displays)":"Zastosuj (wszystkie formaty)","Apply (this display)":"Zastosuj (ten format)","Revert to default":"Przywr\u00f3\u0107 domy\u015blne","Media browser":"Przegl\u0105darka plik\u00f3w","The response failed verification so will not be processed.":"Odpowied\u017a nie zosta\u0142a zweryfikowana zatem nie zostanie przetworzona.","You can not perform this operation.":"Nie mo\u017cesz wykona\u0107 tej operacji.","Do you want to refresh the current directory?":"Czy chcesz od\u015bwie\u017cy\u0107 zawarto\u015b\u0107 bie\u017c\u0105cego katalogu?","Delete selected files?":"Usun\u0105\u0107 wybrane pliki?","Please select a thumbnail.":"Wybierz miniaturk\u0119.","Log messages":"Loguj wiadomo\u015bci","You must select at least %num files.":"Musisz wybra\u0107 co najmniej %num plik\u00f3w.","Inclusion: @value":"Do\u0142\u0105czenie: @value","Priority: @value":"Priorytet: @value"}} };; /* $Id: lightbox.js,v 1.5.2.6.2.136 2010/09/24 08:39:40 snpower Exp $ */ /** * jQuery Lightbox * @author * Stella Power, * * Based on Lightbox v2.03.3 by Lokesh Dhakar * * Also partially based on the jQuery Lightbox by Warren Krewenki * * * Permission has been granted to Mark Ashmead & other Drupal Lightbox2 module * maintainers to distribute this file via Drupal.org * Under GPL license. * * Slideshow, iframe and video functionality added by Stella Power. */ var Lightbox; (function($) { Lightbox = { auto_modal : false, overlayOpacity : 0.8, // Controls transparency of shadow overlay. overlayColor : '000', // Controls colour of shadow overlay. disableCloseClick : true, // Controls the order of the lightbox resizing animation sequence. resizeSequence: 0, // 0: simultaneous, 1: width then height, 2: height then width. resizeSpeed: 'normal', // Controls the speed of the lightbox resizing animation. fadeInSpeed: 'normal', // Controls the speed of the image appearance. slideDownSpeed: 'slow', // Controls the speed of the image details appearance. minWidth: 240, borderSize : 10, boxColor : 'fff', fontColor : '000', topPosition : '', infoHeight: 20, alternative_layout : false, imageArray : [], imageNum : null, total : 0, activeImage : null, inprogress : false, disableResize : false, disableZoom : false, isZoomedIn : false, rtl : false, loopItems : false, keysClose : ['c', 'x', 27], keysPrevious : ['p', 37], keysNext : ['n', 39], keysZoom : ['z'], keysPlayPause : [32], // Slideshow options. slideInterval : 5000, // In milliseconds. showPlayPause : true, autoStart : true, autoExit : true, pauseOnNextClick : false, // True to pause the slideshow when the "Next" button is clicked. pauseOnPrevClick : true, // True to pause the slideshow when the "Prev" button is clicked. slideIdArray : [], slideIdCount : 0, isSlideshow : false, isPaused : false, loopSlides : false, // Iframe options. isLightframe : false, iframe_width : 600, iframe_height : 400, iframe_border : 1, // Video and modal options. enableVideo : false, flvPlayer : '/flvplayer.swf', flvFlashvars : '', isModal : false, isVideo : false, videoId : false, modalWidth : 400, modalHeight : 400, modalHTML : null, // initialize() // Constructor runs on completion of the DOM loading. // The function inserts html at the bottom of the page which is used // to display the shadow overlay and the image container. initialize: function() { var s = Drupal.settings.lightbox2; Lightbox.overlayOpacity = s.overlay_opacity; Lightbox.overlayColor = s.overlay_color; Lightbox.disableCloseClick = s.disable_close_click; Lightbox.resizeSequence = s.resize_sequence; Lightbox.resizeSpeed = s.resize_speed; Lightbox.fadeInSpeed = s.fade_in_speed; Lightbox.slideDownSpeed = s.slide_down_speed; Lightbox.borderSize = s.border_size; Lightbox.boxColor = s.box_color; Lightbox.fontColor = s.font_color; Lightbox.topPosition = s.top_position; Lightbox.rtl = s.rtl; Lightbox.loopItems = s.loop_items; Lightbox.keysClose = s.keys_close.split(" "); Lightbox.keysPrevious = s.keys_previous.split(" "); Lightbox.keysNext = s.keys_next.split(" "); Lightbox.keysZoom = s.keys_zoom.split(" "); Lightbox.keysPlayPause = s.keys_play_pause.split(" "); Lightbox.disableResize = s.disable_resize; Lightbox.disableZoom = s.disable_zoom; Lightbox.slideInterval = s.slideshow_interval; Lightbox.showPlayPause = s.show_play_pause; Lightbox.showCaption = s.show_caption; Lightbox.autoStart = s.slideshow_automatic_start; Lightbox.autoExit = s.slideshow_automatic_exit; Lightbox.pauseOnNextClick = s.pause_on_next_click; Lightbox.pauseOnPrevClick = s.pause_on_previous_click; Lightbox.loopSlides = s.loop_slides; Lightbox.alternative_layout = s.use_alt_layout; Lightbox.iframe_width = s.iframe_width; Lightbox.iframe_height = s.iframe_height; Lightbox.iframe_border = s.iframe_border; Lightbox.enableVideo = s.enable_video; if (s.enable_video) { Lightbox.flvPlayer = s.flvPlayer; Lightbox.flvFlashvars = s.flvFlashvars; } // Make the lightbox divs. var layout_class = (s.use_alt_layout ? 'lightbox2-alt-layout' : 'lightbox2-orig-layout'); var output = '\ '; var loading = '
'; var modal = ''; var frame = ''; var imageContainer = ''; var details = '
'; var bottomNav = '
'; var image = ''; var hoverNav = '
'; var frameNav = '
'; var hoverNav = '
'; var frameNav = '
'; var caption = ''; var numberDisplay = ''; var close = ''; var zoom = ''; var zoomOut = ''; var pause = ''; var play = ''; $("body").append(output); $('#outerImageContainer').append(modal + frame + imageContainer + loading); if (!s.use_alt_layout) { $('#imageContainer').append(image + hoverNav); $('#imageData').append(details + bottomNav); $('#imageDetails').append(caption + numberDisplay); $('#bottomNav').append(frameNav + close + zoom + zoomOut + pause + play); } else { $('#outerImageContainer').append(bottomNav); $('#imageContainer').append(image); $('#bottomNav').append(close + zoom + zoomOut); $('#imageData').append(hoverNav + details); $('#imageDetails').append(caption + numberDisplay + pause + play); } // Setup onclick handlers. if (Lightbox.disableCloseClick) { $('#lightbox2-overlay').click(function() { Lightbox.end(); return false; } ).hide(); } $('#loadingLink, #bottomNavClose').click(function() { Lightbox.end('forceClose'); return false; } ); $('#prevLink, #framePrevLink').click(function() { Lightbox.changeData(Lightbox.activeImage - 1); return false; } ); $('#nextLink, #frameNextLink').click(function() { Lightbox.changeData(Lightbox.activeImage + 1); return false; } ); $('#bottomNavZoom').click(function() { Lightbox.changeData(Lightbox.activeImage, true); return false; } ); $('#bottomNavZoomOut').click(function() { Lightbox.changeData(Lightbox.activeImage, false); return false; } ); $('#lightshowPause').click(function() { Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); return false; } ); $('#lightshowPlay').click(function() { Lightbox.togglePlayPause("lightshowPlay", "lightshowPause"); return false; } ); // Fix positioning. $('#prevLink, #nextLink, #framePrevLink, #frameNextLink').css({ 'paddingTop': Lightbox.borderSize + 'px'}); $('#imageContainer, #frameContainer, #modalContainer').css({ 'padding': Lightbox.borderSize + 'px'}); $('#outerImageContainer, #imageDataContainer, #bottomNavClose').css({'backgroundColor': '#' + Lightbox.boxColor, 'color': '#'+Lightbox.fontColor}); if (Lightbox.alternative_layout) { $('#bottomNavZoom, #bottomNavZoomOut').css({'bottom': Lightbox.borderSize + 'px', 'right': Lightbox.borderSize + 'px'}); } else if (Lightbox.rtl == 1 && Drupal.settings.lightbox2.useragent.search('MSIE') !== -1) { $('#bottomNavZoom, #bottomNavZoomOut').css({'left': '0px'}); } // Force navigation links to always be displayed if (s.force_show_nav) { $('#prevLink, #nextLink').addClass("force_show_nav"); } }, // initList() // Loops through anchor tags looking for 'lightbox', 'lightshow' and // 'lightframe', etc, references and applies onclick events to appropriate // links. You can rerun after dynamically adding images w/ajax. initList : function(context) { if (context == undefined || context == null) { context = document; } // Attach lightbox to any links with rel 'lightbox', 'lightshow' or // 'lightframe', etc. $("a[rel^='lightbox']:not(.lightbox-processed), area[rel^='lightbox']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { if (Lightbox.disableCloseClick) { $('#lightbox').unbind('click'); $('#lightbox').click(function() { Lightbox.end('forceClose'); } ); } Lightbox.start(this, false, false, false, false); if (e.preventDefault) { e.preventDefault(); } return false; }); $("a[rel^='lightshow']:not(.lightbox-processed), area[rel^='lightshow']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { if (Lightbox.disableCloseClick) { $('#lightbox').unbind('click'); $('#lightbox').click(function() { Lightbox.end('forceClose'); } ); } Lightbox.start(this, true, false, false, false); if (e.preventDefault) { e.preventDefault(); } return false; }); $("a[rel^='lightframe']:not(.lightbox-processed), area[rel^='lightframe']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { if (Lightbox.disableCloseClick) { $('#lightbox').unbind('click'); $('#lightbox').click(function() { Lightbox.end('forceClose'); } ); } Lightbox.start(this, false, true, false, false); if (e.preventDefault) { e.preventDefault(); } return false; }); if (Lightbox.enableVideo) { $("a[rel^='lightvideo']:not(.lightbox-processed), area[rel^='lightvideo']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { if (Lightbox.disableCloseClick) { $('#lightbox').unbind('click'); $('#lightbox').click(function() { Lightbox.end('forceClose'); } ); } Lightbox.start(this, false, false, true, false); if (e.preventDefault) { e.preventDefault(); } return false; }); } $("a[rel^='lightmodal']:not(.lightbox-processed), area[rel^='lightmodal']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { $('#lightbox').unbind('click'); // Add classes from the link to the lightbox div - don't include lightbox-processed $('#lightbox').addClass($(this).attr('class')); $('#lightbox').removeClass('lightbox-processed'); Lightbox.start(this, false, false, false, true); if (e.preventDefault) { e.preventDefault(); } return false; }); $("#lightboxAutoModal:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { Lightbox.auto_modal = true; $('#lightbox').unbind('click'); Lightbox.start(this, false, false, false, true); if (e.preventDefault) { e.preventDefault(); } return false; }); }, // start() // Display overlay and lightbox. If image is part of a set, add siblings to // imageArray. start: function(imageLink, slideshow, lightframe, lightvideo, lightmodal) { Lightbox.isPaused = !Lightbox.autoStart; // Replaces hideSelectBoxes() and hideFlash() calls in original lightbox2. Lightbox.toggleSelectsFlash('hide'); // Stretch overlay to fill page and fade in. var arrayPageSize = Lightbox.getPageSize(); $("#lightbox2-overlay").hide().css({ 'width': '100%', 'zIndex': '10090', 'height': arrayPageSize[1] + 'px', 'backgroundColor' : '#' + Lightbox.overlayColor }); // Detect OS X FF2 opacity + flash issue. if (lightvideo && this.detectMacFF2()) { $("#lightbox2-overlay").removeClass("overlay_default"); $("#lightbox2-overlay").addClass("overlay_macff2"); $("#lightbox2-overlay").css({'opacity' : null}); } else { $("#lightbox2-overlay").removeClass("overlay_macff2"); $("#lightbox2-overlay").addClass("overlay_default"); $("#lightbox2-overlay").css({'opacity' : Lightbox.overlayOpacity}); } $("#lightbox2-overlay").fadeIn(Lightbox.fadeInSpeed); Lightbox.isSlideshow = slideshow; Lightbox.isLightframe = lightframe; Lightbox.isVideo = lightvideo; Lightbox.isModal = lightmodal; Lightbox.imageArray = []; Lightbox.imageNum = 0; var anchors = $(imageLink.tagName); var anchor = null; var rel_parts = Lightbox.parseRel(imageLink); var rel = rel_parts["rel"]; var rel_group = rel_parts["group"]; var title = (rel_parts["title"] ? rel_parts["title"] : imageLink.title); var rel_style = null; var i = 0; if (rel_parts["flashvars"]) { Lightbox.flvFlashvars = Lightbox.flvFlashvars + '&' + rel_parts["flashvars"]; } // Set the title for image alternative text. var alt = imageLink.title; if (!alt) { var img = $(imageLink).find("img"); if (img && $(img).attr("alt")) { alt = $(img).attr("alt"); } else { alt = title; } } if ($(imageLink).attr('id') == 'lightboxAutoModal') { rel_style = rel_parts["style"]; Lightbox.imageArray.push(['#lightboxAutoModal > *', title, alt, rel_style, 1]); } else { // Handle lightbox images with no grouping. if ((rel == 'lightbox' || rel == 'lightshow') && !rel_group) { Lightbox.imageArray.push([imageLink.href, title, alt]); } // Handle other items with no grouping. else if (!rel_group) { rel_style = rel_parts["style"]; Lightbox.imageArray.push([imageLink.href, title, alt, rel_style]); } // Handle grouped items. else { // Loop through anchors and add them to imageArray. for (i = 0; i < anchors.length; i++) { anchor = anchors[i]; if (anchor.href && typeof(anchor.href) == "string" && $(anchor).attr('rel')) { var rel_data = Lightbox.parseRel(anchor); var anchor_title = (rel_data["title"] ? rel_data["title"] : anchor.title); img_alt = anchor.title; if (!img_alt) { var anchor_img = $(anchor).find("img"); if (anchor_img && $(anchor_img).attr("alt")) { img_alt = $(anchor_img).attr("alt"); } else { img_alt = title; } } if (rel_data["rel"] == rel) { if (rel_data["group"] == rel_group) { if (Lightbox.isLightframe || Lightbox.isModal || Lightbox.isVideo) { rel_style = rel_data["style"]; } Lightbox.imageArray.push([anchor.href, anchor_title, img_alt, rel_style]); } } } } // Remove duplicates. for (i = 0; i < Lightbox.imageArray.length; i++) { for (j = Lightbox.imageArray.length-1; j > i; j--) { if (Lightbox.imageArray[i][0] == Lightbox.imageArray[j][0]) { Lightbox.imageArray.splice(j,1); } } } while (Lightbox.imageArray[Lightbox.imageNum][0] != imageLink.href) { Lightbox.imageNum++; } } } if (Lightbox.isSlideshow && Lightbox.showPlayPause && Lightbox.isPaused) { $('#lightshowPlay').show(); $('#lightshowPause').hide(); } // Calculate top and left offset for the lightbox. var arrayPageScroll = Lightbox.getPageScroll(); var lightboxTop = arrayPageScroll[1] + (Lightbox.topPosition == '' ? (arrayPageSize[3] / 10) : Lightbox.topPosition) * 1; var lightboxLeft = arrayPageScroll[0]; $('#frameContainer, #modalContainer, #lightboxImage').hide(); $('#hoverNav, #prevLink, #nextLink, #frameHoverNav, #framePrevLink, #frameNextLink').hide(); $('#imageDataContainer, #numberDisplay, #bottomNavZoom, #bottomNavZoomOut').hide(); $('#outerImageContainer').css({'width': '250px', 'height': '250px'}); $('#lightbox').css({ 'zIndex': '10500', 'top': lightboxTop + 'px', 'left': lightboxLeft + 'px' }).show(); Lightbox.total = Lightbox.imageArray.length; Lightbox.changeData(Lightbox.imageNum); }, // changeData() // Hide most elements and preload image in preparation for resizing image // container. changeData: function(imageNum, zoomIn) { if (Lightbox.inprogress === false) { if (Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) { if (imageNum >= Lightbox.total) imageNum = 0; if (imageNum < 0) imageNum = Lightbox.total - 1; } if (Lightbox.isSlideshow) { for (var i = 0; i < Lightbox.slideIdCount; i++) { window.clearTimeout(Lightbox.slideIdArray[i]); } } Lightbox.inprogress = true; Lightbox.activeImage = imageNum; if (Lightbox.disableResize && !Lightbox.isSlideshow) { zoomIn = true; } Lightbox.isZoomedIn = zoomIn; // Hide elements during transition. $('#loading').css({'zIndex': '10500'}).show(); if (!Lightbox.alternative_layout) { $('#imageContainer').hide(); } $('#frameContainer, #modalContainer, #lightboxImage').hide(); $('#hoverNav, #prevLink, #nextLink, #frameHoverNav, #framePrevLink, #frameNextLink').hide(); $('#imageDataContainer, #numberDisplay, #bottomNavZoom, #bottomNavZoomOut').hide(); // Preload image content, but not iframe pages. if (!Lightbox.isLightframe && !Lightbox.isVideo && !Lightbox.isModal) { $("#lightbox #imageDataContainer").removeClass('lightbox2-alt-layout-data'); imgPreloader = new Image(); imgPreloader.onerror = function() { Lightbox.imgNodeLoadingError(this); }; imgPreloader.onload = function() { var photo = document.getElementById('lightboxImage'); photo.src = Lightbox.imageArray[Lightbox.activeImage][0]; photo.alt = Lightbox.imageArray[Lightbox.activeImage][2]; var imageWidth = imgPreloader.width; var imageHeight = imgPreloader.height; // Resize code. var arrayPageSize = Lightbox.getPageSize(); var targ = { w:arrayPageSize[2] - (Lightbox.borderSize * 2), h:arrayPageSize[3] - (Lightbox.borderSize * 6) - (Lightbox.infoHeight * 4) - (arrayPageSize[3] / 10) }; var orig = { w:imgPreloader.width, h:imgPreloader.height }; // Image is very large, so show a smaller version of the larger image // with zoom button. if (zoomIn !== true) { var ratio = 1.0; // Shrink image with the same aspect. $('#bottomNavZoomOut, #bottomNavZoom').hide(); if ((orig.w >= targ.w || orig.h >= targ.h) && orig.h && orig.w) { ratio = ((targ.w / orig.w) < (targ.h / orig.h)) ? targ.w / orig.w : targ.h / orig.h; if (!Lightbox.disableZoom && !Lightbox.isSlideshow) { $('#bottomNavZoom').css({'zIndex': '10500'}).show(); } } imageWidth = Math.floor(orig.w * ratio); imageHeight = Math.floor(orig.h * ratio); } else { $('#bottomNavZoom').hide(); // Only display zoom out button if the image is zoomed in already. if ((orig.w >= targ.w || orig.h >= targ.h) && orig.h && orig.w) { // Only display zoom out button if not a slideshow and if the // buttons aren't disabled. if (!Lightbox.disableResize && Lightbox.isSlideshow === false && !Lightbox.disableZoom) { $('#bottomNavZoomOut').css({'zIndex': '10500'}).show(); } } } photo.style.width = (imageWidth) + 'px'; photo.style.height = (imageHeight) + 'px'; Lightbox.resizeContainer(imageWidth, imageHeight); // Clear onLoad, IE behaves irratically with animated gifs otherwise. imgPreloader.onload = function() {}; }; imgPreloader.src = Lightbox.imageArray[Lightbox.activeImage][0]; imgPreloader.alt = Lightbox.imageArray[Lightbox.activeImage][2]; } // Set up frame size, etc. else if (Lightbox.isLightframe) { $("#lightbox #imageDataContainer").addClass('lightbox2-alt-layout-data'); var src = Lightbox.imageArray[Lightbox.activeImage][0]; $('#frameContainer').html(''); // Enable swf support in Gecko browsers. if (Drupal.settings.lightbox2.useragent.search('Mozilla') !== -1 && src.indexOf('.swf') != -1) { setTimeout(function () { document.getElementById("lightboxFrame").src = Lightbox.imageArray[Lightbox.activeImage][0]; }, 1000); } if (!Lightbox.iframe_border) { $('#lightboxFrame').css({'border': 'none'}); $('#lightboxFrame').attr('frameborder', '0'); } var iframe = document.getElementById('lightboxFrame'); var iframeStyles = Lightbox.imageArray[Lightbox.activeImage][3]; iframe = Lightbox.setStyles(iframe, iframeStyles); Lightbox.resizeContainer(parseInt(iframe.width, 10), parseInt(iframe.height, 10)); } else if (Lightbox.isVideo || Lightbox.isModal) { $("#lightbox #imageDataContainer").addClass('lightbox2-alt-layout-data'); var container = document.getElementById('modalContainer'); var modalStyles = Lightbox.imageArray[Lightbox.activeImage][3]; container = Lightbox.setStyles(container, modalStyles); if (Lightbox.isVideo) { Lightbox.modalHeight = parseInt(container.height, 10) - 10; Lightbox.modalWidth = parseInt(container.width, 10) - 10; Lightvideo.startVideo(Lightbox.imageArray[Lightbox.activeImage][0]); } Lightbox.resizeContainer(parseInt(container.width, 10), parseInt(container.height, 10)); } } }, // imgNodeLoadingError() imgNodeLoadingError: function(image) { var s = Drupal.settings.lightbox2; var original_image = Lightbox.imageArray[Lightbox.activeImage][0]; if (s.display_image_size !== "") { original_image = original_image.replace(new RegExp("."+s.display_image_size), ""); } Lightbox.imageArray[Lightbox.activeImage][0] = original_image; image.onerror = function() { Lightbox.imgLoadingError(image); }; image.src = original_image; }, // imgLoadingError() imgLoadingError: function(image) { var s = Drupal.settings.lightbox2; Lightbox.imageArray[Lightbox.activeImage][0] = s.default_image; image.src = s.default_image; }, // resizeContainer() resizeContainer: function(imgWidth, imgHeight) { imgWidth = (imgWidth < Lightbox.minWidth ? Lightbox.minWidth : imgWidth); this.widthCurrent = $('#outerImageContainer').width(); this.heightCurrent = $('#outerImageContainer').height(); var widthNew = (imgWidth + (Lightbox.borderSize * 2)); var heightNew = (imgHeight + (Lightbox.borderSize * 2)); // Scalars based on change from old to new. this.xScale = ( widthNew / this.widthCurrent) * 100; this.yScale = ( heightNew / this.heightCurrent) * 100; // Calculate size difference between new and old image, and resize if // necessary. wDiff = this.widthCurrent - widthNew; hDiff = this.heightCurrent - heightNew; $('#modalContainer').css({'width': imgWidth, 'height': imgHeight}); // Detect animation sequence. if (Lightbox.resizeSequence) { var animate1 = {width: widthNew}; var animate2 = {height: heightNew}; if (Lightbox.resizeSequence == 2) { animate1 = {height: heightNew}; animate2 = {width: widthNew}; } $('#outerImageContainer').animate(animate1, Lightbox.resizeSpeed).animate(animate2, Lightbox.resizeSpeed, 'linear', function() { Lightbox.showData(); }); } // Simultaneous. else { $('#outerImageContainer').animate({'width': widthNew, 'height': heightNew}, Lightbox.resizeSpeed, 'linear', function() { Lightbox.showData(); }); } // If new and old image are same size and no scaling transition is necessary // do a quick pause to prevent image flicker. if ((hDiff === 0) && (wDiff === 0)) { if (Drupal.settings.lightbox2.useragent.search('MSIE') !== -1) { Lightbox.pause(250); } else { Lightbox.pause(100); } } var s = Drupal.settings.lightbox2; if (!s.use_alt_layout) { $('#prevLink, #nextLink').css({'height': imgHeight + 'px'}); } $('#imageDataContainer').css({'width': widthNew + 'px'}); }, // showData() // Display image and begin preloading neighbors. showData: function() { $('#loading').hide(); if (Lightbox.isLightframe || Lightbox.isVideo || Lightbox.isModal) { Lightbox.updateDetails(); if (Lightbox.isLightframe) { $('#frameContainer').show(); if (Drupal.settings.lightbox2.useragent.search('Safari') !== -1 || Lightbox.fadeInSpeed === 0) { $('#lightboxFrame').css({'zIndex': '10500'}).show(); } else { $('#lightboxFrame').css({'zIndex': '10500'}).fadeIn(Lightbox.fadeInSpeed); } } else { if (Lightbox.isVideo) { $("#modalContainer").html(Lightbox.modalHTML).click(function(){return false;}).css('zIndex', '10500').show(); } else { var src = unescape(Lightbox.imageArray[Lightbox.activeImage][0]); if (Lightbox.imageArray[Lightbox.activeImage][4]) { $(src).appendTo("#modalContainer"); $('#modalContainer').css({'zIndex': '10500'}).show(); } else { // Use a callback to show the new image, otherwise you get flicker. $("#modalContainer").hide().load(src, function () {$('#modalContainer').css({'zIndex': '10500'}).show();}); } $('#modalContainer').unbind('click'); } // This might be needed in the Lightframe section above. //$('#modalContainer').css({'zIndex': '10500'}).show(); } } // Handle display of image content. else { $('#imageContainer').show(); if (Drupal.settings.lightbox2.useragent.search('Safari') !== -1 || Lightbox.fadeInSpeed === 0) { $('#lightboxImage').css({'zIndex': '10500'}).show(); } else { $('#lightboxImage').css({'zIndex': '10500'}).fadeIn(Lightbox.fadeInSpeed); } Lightbox.updateDetails(); this.preloadNeighborImages(); } Lightbox.inprogress = false; // Slideshow specific stuff. if (Lightbox.isSlideshow) { if (!Lightbox.loopSlides && Lightbox.activeImage == (Lightbox.total - 1)) { if (Lightbox.autoExit) { Lightbox.slideIdArray[Lightbox.slideIdCount++] = setTimeout(function () {Lightbox.end('slideshow');}, Lightbox.slideInterval); } } else { if (!Lightbox.isPaused && Lightbox.total > 1) { Lightbox.slideIdArray[Lightbox.slideIdCount++] = setTimeout(function () {Lightbox.changeData(Lightbox.activeImage + 1);}, Lightbox.slideInterval); } } if (Lightbox.showPlayPause && Lightbox.total > 1 && !Lightbox.isPaused) { $('#lightshowPause').show(); $('#lightshowPlay').hide(); } else if (Lightbox.showPlayPause && Lightbox.total > 1) { $('#lightshowPause').hide(); $('#lightshowPlay').show(); } } // Adjust the page overlay size. var arrayPageSize = Lightbox.getPageSize(); var arrayPageScroll = Lightbox.getPageScroll(); var pageHeight = arrayPageSize[1]; if (Lightbox.isZoomedIn && arrayPageSize[1] > arrayPageSize[3]) { var lightboxTop = (Lightbox.topPosition == '' ? (arrayPageSize[3] / 10) : Lightbox.topPosition) * 1; pageHeight = pageHeight + arrayPageScroll[1] + lightboxTop; } $('#lightbox2-overlay').css({'height': pageHeight + 'px', 'width': arrayPageSize[0] + 'px'}); // Gecko browsers (e.g. Firefox, SeaMonkey, etc) don't handle pdfs as // expected. if (Drupal.settings.lightbox2.useragent.search('Mozilla') !== -1) { if (Lightbox.imageArray[Lightbox.activeImage][0].indexOf(".pdf") != -1) { setTimeout(function () { document.getElementById("lightboxFrame").src = Lightbox.imageArray[Lightbox.activeImage][0]; }, 1000); } } }, // updateDetails() // Display caption, image number, and bottom nav. updateDetails: function() { $("#imageDataContainer").hide(); var s = Drupal.settings.lightbox2; if (s.show_caption) { var caption = Lightbox.filterXSS(Lightbox.imageArray[Lightbox.activeImage][1]); if (!caption) caption = ''; $('#caption').html(caption).css({'zIndex': '10500'}).show(); } // If image is part of set display 'Image x of x'. var numberDisplay = null; if (s.image_count && Lightbox.total > 1) { var currentImage = Lightbox.activeImage + 1; if (!Lightbox.isLightframe && !Lightbox.isModal && !Lightbox.isVideo) { numberDisplay = s.image_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total); } else if (Lightbox.isVideo) { numberDisplay = s.video_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total); } else { numberDisplay = s.page_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total); } $('#numberDisplay').html(numberDisplay).css({'zIndex': '10500'}).show(); } else { $('#numberDisplay').hide(); } $("#imageDataContainer").hide().slideDown(Lightbox.slideDownSpeed, function() { $("#bottomNav").show(); }); if (Lightbox.rtl == 1) { $("#bottomNav").css({'float': 'left'}); } Lightbox.updateNav(); }, // updateNav() // Display appropriate previous and next hover navigation. updateNav: function() { $('#hoverNav').css({'zIndex': '10500'}).show(); var prevLink = '#prevLink'; var nextLink = '#nextLink'; // Slideshow is separated as we need to show play / pause button. if (Lightbox.isSlideshow) { if ((Lightbox.total > 1 && Lightbox.loopSlides) || Lightbox.activeImage !== 0) { $(prevLink).css({'zIndex': '10500'}).show().click(function() { if (Lightbox.pauseOnPrevClick) { Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); } Lightbox.changeData(Lightbox.activeImage - 1); return false; }); } else { $(prevLink).hide(); } // If not last image in set, display next image button. if ((Lightbox.total > 1 && Lightbox.loopSlides) || Lightbox.activeImage != (Lightbox.total - 1)) { $(nextLink).css({'zIndex': '10500'}).show().click(function() { if (Lightbox.pauseOnNextClick) { Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); } Lightbox.changeData(Lightbox.activeImage + 1); return false; }); } // Safari browsers need to have hide() called again. else { $(nextLink).hide(); } } // All other types of content. else { if ((Lightbox.isLightframe || Lightbox.isModal || Lightbox.isVideo) && !Lightbox.alternative_layout) { $('#frameHoverNav').css({'zIndex': '10500'}).show(); $('#hoverNav').css({'zIndex': '10500'}).hide(); prevLink = '#framePrevLink'; nextLink = '#frameNextLink'; } // If not first image in set, display prev image button. if ((Lightbox.total > 1 && Lightbox.loopItems) || Lightbox.activeImage !== 0) { // Unbind any other click handlers, otherwise this adds a new click handler // each time the arrow is clicked. $(prevLink).css({'zIndex': '10500'}).show().unbind().click(function() { Lightbox.changeData(Lightbox.activeImage - 1); return false; }); } // Safari browsers need to have hide() called again. else { $(prevLink).hide(); } // If not last image in set, display next image button. if ((Lightbox.total > 1 && Lightbox.loopItems) || Lightbox.activeImage != (Lightbox.total - 1)) { // Unbind any other click handlers, otherwise this adds a new click handler // each time the arrow is clicked. $(nextLink).css({'zIndex': '10500'}).show().unbind().click(function() { Lightbox.changeData(Lightbox.activeImage + 1); return false; }); } // Safari browsers need to have hide() called again. else { $(nextLink).hide(); } } // Don't enable keyboard shortcuts so forms will work. if (!Lightbox.isModal) { this.enableKeyboardNav(); } }, // enableKeyboardNav() enableKeyboardNav: function() { $(document).bind("keydown", this.keyboardAction); }, // disableKeyboardNav() disableKeyboardNav: function() { $(document).unbind("keydown", this.keyboardAction); }, // keyboardAction() keyboardAction: function(e) { if (e === null) { // IE. keycode = event.keyCode; escapeKey = 27; } else { // Mozilla. keycode = e.keyCode; escapeKey = e.DOM_VK_ESCAPE; } key = String.fromCharCode(keycode).toLowerCase(); // Close lightbox. if (Lightbox.checkKey(Lightbox.keysClose, key, keycode)) { Lightbox.end('forceClose'); } // Display previous image (p, <-). else if (Lightbox.checkKey(Lightbox.keysPrevious, key, keycode)) { if ((Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) || Lightbox.activeImage !== 0) { Lightbox.changeData(Lightbox.activeImage - 1); } } // Display next image (n, ->). else if (Lightbox.checkKey(Lightbox.keysNext, key, keycode)) { if ((Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) || Lightbox.activeImage != (Lightbox.total - 1)) { Lightbox.changeData(Lightbox.activeImage + 1); } } // Zoom in. else if (Lightbox.checkKey(Lightbox.keysZoom, key, keycode) && !Lightbox.disableResize && !Lightbox.disableZoom && !Lightbox.isSlideshow && !Lightbox.isLightframe) { if (Lightbox.isZoomedIn) { Lightbox.changeData(Lightbox.activeImage, false); } else if (!Lightbox.isZoomedIn) { Lightbox.changeData(Lightbox.activeImage, true); } return false; } // Toggle play / pause (space). else if (Lightbox.checkKey(Lightbox.keysPlayPause, key, keycode) && Lightbox.isSlideshow) { if (Lightbox.isPaused) { Lightbox.togglePlayPause("lightshowPlay", "lightshowPause"); } else { Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); } return false; } }, preloadNeighborImages: function() { if ((Lightbox.total - 1) > Lightbox.activeImage) { preloadNextImage = new Image(); preloadNextImage.src = Lightbox.imageArray[Lightbox.activeImage + 1][0]; } if (Lightbox.activeImage > 0) { preloadPrevImage = new Image(); preloadPrevImage.src = Lightbox.imageArray[Lightbox.activeImage - 1][0]; } }, end: function(caller) { var closeClick = (caller == 'slideshow' ? false : true); if (Lightbox.isSlideshow && Lightbox.isPaused && !closeClick) { return; } // To prevent double clicks on navigation links. if (Lightbox.inprogress === true && caller != 'forceClose') { return; } Lightbox.disableKeyboardNav(); $('#lightbox').hide(); $("#lightbox2-overlay").fadeOut(); Lightbox.isPaused = true; Lightbox.inprogress = false; Lightbox.imageArray = []; Lightbox.imageNum = 0; // Replaces calls to showSelectBoxes() and showFlash() in original // lightbox2. Lightbox.toggleSelectsFlash('visible'); if (Lightbox.isSlideshow) { for (var i = 0; i < Lightbox.slideIdCount; i++) { window.clearTimeout(Lightbox.slideIdArray[i]); } $('#lightshowPause, #lightshowPlay').hide(); } else if (Lightbox.isLightframe) { $('#frameContainer').empty().hide(); } else if (Lightbox.isVideo || Lightbox.isModal) { if (!Lightbox.auto_modal) { $('#modalContainer').hide().html(""); } Lightbox.auto_modal = false; } }, // getPageScroll() // Returns array with x,y page scroll values. // Core code from - quirksmode.com. getPageScroll : function() { var xScroll, yScroll; if (self.pageYOffset || self.pageXOffset) { yScroll = self.pageYOffset; xScroll = self.pageXOffset; } else if (document.documentElement && (document.documentElement.scrollTop || document.documentElement.scrollLeft)) { // Explorer 6 Strict. yScroll = document.documentElement.scrollTop; xScroll = document.documentElement.scrollLeft; } else if (document.body) {// All other Explorers. yScroll = document.body.scrollTop; xScroll = document.body.scrollLeft; } arrayPageScroll = [xScroll,yScroll]; return arrayPageScroll; }, // getPageSize() // Returns array with page width, height and window width, height. // Core code from - quirksmode.com. // Edit for Firefox by pHaez. getPageSize : function() { var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = window.innerWidth + window.scrollMaxX; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight) { // All but Explorer Mac. xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari. xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; } var windowWidth, windowHeight; if (self.innerHeight) { // All except Explorer. if (document.documentElement.clientWidth) { windowWidth = document.documentElement.clientWidth; } else { windowWidth = self.innerWidth; } windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode. windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { // Other Explorers. windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } // For small pages with total height less than height of the viewport. if (yScroll < windowHeight) { pageHeight = windowHeight; } else { pageHeight = yScroll; } // For small pages with total width less than width of the viewport. if (xScroll < windowWidth) { pageWidth = xScroll; } else { pageWidth = windowWidth; } arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight); return arrayPageSize; }, // pause(numberMillis) pause : function(ms) { var date = new Date(); var curDate = null; do { curDate = new Date(); } while (curDate - date < ms); }, // toggleSelectsFlash() // Hide / unhide select lists and flash objects as they appear above the // lightbox in some browsers. toggleSelectsFlash: function (state) { if (state == 'visible') { $("select.lightbox_hidden, embed.lightbox_hidden, object.lightbox_hidden").show(); } else if (state == 'hide') { $("select:visible, embed:visible, object:visible").not('#lightboxAutoModal select, #lightboxAutoModal embed, #lightboxAutoModal object').addClass("lightbox_hidden"); $("select.lightbox_hidden, embed.lightbox_hidden, object.lightbox_hidden").hide(); } }, // parseRel() parseRel: function (link) { var parts = []; parts["rel"] = parts["title"] = parts["group"] = parts["style"] = parts["flashvars"] = null; if (!$(link).attr('rel')) return parts; parts["rel"] = $(link).attr('rel').match(/\w+/)[0]; if ($(link).attr('rel').match(/\[(.*)\]/)) { var info = $(link).attr('rel').match(/\[(.*?)\]/)[1].split('|'); parts["group"] = info[0]; parts["style"] = info[1]; if (parts["style"] != undefined && parts["style"].match(/flashvars:\s?(.*?);/)) { parts["flashvars"] = parts["style"].match(/flashvars:\s?(.*?);/)[1]; } } if ($(link).attr('rel').match(/\[.*\]\[(.*)\]/)) { parts["title"] = $(link).attr('rel').match(/\[.*\]\[(.*)\]/)[1]; } return parts; }, // setStyles() setStyles: function(item, styles) { item.width = Lightbox.iframe_width; item.height = Lightbox.iframe_height; item.scrolling = "auto"; if (!styles) return item; var stylesArray = styles.split(';'); for (var i = 0; i< stylesArray.length; i++) { if (stylesArray[i].indexOf('width:') >= 0) { var w = stylesArray[i].replace('width:', ''); item.width = jQuery.trim(w); } else if (stylesArray[i].indexOf('height:') >= 0) { var h = stylesArray[i].replace('height:', ''); item.height = jQuery.trim(h); } else if (stylesArray[i].indexOf('scrolling:') >= 0) { var scrolling = stylesArray[i].replace('scrolling:', ''); item.scrolling = jQuery.trim(scrolling); } else if (stylesArray[i].indexOf('overflow:') >= 0) { var overflow = stylesArray[i].replace('overflow:', ''); item.overflow = jQuery.trim(overflow); } } return item; }, // togglePlayPause() // Hide the pause / play button as appropriate. If pausing the slideshow also // clear the timers, otherwise move onto the next image. togglePlayPause: function(hideId, showId) { if (Lightbox.isSlideshow && hideId == "lightshowPause") { for (var i = 0; i < Lightbox.slideIdCount; i++) { window.clearTimeout(Lightbox.slideIdArray[i]); } } $('#' + hideId).hide(); $('#' + showId).show(); if (hideId == "lightshowPlay") { Lightbox.isPaused = false; if (!Lightbox.loopSlides && Lightbox.activeImage == (Lightbox.total - 1)) { Lightbox.end(); } else if (Lightbox.total > 1) { Lightbox.changeData(Lightbox.activeImage + 1); } } else { Lightbox.isPaused = true; } }, triggerLightbox: function (rel_type, rel_group) { if (rel_type.length) { if (rel_group && rel_group.length) { $("a[rel^='" + rel_type +"\[" + rel_group + "\]'], area[rel^='" + rel_type +"\[" + rel_group + "\]']").eq(0).trigger("click"); } else { $("a[rel^='" + rel_type +"'], area[rel^='" + rel_type +"']").eq(0).trigger("click"); } } }, detectMacFF2: function() { var ua = navigator.userAgent.toLowerCase(); if (/firefox[\/\s](\d+\.\d+)/.test(ua)) { var ffversion = new Number(RegExp.$1); if (ffversion < 3 && ua.indexOf('mac') != -1) { return true; } } return false; }, checkKey: function(keys, key, code) { return (jQuery.inArray(key, keys) != -1 || jQuery.inArray(String(code), keys) != -1); }, filterXSS: function(str, allowed_tags) { var output = ""; var prefix = Drupal.settings.pathPrefix; if (!prefix) prefix = ''; $.ajax({ url: Drupal.settings.basePath + prefix + '?q=system/lightbox2/filter-xss', data: { 'string' : str, 'allowed_tags' : allowed_tags }, type: "POST", async: false, dataType: "json", success: function(data) { output = data; } }); return output; } }; // Initialize the lightbox. Drupal.behaviors.initLightbox = { attach: function(context) { $('body:not(.lightbox-processed)', context).addClass('lightbox-processed').each(function() { Lightbox.initialize(); return false; // Break the each loop. }); // Attach lightbox to any links with lightbox rels. Lightbox.initList(context); $('#lightboxAutoModal', context).triggerHandler('click'); } }; })(jQuery); ; (function($) { Drupal.behaviors.custom_search = { attach: function(context) { if (!Drupal.settings.custom_search.solr) { // Check if the search box is not empty on submit $('form.search-form', context).submit(function(){ var $this = $(this); var box = $this.find('input.custom-search-box'); if (box.val() != undefined && box.val() == '') { $this.find('input.custom-search-box').addClass('error'); return false; } // If basic search is hidden, copy or value to the keys if ($this.find('#edit-keys').parents('div.element-invisible').attr('class') == 'element-invisible') { $this.find('#edit-keys').val($this.find('#edit-or').val()); $this.find('#edit-or').val(''); } return true; }); } // Search from target $('form.search-form').attr('target', Drupal.settings.custom_search.form_target); // Displays Popup. $('form.search-form input.custom-search-box', context).bind('click focus', function(e){ var $parentForm = $(this).parents('form'); // check if there's something in the popup and displays it var popup = $parentForm.find('fieldset.custom_search-popup'); if (popup.find('input,select').length && !popup.hasClass('opened')) { popup.fadeIn().addClass('opened'); } e.stopPropagation(); }); $(document).bind('click focus', function(){ $('fieldset.custom_search-popup').hide().removeClass('opened'); }); // Handle checkboxes $('.custom-search-selector input:checkbox', context).each(function(){ var el = $(this); if (el.val() == 'c-all') { el.change(function(){ $(this).parents('.custom-search-selector').find('input:checkbox[value!=c-all]').attr('checked', false); }); } else { if (el.val().substr(0,2) == 'c-') { el.change(function(){ $('.custom-search-selector input:checkbox').each(function(){ if ($(this).val().substr(0,2) == 'o-') { $(this).attr('checked', false); } }); $(this).parents('.custom-search-selector').find('input:checkbox[value=c-all]').attr('checked', false); }); } else { el.change(function(){ $(this).parents('.custom-search-selector').find('input:checkbox[value!=' + el.val() + ']').attr('checked', false); }); } } }); // Handle popup. var popup = $('fieldset.custom_search-popup:not(.custom_search-processed)', context).addClass("custom_search-processed"); popup.click(function(e){ e.stopPropagation(); }) popup.append('' + Drupal.t('Close') + ''); $('a.custom_search-popup-close').click(function(e){ $('fieldset.custom_search-popup.opened').hide().removeClass('opened'); e.preventDefault(); }); } } })(jQuery); ; /* * transform: A jQuery cssHooks adding cross-browser 2d transform capabilities to $.fn.css() and $.fn.animate() * * limitations: * - requires jQuery 1.4.3+ * - Should you use the *translate* property, then your elements need to be absolutely positionned in a relatively positionned wrapper **or it will fail in IE678**. * - transformOrigin is not accessible * * latest version and complete README available on Github: * https://github.com/louisremi/jquery.transform.js * * Copyright 2011 @louis_remi * Licensed under the MIT license. * * This saved you an hour of work? * Send me music http://www.amazon.co.uk/wishlist/HNTU0468LQON * */ (function( $, window, document, Math, undefined ) { /* * Feature tests and global variables */ var div = document.createElement("div"), divStyle = div.style, suffix = "Transform", testProperties = [ "O" + suffix, "ms" + suffix, "Webkit" + suffix, "Moz" + suffix ], i = testProperties.length, supportProperty, supportMatrixFilter, supportFloat32Array = "Float32Array" in window, propertyHook, propertyGet, rMatrix = /Matrix([^)]*)/, rAffine = /^\s*matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*(?:,\s*0(?:px)?\s*){2}\)\s*$/, _transform = "transform", _transformOrigin = "transformOrigin", _translate = "translate", _rotate = "rotate", _scale = "scale", _skew = "skew", _matrix = "matrix"; // test different vendor prefixes of these properties while ( i-- ) { if ( testProperties[i] in divStyle ) { $.support[_transform] = supportProperty = testProperties[i]; $.support[_transformOrigin] = supportProperty + "Origin"; continue; } } // IE678 alternative if ( !supportProperty ) { $.support.matrixFilter = supportMatrixFilter = divStyle.filter === ""; } // px isn't the default unit of these properties $.cssNumber[_transform] = $.cssNumber[_transformOrigin] = true; /* * fn.css() hooks */ if ( supportProperty && supportProperty != _transform ) { // Modern browsers can use jQuery.cssProps as a basic hook $.cssProps[_transform] = supportProperty; $.cssProps[_transformOrigin] = supportProperty + "Origin"; // Firefox needs a complete hook because it stuffs matrix with "px" if ( supportProperty == "Moz" + suffix ) { propertyHook = { get: function( elem, computed ) { return (computed ? // remove "px" from the computed matrix $.css( elem, supportProperty ).split("px").join(""): elem.style[supportProperty] ); }, set: function( elem, value ) { // add "px" to matrices elem.style[supportProperty] = /matrix\([^)p]*\)/.test(value) ? value.replace(/matrix((?:[^,]*,){4})([^,]*),([^)]*)/, _matrix+"$1$2px,$3px"): value; } }; /* Fix two jQuery bugs still present in 1.5.1 * - rupper is incompatible with IE9, see http://jqbug.com/8346 * - jQuery.css is not really jQuery.cssProps aware, see http://jqbug.com/8402 */ } else if ( /^1\.[0-5](?:\.|$)/.test($.fn.jquery) ) { propertyHook = { get: function( elem, computed ) { return (computed ? $.css( elem, supportProperty.replace(/^ms/, "Ms") ): elem.style[supportProperty] ); } }; } /* TODO: leverage hardware acceleration of 3d transform in Webkit only else if ( supportProperty == "Webkit" + suffix && support3dTransform ) { propertyHook = { set: function( elem, value ) { elem.style[supportProperty] = value.replace(); } } }*/ } else if ( supportMatrixFilter ) { propertyHook = { get: function( elem, computed, asArray ) { var elemStyle = ( computed && elem.currentStyle ? elem.currentStyle : elem.style ), matrix, data; if ( elemStyle && rMatrix.test( elemStyle.filter ) ) { matrix = RegExp.$1.split(","); matrix = [ matrix[0].split("=")[1], matrix[2].split("=")[1], matrix[1].split("=")[1], matrix[3].split("=")[1] ]; } else { matrix = [1,0,0,1]; } if ( ! $.cssHooks[_transformOrigin] ) { matrix[4] = elemStyle ? parseInt(elemStyle.left, 10) || 0 : 0; matrix[5] = elemStyle ? parseInt(elemStyle.top, 10) || 0 : 0; } else { data = $._data( elem, "transformTranslate", undefined ); matrix[4] = data ? data[0] : 0; matrix[5] = data ? data[1] : 0; } return asArray ? matrix : _matrix+"(" + matrix + ")"; }, set: function( elem, value, animate ) { var elemStyle = elem.style, currentStyle, Matrix, filter, centerOrigin; if ( !animate ) { elemStyle.zoom = 1; } value = matrix(value); // rotate, scale and skew Matrix = [ "Matrix("+ "M11="+value[0], "M12="+value[2], "M21="+value[1], "M22="+value[3], "SizingMethod='auto expand'" ].join(); filter = ( currentStyle = elem.currentStyle ) && currentStyle.filter || elemStyle.filter || ""; elemStyle.filter = rMatrix.test(filter) ? filter.replace(rMatrix, Matrix) : filter + " progid:DXImageTransform.Microsoft." + Matrix + ")"; if ( ! $.cssHooks[_transformOrigin] ) { // center the transform origin, from pbakaus's Transformie http://github.com/pbakaus/transformie if ( (centerOrigin = $.transform.centerOrigin) ) { elemStyle[centerOrigin == "margin" ? "marginLeft" : "left"] = -(elem.offsetWidth/2) + (elem.clientWidth/2) + "px"; elemStyle[centerOrigin == "margin" ? "marginTop" : "top"] = -(elem.offsetHeight/2) + (elem.clientHeight/2) + "px"; } // translate // We assume that the elements are absolute positionned inside a relative positionned wrapper elemStyle.left = value[4] + "px"; elemStyle.top = value[5] + "px"; } else { $.cssHooks[_transformOrigin].set( elem, value ); } } }; } // populate jQuery.cssHooks with the appropriate hook if necessary if ( propertyHook ) { $.cssHooks[_transform] = propertyHook; } // we need a unique setter for the animation logic propertyGet = propertyHook && propertyHook.get || $.css; /* * fn.animate() hooks */ $.fx.step.transform = function( fx ) { var elem = fx.elem, start = fx.start, end = fx.end, pos = fx.pos, transform = "", precision = 1E5, i, startVal, endVal, unit; // fx.end and fx.start need to be converted to interpolation lists if ( !start || typeof start === "string" ) { // the following block can be commented out with jQuery 1.5.1+, see #7912 if ( !start ) { start = propertyGet( elem, supportProperty ); } // force layout only once per animation if ( supportMatrixFilter ) { elem.style.zoom = 1; } // replace "+=" in relative animations (-= is meaningless with transforms) end = end.split("+=").join(start); // parse both transform to generate interpolation list of same length $.extend( fx, interpolationList( start, end ) ); start = fx.start; end = fx.end; } i = start.length; // interpolate functions of the list one by one while ( i-- ) { startVal = start[i]; endVal = end[i]; unit = +false; switch ( startVal[0] ) { case _translate: unit = "px"; case _scale: unit || ( unit = ""); transform = startVal[0] + "(" + Math.round( (startVal[1][0] + (endVal[1][0] - startVal[1][0]) * pos) * precision ) / precision + unit +","+ Math.round( (startVal[1][1] + (endVal[1][1] - startVal[1][1]) * pos) * precision ) / precision + unit + ")"+ transform; break; case _skew + "X": case _skew + "Y": case _rotate: transform = startVal[0] + "(" + Math.round( (startVal[1] + (endVal[1] - startVal[1]) * pos) * precision ) / precision +"rad)"+ transform; break; } } fx.origin && ( transform = fx.origin + transform ); propertyHook && propertyHook.set ? propertyHook.set( elem, transform, +true ): elem.style[supportProperty] = transform; }; /* * Utility functions */ // turns a transform string into its "matrix(A,B,C,D,X,Y)" form (as an array, though) function matrix( transform ) { transform = transform.split(")"); var trim = $.trim , i = -1 // last element of the array is an empty string, get rid of it , l = transform.length -1 , split, prop, val , prev = supportFloat32Array ? new Float32Array(6) : [] , curr = supportFloat32Array ? new Float32Array(6) : [] , rslt = supportFloat32Array ? new Float32Array(6) : [1,0,0,1,0,0] ; prev[0] = prev[3] = rslt[0] = rslt[3] = 1; prev[1] = prev[2] = prev[4] = prev[5] = 0; // Loop through the transform properties, parse and multiply them while ( ++i < l ) { split = transform[i].split("("); prop = trim(split[0]); val = split[1]; curr[0] = curr[3] = 1; curr[1] = curr[2] = curr[4] = curr[5] = 0; switch (prop) { case _translate+"X": curr[4] = parseInt(val, 10); break; case _translate+"Y": curr[5] = parseInt(val, 10); break; case _translate: val = val.split(","); curr[4] = parseInt(val[0], 10); curr[5] = parseInt(val[1] || 0, 10); break; case _rotate: val = toRadian(val); curr[0] = Math.cos(val); curr[1] = Math.sin(val); curr[2] = -Math.sin(val); curr[3] = Math.cos(val); break; case _scale+"X": curr[0] = +val; break; case _scale+"Y": curr[3] = val; break; case _scale: val = val.split(","); curr[0] = val[0]; curr[3] = val.length>1 ? val[1] : val[0]; break; case _skew+"X": curr[2] = Math.tan(toRadian(val)); break; case _skew+"Y": curr[1] = Math.tan(toRadian(val)); break; case _matrix: val = val.split(","); curr[0] = val[0]; curr[1] = val[1]; curr[2] = val[2]; curr[3] = val[3]; curr[4] = parseInt(val[4], 10); curr[5] = parseInt(val[5], 10); break; } // Matrix product (array in column-major order) rslt[0] = prev[0] * curr[0] + prev[2] * curr[1]; rslt[1] = prev[1] * curr[0] + prev[3] * curr[1]; rslt[2] = prev[0] * curr[2] + prev[2] * curr[3]; rslt[3] = prev[1] * curr[2] + prev[3] * curr[3]; rslt[4] = prev[0] * curr[4] + prev[2] * curr[5] + prev[4]; rslt[5] = prev[1] * curr[4] + prev[3] * curr[5] + prev[5]; prev = [rslt[0],rslt[1],rslt[2],rslt[3],rslt[4],rslt[5]]; } return rslt; } // turns a matrix into its rotate, scale and skew components // algorithm from http://hg.mozilla.org/mozilla-central/file/7cb3e9795d04/layout/style/nsStyleAnimation.cpp function unmatrix(matrix) { var scaleX , scaleY , skew , A = matrix[0] , B = matrix[1] , C = matrix[2] , D = matrix[3] ; // Make sure matrix is not singular if ( A * D - B * C ) { // step (3) scaleX = Math.sqrt( A * A + B * B ); A /= scaleX; B /= scaleX; // step (4) skew = A * C + B * D; C -= A * skew; D -= B * skew; // step (5) scaleY = Math.sqrt( C * C + D * D ); C /= scaleY; D /= scaleY; skew /= scaleY; // step (6) if ( A * D < B * C ) { A = -A; B = -B; skew = -skew; scaleX = -scaleX; } // matrix is singular and cannot be interpolated } else { // In this case the elem shouldn't be rendered, hence scale == 0 scaleX = scaleY = skew = 0; } // The recomposition order is very important // see http://hg.mozilla.org/mozilla-central/file/7cb3e9795d04/layout/style/nsStyleAnimation.cpp#l971 return [ [_translate, [+matrix[4], +matrix[5]]], [_rotate, Math.atan2(B, A)], [_skew + "X", Math.atan(skew)], [_scale, [scaleX, scaleY]] ]; } // build the list of transform functions to interpolate // use the algorithm described at http://dev.w3.org/csswg/css3-2d-transforms/#animation function interpolationList( start, end ) { var list = { start: [], end: [] }, i = -1, l, currStart, currEnd, currType; // get rid of affine transform matrix ( start == "none" || isAffine( start ) ) && ( start = "" ); ( end == "none" || isAffine( end ) ) && ( end = "" ); // if end starts with the current computed style, this is a relative animation // store computed style as the origin, remove it from start and end if ( start && end && !end.indexOf("matrix") && toArray( start ).join() == toArray( end.split(")")[0] ).join() ) { list.origin = start; start = ""; end = end.slice( end.indexOf(")") +1 ); } if ( !start && !end ) { return; } // start or end are affine, or list of transform functions are identical // => functions will be interpolated individually if ( !start || !end || functionList(start) == functionList(end) ) { start && ( start = start.split(")") ) && ( l = start.length ); end && ( end = end.split(")") ) && ( l = end.length ); while ( ++i < l-1 ) { start[i] && ( currStart = start[i].split("(") ); end[i] && ( currEnd = end[i].split("(") ); currType = $.trim( ( currStart || currEnd )[0] ); append( list.start, parseFunction( currType, currStart ? currStart[1] : 0 ) ); append( list.end, parseFunction( currType, currEnd ? currEnd[1] : 0 ) ); } // otherwise, functions will be composed to a single matrix } else { list.start = unmatrix(matrix(start)); list.end = unmatrix(matrix(end)) } return list; } function parseFunction( type, value ) { var // default value is 1 for scale, 0 otherwise defaultValue = +(!type.indexOf(_scale)), scaleX, // remove X/Y from scaleX/Y & translateX/Y, not from skew cat = type.replace( /e[XY]/, "e" ); switch ( type ) { case _translate+"Y": case _scale+"Y": value = [ defaultValue, value ? parseFloat( value ): defaultValue ]; break; case _translate+"X": case _translate: case _scale+"X": scaleX = 1; case _scale: value = value ? ( value = value.split(",") ) && [ parseFloat( value[0] ), parseFloat( value.length>1 ? value[1] : type == _scale ? scaleX || value[0] : defaultValue+"" ) ]: [defaultValue, defaultValue]; break; case _skew+"X": case _skew+"Y": case _rotate: value = value ? toRadian( value ) : 0; break; case _matrix: return unmatrix( value ? toArray(value) : [1,0,0,1,0,0] ); break; } return [[ cat, value ]]; } function isAffine( matrix ) { return rAffine.test(matrix); } function functionList( transform ) { return transform.replace(/(?:\([^)]*\))|\s/g, ""); } function append( arr1, arr2, value ) { while ( value = arr2.shift() ) { arr1.push( value ); } } // converts an angle string in any unit to a radian Float function toRadian(value) { return ~value.indexOf("deg") ? parseInt(value,10) * (Math.PI * 2 / 360): ~value.indexOf("grad") ? parseInt(value,10) * (Math.PI/200): parseFloat(value); } // Converts "matrix(A,B,C,D,X,Y)" to [A,B,C,D,X,Y] function toArray(matrix) { // remove the unit of X and Y for Firefox matrix = /([^,]*),([^,]*),([^,]*),([^,]*),([^,p]*)(?:px)?,([^)p]*)(?:px)?/.exec(matrix); return [matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6]]; } $.transform = { centerOrigin: "margin" }; })( jQuery, window, document, Math ); ; (function ($) { var DEXP_MENU = DEXP_MENU || {}; DEXP_MENU.ww = $(window).width(); DEXP_MENU.is_mobile = DEXP_MENU.ww < 992; DEXP_MENU.submenu = null; $(window).resize(function(){ DEXP_MENU.ww = $(window).width(); DEXP_MENU.is_mobile = DEXP_MENU.ww < 992; }); Drupal.behaviors.dexp_menu = { attach: function (context, settings) { $('.dexp-dropdown ul.menu > li.expanded').once('hover', function () { $(this).hover(function () { DEXP_MENU.submenu = $(this).find('>ul, >.dexp-menu-mega'); DEXP_MENU.submenu.addClass('menu-visible'); if(!DEXP_MENU.is_mobile){ /*Mega menu fullwidth*/ if(DEXP_MENU.submenu.hasClass('container')){ var transformX = (DEXP_MENU.ww - DEXP_MENU.submenu.outerWidth())/2 - DEXP_MENU.submenu.offset().left; transformX = parseInt(transformX); console.log(transformX); DEXP_MENU.submenu.css('transform','translateX('+transformX+'px)'); }else{ /*Normal submenu*/ /*LTR direction*/ if($('body').hasClass('ltr')){ var offsetX = DEXP_MENU.submenu.offset().left + DEXP_MENU.submenu.outerWidth() - DEXP_MENU.ww + ($(window).width() - $('.container').width())/2; if (offsetX > 0) { var transformX = 0 - offsetX + 'px'; DEXP_MENU.submenu.css('transform', 'translateX('+transformX+')'); } }else{ var offsetX = DEXP_MENU.submenu.offset().left - ($(window).width() - $('.container').width())/2; if (offsetX < 0){ var transformX = parseInt(0 - offsetX); DEXP_MENU.submenu.css('transform', 'translateX('+transformX+'px)'); } } } } }, function () { $(this).find('>ul, >.dexp-menu-mega').removeClass('menu-visible').css('transform','translateX(0)'); }); }); $('.dexp-menu-toggler').once('click', function(){ $(this).click(function(){ var $menu = $($(this).data('target')); $menu.toggleClass('open'); if($menu.offset().left != 0){ $menu.css('left',0); var left = 0-$menu.offset().left; $menu.css('left',left+'px'); } }); }); $('.dexp-menu span.menu-toggle').once('click', function(){ $(this).click(function(){ $(this).toggleClass('fa-angle-right fa-angle-down').parent().find('>ul.menu, >div.dexp-menu-mega').toggleClass('menu-visible-mobile'); }); }); } } })(jQuery); /* jQuery(document).ready(function($) { $('.dexp-dropdown ul li a').data({click:true}); $('.dexp-dropdown a.active').each(function() { $(this).parents('li.expanded').addClass('active'); }); $('.dexp-dropdown li.expanded').each(function() { var $this = $(this), $toggle = $(''); $toggle.click(function() { $(this).toggleClass('fa-angle-right fa-angle-down'); $this.find('>ul,>.dexp-menu-mega').toggleClass('menu-open'); }); $this.append($toggle); }); $('.dexp-dropdown .menu-attach-block-wrapper').parent('li').addClass('block-attach'); $('.dexp-menu-toggler').click(function() { var $menu = $($(this).data('target')); if ($menu != null) { $menu.toggleClass('mobile-open'); } return false; }); $('.dexp-dropdown ul li a').on('touchstart',function() { var $this = $(this),$li = $(this).parent(); if($li.find('ul,.dexp-menu-mega').length > 0){ $this.data({ click: $this.data('click').toString() == 'true'?false:true }); } $('.dexp-dropdown ul li a').not($this).data({click:true}); //Mobile if($this.data('click') == false){ $li.find('> .menu-toggler').trigger('click'); } return $this.data('click'); }); $('.dexp-dropdown ul li').hover(function() { if($(window).width()<992) return true; var container_width = $(window).width(); var $submenu = $(this).find('>ul,>.dexp-menu-mega').not('.container'), ww = $(window).width(), innerw = ww - (ww - container_width) / 2; if ($submenu.length === 0) return; //RTL if($('body').hasClass('rtl')){ var limit = (ww - container_width)/2; var offsetX = limit-$submenu.offset().left; if(offsetX > 0){ var transformX = offsetX + 'px'; $submenu.css({ transform: 'translateX('+transformX+')' }); } }else{ //LTR var offsetX = $submenu.offset().left + $submenu.width() - innerw; if (offsetX > 0) { var transformX = 0 - offsetX + 'px'; $submenu.css({ transform: 'translateX('+transformX+')' }); } } }, function() { var $submenu = $(this).find('>ul,>.dexp-menu-mega'); if ($submenu.length === 0) return; $submenu.css({ transform: 'translateX(0)' }); }); $('.dexp-dropdown .container').each(function(){ $(this).parent('li').addClass('dexp-static') }); }); */ ; (function($) { var mobile_sticky = false; $.fn.dexpsticky = function(e) { this.each(function() { var b = $(this); b.addClass('dexp-sticky'); b.data('offset-top', b.data('offset-top') || b.offset().top); b.data('max-height', b.outerHeight()); var c = $('
').addClass('sticky-wrapper'); b.wrap(c); var d = b.parents('.sticky-wrapper'); b.width(d.width()); setInterval(function() { d.height(b.outerHeight()); b.width(d.width()); }, 50); var scrollTimeout; var delay = 15; var scrollHandler = function() { if(mobile_sticky == false && $(window).width() < 992){ return; } if ($(window).scrollTop() > b.data('offset-top')) { b.addClass('fixed'); setTimeout(function() { b.addClass('fixed-transition'); }, 10); } else { b.removeClass('fixed'); setTimeout(function() { b.removeClass('fixed-transition'); }, 10); } }; $(window).bind('scroll', function() { if(b.hasClass('fixed')){ delay = 50; }else{ delay = 10; } if (scrollTimeout) { clearTimeout(scrollTimeout); scrollTimeout = null; } scrollTimeout = setTimeout(scrollHandler, 0); }).bind('resize', function() { b.removeClass('fixed fixed-transition').data('offset-top', b.offset().top); $(window).scroll(); }).scroll(); }); }; $(window).load(function() { if(!$('body').hasClass('menu-left') && !$('body').hasClass('menu-right')){ $('.dexp-sticky').dexpsticky(); } }); }(jQuery)); ; /** * @file */ (function ($) { 'use strict'; Drupal.extlink = Drupal.extlink || {}; Drupal.extlink.attach = function (context, settings) { if (!settings.hasOwnProperty('extlink')) { return; } // Strip the host name down, removing ports, subdomains, or www. var pattern = /^(([^\/:]+?\.)*)([^\.:]{1,})((\.[a-z0-9]{1,253})*)(:[0-9]{1,5})?$/; var host = window.location.host.replace(pattern, '$2$3$6'); var subdomain = window.location.host.replace(host, ''); // Determine what subdomains are considered internal. var subdomains; if (settings.extlink.extSubdomains) { subdomains = '([^/]*\\.)?'; } else if (subdomain === 'www.' || subdomain === '') { subdomains = '(www\\.)?'; } else { subdomains = subdomain.replace('.', '\\.'); } // Build regular expressions that define an internal link. var internal_link = new RegExp('^https?://([^@]*@)?' + subdomains + host, 'i'); // Extra internal link matching. var extInclude = false; if (settings.extlink.extInclude) { extInclude = new RegExp(settings.extlink.extInclude.replace(/\\/, '\\'), 'i'); } // Extra external link matching. var extExclude = false; if (settings.extlink.extExclude) { extExclude = new RegExp(settings.extlink.extExclude.replace(/\\/, '\\'), 'i'); } // Extra external link CSS selector exclusion. var extCssExclude = false; if (settings.extlink.extCssExclude) { extCssExclude = settings.extlink.extCssExclude; } // Extra external link CSS selector explicit. var extCssExplicit = false; if (settings.extlink.extCssExplicit) { extCssExplicit = settings.extlink.extCssExplicit; } // Define the jQuery method (either 'append' or 'prepend') of placing the icon, defaults to 'append'. var extIconPlacement = settings.extlink.extIconPlacement || 'append'; // Find all links which are NOT internal and begin with http as opposed // to ftp://, javascript:, etc. other kinds of links. // When operating on the 'this' variable, the host has been appended to // all links by the browser, even local ones. // In jQuery 1.1 and higher, we'd use a filter method here, but it is not // available in jQuery 1.0 (Drupal 5 default). var external_links = []; var mailto_links = []; $('a:not([data-extlink]), area:not([data-extlink])', context).each(function (el) { try { var url = ''; if (typeof this.href == 'string') { url = this.href.toLowerCase(); } // Handle SVG links (xlink:href). else if (typeof this.href == 'object') { url = this.href.baseVal; } if (url.indexOf('http') === 0 && ((!url.match(internal_link) && !(extExclude && url.match(extExclude))) || (extInclude && url.match(extInclude))) && !(extCssExclude && $(this).is(extCssExclude)) && !(extCssExclude && $(this).parents(extCssExclude).length > 0) && !(extCssExplicit && $(this).parents(extCssExplicit).length < 1)) { external_links.push(this); } // Do not include area tags with begin with mailto: (this prohibits // icons from being added to image-maps). else if (this.tagName !== 'AREA' && url.indexOf('mailto:') === 0 && !(extCssExclude && $(this).parents(extCssExclude).length > 0) && !(extCssExplicit && $(this).parents(extCssExplicit).length < 1)) { mailto_links.push(this); } } // IE7 throws errors often when dealing with irregular links, such as: // Empty tags. // example User:pass syntax. catch (error) { return false; } }); if (settings.extlink.extClass) { Drupal.extlink.applyClassAndSpan(external_links, settings.extlink.extClass, extIconPlacement); } if (settings.extlink.mailtoClass) { Drupal.extlink.applyClassAndSpan(mailto_links, settings.extlink.mailtoClass, extIconPlacement); } if (settings.extlink.extTarget) { // Apply the target attribute to all links. $(external_links).attr('target', settings.extlink.extTarget); // Add rel attributes noopener and noreferrer. $(external_links).attr('rel', function (i, val) { // If no rel attribute is present, create one with the values noopener and noreferrer. if (val == null) { return 'noopener noreferrer'; } // Check to see if rel contains noopener or noreferrer. Add what doesn't exist. if (val.indexOf('noopener') > -1 || val.indexOf('noreferrer') > -1) { if (val.indexOf('noopener') === -1) { return val + ' noopener'; } if (val.indexOf('noreferrer') === -1) { return val + ' noreferrer'; } // Both noopener and noreferrer exist. Nothing needs to be added. else { return val; } } // Else, append noopener and noreferrer to val. else { return val + ' noopener noreferrer'; } }); } Drupal.extlink = Drupal.extlink || {}; // Set up default click function for the external links popup. This should be // overridden by modules wanting to alter the popup. Drupal.extlink.popupClickHandler = Drupal.extlink.popupClickHandler || function () { if (settings.extlink.extAlert) { return confirm(settings.extlink.extAlertText); } }; $(external_links).click(function (e) { return Drupal.extlink.popupClickHandler(e, this); }); }; /** * Apply a class and a trailing to all links not containing images. * * @param {object[]} links * An array of DOM elements representing the links. * @param {string} class_name * The class to apply to the links. * @param {string} icon_placement * 'append' or 'prepend' the icon to the link. */ Drupal.extlink.applyClassAndSpan = function (links, class_name, icon_placement) { var $links_to_process; if (Drupal.settings.extlink.extImgClass) { $links_to_process = $(links); } else { var links_with_images = $(links).find('img').parents('a'); $links_to_process = $(links).not(links_with_images); } // Add data-extlink attribute. $links_to_process.attr('data-extlink', ''); var i; var length = $links_to_process.length; for (i = 0; i < length; i++) { var $link = $($links_to_process[i]); if ($link.css('display') === 'inline' || $link.css('display') === 'inline-block') { if (Drupal.settings.extlink.extUseFontAwesome) { if (class_name === Drupal.settings.extlink.mailtoClass) { $link[icon_placement]('' + Drupal.settings.extlink.mailtoLabel + ''); } else { $link[icon_placement]('' + Drupal.settings.extlink.extLabel + ''); } } else { if (class_name === Drupal.settings.extlink.mailtoClass) { $link[icon_placement]('' + Drupal.settings.extlink.mailtoLabel + ''); } else { $link[icon_placement]('' + Drupal.settings.extlink.extLabel + ''); } } } } }; Drupal.behaviors.extlink = Drupal.behaviors.extlink || {}; Drupal.behaviors.extlink.attach = function (context, settings) { // Backwards compatibility, for the benefit of modules overriding extlink // functionality by defining an "extlinkAttach" global function. if (typeof extlinkAttach === 'function') { extlinkAttach(context); } else { Drupal.extlink.attach(context, settings); } }; })(jQuery); ; jQuery(document).ready(function($) { $(".dexp-animate").each(function() { var $this = $(this); if ($('body').hasClass('mobile')) { $this.removeClass('dexp-animate'); } else { var animate_class = $this.data('animate'), delay = $this.data('animate-delay') || 0; $this.appear(function() { setTimeout(function() { $this.addClass('animated').addClass(animate_class); }, delay); }, { accX: 0, accY: 0, one: true }); } }); }); ; /* * jQuery.appear * https://github.com/bas2k/jquery.appear/ * http://code.google.com/p/jquery-appear/ * * Copyright (c) 2009 Michael Hixson * Copyright (c) 2012 Alexander Brovikov * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php) */ (function($) { $.fn.appear = function(fn, options) { var settings = $.extend({ //arbitrary data to pass to fn data: undefined, //call fn only on the first appear? one: true, // X & Y accuracy accX: 0, accY: 0 }, options); return this.each(function() { var t = $(this); //whether the element is currently visible t.appeared = false; if (!fn) { //trigger the custom event t.trigger('appear', settings.data); return; } var w = $(window); //fires the appear event when appropriate var check = function() { //is the element hidden? if (!t.is(':visible')) { //it became hidden t.appeared = false; return; } //is the element inside the visible window? var a = w.scrollLeft(); var b = w.scrollTop(); var o = t.offset(); var x = o.left; var y = o.top; var ax = settings.accX; var ay = settings.accY; var th = t.height(); var wh = w.height(); var tw = t.width(); var ww = w.width(); if (y + th + ay >= b && y <= b + wh + ay && x + tw + ax >= a && x <= a + ww + ax) { //trigger the custom event if (!t.appeared) t.trigger('appear', settings.data); } else { //it scrolled out of view t.appeared = false; } }; //create a modified fn with some additional logic var modifiedFn = function() { //mark the element as visible t.appeared = true; //is this supposed to happen only once? if (settings.one) { //remove the check w.unbind('scroll', check); var i = $.inArray(check, $.fn.appear.checks); if (i >= 0) $.fn.appear.checks.splice(i, 1); } //trigger the original fn fn.apply(this, arguments); }; //bind the modified fn to the element if (settings.one) t.one('appear', settings.data, modifiedFn); else t.bind('appear', settings.data, modifiedFn); //check whenever the window scrolls w.scroll(check); //check whenever the dom changes $.fn.appear.checks.push(check); //check now (check)(); }); }; //keep a queue of appearance checks $.extend($.fn.appear, { checks: [], timeout: null, //process the queue checkAll: function() { var length = $.fn.appear.checks.length; if (length > 0) while (length--) ($.fn.appear.checks[length])(); }, //check the queue asynchronously run: function() { if ($.fn.appear.timeout) clearTimeout($.fn.appear.timeout); $.fn.appear.timeout = setTimeout($.fn.appear.checkAll, 20); } }); //run checks when these methods are called $.each(['append', 'prepend', 'after', 'before', 'attr', 'removeAttr', 'addClass', 'removeClass', 'toggleClass', 'remove', 'css', 'show', 'hide'], function(i, n) { var old = $.fn[n]; if (old) { $.fn[n] = function() { var r = old.apply(this, arguments); $.fn.appear.run(); return r; } } }); })(jQuery);; /*! * Bootstrap v3.1.1 (http://getbootstrap.com) * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.isLoading=!1};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",f.resetText||d.data("resetText",d[e]()),d[e](f[b]||this.options[b]),setTimeout(a.proxy(function(){"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},b.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}a&&this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}if(e.hasClass("active"))return this.sliding=!1;var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});return this.$element.trigger(j),j.isDefaultPrevented()?void 0:(this.sliding=!0,f&&this.pause(),this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")?(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(1e3*d.css("transition-duration").slice(0,-1))):(d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")),f&&this.cycle(),this)};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("collapse in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);!e&&f.toggle&&"show"==c&&(c=!c),e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(jQuery),+function(a){"use strict";function b(b){a(d).remove(),a(e).each(function(){var d=c(a(this)),e={relatedTarget:this};d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown",e)),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown",e))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;(e||"destroy"!=c)&&(e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]())})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(a(c).is("body")?window:c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);{var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})}},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);if(g&&b<=e[0])return g!=(a=f[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(b.RESET).addClass("affix");var a=this.$window.scrollTop(),c=this.$element.offset();return this.pinnedOffset=c.top-a},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"top"==this.affixed&&(e.top+=d),"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top(this.$element)),"function"==typeof h&&(h=f.bottom(this.$element));var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;if(this.affixed!==i){this.unpin&&this.$element.css("top","");var j="affix"+(i?"-"+i:""),k=a.Event(j+".bs.affix");this.$element.trigger(k),k.isDefaultPrevented()||(this.affixed=i,this.unpin="bottom"==i?this.getPinnedOffset():null,this.$element.removeClass(b.RESET).addClass(j).trigger(a.Event(j.replace("affix","affixed"))),"bottom"==i&&this.$element.offset({top:c-h-this.$element.height()}))}}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(jQuery); ; (function($) { Drupal.behaviors.drupalexp_custompadding = { attach: function(context, settings) { $('.custompadding').each(function() { var $this = $(this), padding = $this.data('padding'), $rows = $(this).find('.row'); if (isNaN(parseInt(padding)) || padding == 15 || padding < 0) return; if ($rows.length === 0) { $this.css({ marginLeft: -padding + 'px', marginRight: -padding + 'px' }); $this.find('>*[class*=col-]').css({ paddingLeft: padding + 'px', paddingRight: padding + 'px' }); } else { $rows.each(function() { if ($(this).parents('.row', $this).length === 0) { $(this).css({ marginLeft: -padding + 'px', marginRight: -padding + 'px' }); $(this).find('>*[class*=col-]').css({ paddingLeft: padding + 'px', paddingRight: padding + 'px' }); } }); } }); } }; })(jQuery); ; (function ($) { Drupal.behaviors.drupalexp_base = { attach: function (context, settings) { var lightbox2 = settings.lightbox2 || null; if (lightbox2 !== null) { } $("a[href*=#]").click(function (e) { e.preventDefault(); if($(this).is('[data-slide]')) return true; var url = $(this).attr('href'); var hash = url.substring(url.indexOf("#") + 1); if(hash == '') return true; var element = $('[id=' + hash + ']'); if (element.length > 0) { e.preventDefault(); $('html, body').animate({ scrollTop: element.offset().top }, 800); } }); } } /*Set detect device*/ var setDevice = function () { $('body').removeClass('dexp-xs dexp-sm dexp-md dexp-lg'); var window_width = $(window).width(); if (window_width < 768) { $('body').addClass('dexp-xs'); } else if (window_width < 993) { $('body').addClass('dexp-sm'); } else if (window_width < 1200) { $('body').addClass('dexp-md'); } else { $('body').addClass('dexp-lg'); } }; $(document).ready(function () { setDevice(); }); $(window).bind('resize', function () { setDevice(); }); })(jQuery); ;