/** * jQuery Enhanced Lightbox plugin * This jQuery plugin is based on jQuery lightBox 0.5 by Leandro Vieira (http://leandrovieira.com/projects/jquery/lightbox/). * @name jquery-enlightbox.js * @author Eduardo Morais - http://www.eduardomorais.com * @version 1.1 * @date February 19, 2012 * @category jQuery plugin * @copyright (c) 2011-2012 Eduardo Morais, based on the work of Leandro Vieira Pinho (leandrovieira.com) * @license CCAttribution-ShareAlike 3.0 Unported - http://creativecommons.org/licenses/by-sa/3.0/ * @example Visit http://www.eduardomorais.com/code/lightbox/ for more informations about this jQuery plugin */ // Offering a Custom Alias suport - More info: http://docs.jquery.com/Plugins/Authoring#Custom_Alias (function($) { /** * $ is an alias to jQuery object * */ $.fn.lightBox = function(settings) { // Settings to configure the jQuery lightBox plugin how you like settings = jQuery.extend({ // Configuration related to overlay overlayBgColor: '#000', // (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color. overlayOpacity: 0.95, // (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9 // Configuration related to navigation fixedNavigation: true, // (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface. // Configuration related to images imageLoading: '/nfh-cp-tiles-theme/images/enlightbox/lightbox-loading.gif', // (string) Path and the name of the loading icon imageBtnPrev: '/nfh-cp-tiles-theme/images/enlightbox/lightbox-btn-prev.png', // (string) Path and the name of the prev button image imageBtnNext: '/nfh-cp-tiles-theme/images/enlightbox/lightbox-btn-next.png', // (string) Path and the name of the next button image imageBtnClose: '/nfh-cp-tiles-theme/images/enlightbox/lightbox-btn-close.png', // (string) Path and the name of the close btn imageBlank: '/nfh-cp-tiles-theme/images/enlightbox/lightbox-blank.gif', // (string) Path and the name of a blank image (one pixel) imageCurZoom: '/nfh-cp-tiles-theme/images/enlightbox/lightbox-zoom', // (string) Path and the name of the zoom mouse cursor w/ NO FILE EXTENSION // -- we need both the .cur and .png for it to work on all browsers // Configuration related to container image box containerBorderSize: 5, // (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value containerResizeSpeed: 200, // (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default. // Configuration related to texts in caption. For example: Image 2 of 8. You can alter either "Image" and "of" texts. txtImage: 'Zdjęcie', // (string) Specify text "Image" txtOf: 'z', // (string) Specify text "of" txtClose: 'Zamknij', // (string) Specify text "Close" // Configuration related to keyboard navigation keyToClose: 'c', // (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to. keyToPrev: 'p', // (string) (p = previous) Letter to show the previous image keyToNext: 'n', // (string) (n = next) Letter to show the next image. // Don�t alter these variables in any way imageArray: [], activeImage: 0, zoom: 0, zoomable: 0 },settings); // Minified by the Closure Compiler (http://closure-compiler.appspot.com/home): var jQueryMatchedObj=this;function _initialize(){_start(this,jQueryMatchedObj);return!1} function _start(a,b){$("embed, object, select").css({visibility:"hidden"});_set_interface();settings.imageArray.length=0;settings.activeImage=0;if(1==b.length)settings.imageArray.push([a.getAttribute("href"),a.getAttribute("title"),a.getAttribute("data-info"),a.getAttribute("data-maximized")]);else for(var c=0;c
');___getPageSize();$("#jquery-overlay").css({backgroundColor:settings.overlayBgColor,opacity:settings.overlayOpacity,width:$(document).width(),height:$(document).height(),top:0}).fadeIn();$("#jquery-overlay,#jquery-lightbox").click(function(){_finish()});$("#lightbox-loading-link,#lightbox-secNav-btnClose").click(function(){_finish(); return!1});$(window).resize(function(){$("#jquery-overlay").css({width:$(document).width()});var a=___getPageScroll();$("#jquery-lightbox").css({top:a[1]+$(window).height()/20,left:a[0]});settings.zoom=1;$("#lightbox-container-image-data-box").css({left:Math.round(($(window).width()-$("#lightbox-container-image-data-box").width())/2)-5})})} function _set_image_to_view(){var a=___getPageScroll();$("#jquery-lightbox").css({top:a[1]+$(window).height()/20,left:a[0]}).show();$("#lightbox-loading").show();settings.fixedNavigation?$("#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber").hide():$("#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-nav-btnZoom,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber").hide();var b=new Image;b.onload=function(){$("#lightbox-image").attr("src", settings.imageArray[settings.activeImage][0]);maximize=0;"always"==settings.imageArray[settings.activeImage][3]&&(maximize=1);imgW=b.width;imgH=b.height;limit=$(window).height()-$(window).height()/5;settings.zoomable=imgH>limit&&0==maximize?1:0;0==settings.zoom&&1==settings.zoomable&&(par=imgW/imgH,imgH=limit,imgW=Math.round(imgH*par));$("#lightbox-image").attr("width",imgW);$("#lightbox-image").attr("height",imgH);_resize_container_image_box(imgW,imgH);b.onload=function(){}};b.src=settings.imageArray[settings.activeImage][0]} function _resize_container_image_box(a,b){var c=$("#lightbox-container-image-box").width(),d=$("#lightbox-container-image-box").height(),e=a+2*settings.containerBorderSize,f=b+2*settings.containerBorderSize,c=c-e,d=d-f;$("#lightbox-container-image-box").animate({width:e,height:f},settings.containerResizeSpeed,function(){_show_image()});0==c&&0==d&&($.browser.msie?___pause(250):___pause(100));$("#lightbox-container-image-data-box").css({width:e-10});$("#lightbox-container-image-data-box").css({left:Math.round(($(window).width()- $("#lightbox-container-image-data-box").width())/2)-5});$("#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-nav-btnZoom").css({height:b+2*settings.containerBorderSize})}function _show_image(){$("#lightbox-loading").hide();$("#lightbox-image").fadeIn(function(){_show_image_data();_set_navigation()});_preload_neighbor_images()} function _show_image_data(){var a=settings.imageArray[settings.activeImage][1],b=settings.imageArray[settings.activeImage][2],c=0;$("#lightbox-image-details-caption").hide();a&&(b||(b=""),$("#lightbox-container-image-data-box").slideDown("fast"),c=1,$("#lightbox-image-details-caption").html(''+a+""+b).fadeIn());1settings.activeImage&&(objNext=new Image,objNext.src=settings.imageArray[settings.activeImage+1][0]);0document.body.offsetHeight?(a=document.body.scrollWidth,b=document.body.scrollHeight):(a=document.body.offsetWidth,b=document.body.offsetHeight);var c,d;self.innerHeight?(c=document.documentElement.clientWidth?document.documentElement.clientWidth:self.innerWidth,d=self.innerHeight):document.documentElement&&document.documentElement.clientHeight? (c=document.documentElement.clientWidth,d=document.documentElement.clientHeight):document.body&&(c=document.body.clientWidth,d=document.body.clientHeight);pageHeight=b