diff --git a/css/baguetteBox.min.css b/css/baguetteBox.min.css new file mode 100755 index 00000000..3e500dd2 --- /dev/null +++ b/css/baguetteBox.min.css @@ -0,0 +1,6 @@ +/*! + * baguetteBox.js + * @author feimosi + * @version 1.9.1 + * @url https://github.com/feimosi/baguetteBox.js + */#baguetteBox-overlay{display:none;opacity:0;position:fixed;overflow:hidden;top:0;left:0;width:100%;height:100%;z-index:1000000;background-color:#222;background-color:rgba(0,0,0,.8);-webkit-transition:opacity .5s ease;transition:opacity .5s ease}#baguetteBox-overlay.visible{opacity:1}#baguetteBox-overlay .full-image{display:inline-block;position:relative;width:100%;height:100%;text-align:center}#baguetteBox-overlay .full-image figure{display:inline;margin:0;height:100%}#baguetteBox-overlay .full-image img{display:inline-block;width:auto;height:auto;max-height:100%;max-width:100%;vertical-align:middle;-webkit-box-shadow:0 0 8px rgba(0,0,0,.6);-moz-box-shadow:0 0 8px rgba(0,0,0,.6);box-shadow:0 0 8px rgba(0,0,0,.6)}#baguetteBox-overlay .full-image figcaption{display:block;position:absolute;bottom:0;width:100%;text-align:center;line-height:1.8;white-space:normal;color:#ccc;background-color:#000;background-color:rgba(0,0,0,.6);font-family:sans-serif}#baguetteBox-overlay .full-image:before{content:"";display:inline-block;height:50%;width:1px;margin-right:-1px}#baguetteBox-slider{position:absolute;left:0;top:0;height:100%;width:100%;white-space:nowrap;-webkit-transition:left .4s ease,-webkit-transform .4s ease;transition:left .4s ease,-webkit-transform .4s ease;transition:left .4s ease,transform .4s ease;transition:left .4s ease,transform .4s ease,-webkit-transform .4s ease,-moz-transform .4s ease}#baguetteBox-slider.bounce-from-right{-webkit-animation:bounceFromRight .4s ease-out;animation:bounceFromRight .4s ease-out}#baguetteBox-slider.bounce-from-left{-webkit-animation:bounceFromLeft .4s ease-out;animation:bounceFromLeft .4s ease-out}@-webkit-keyframes bounceFromRight{0%,100%{margin-left:0}50%{margin-left:-30px}}@keyframes bounceFromRight{0%,100%{margin-left:0}50%{margin-left:-30px}}@-webkit-keyframes bounceFromLeft{0%,100%{margin-left:0}50%{margin-left:30px}}@keyframes bounceFromLeft{0%,100%{margin-left:0}50%{margin-left:30px}}.baguetteBox-button#next-button,.baguetteBox-button#previous-button{top:50%;top:calc(50% - 30px);width:44px;height:60px}.baguetteBox-button{position:absolute;cursor:pointer;outline:0;padding:0;margin:0;border:0;-moz-border-radius:15%;border-radius:15%;background-color:#323232;background-color:rgba(50,50,50,.5);color:#ddd;font:1.6em sans-serif;-webkit-transition:background-color .4s ease;transition:background-color .4s ease}.baguetteBox-button:focus,.baguetteBox-button:hover{background-color:rgba(50,50,50,.9)}.baguetteBox-button#next-button{right:2%}.baguetteBox-button#previous-button{left:2%}.baguetteBox-button#close-button{top:20px;right:2%;right:calc(2% + 6px);width:30px;height:30px}.baguetteBox-button svg{position:absolute;left:0;top:0}.baguetteBox-spinner{width:40px;height:40px;display:inline-block;position:absolute;top:50%;left:50%;margin-top:-20px;margin-left:-20px}.baguetteBox-double-bounce1,.baguetteBox-double-bounce2{width:100%;height:100%;-moz-border-radius:50%;border-radius:50%;background-color:#fff;opacity:.6;position:absolute;top:0;left:0;-webkit-animation:bounce 2s infinite ease-in-out;animation:bounce 2s infinite ease-in-out}.baguetteBox-double-bounce2{-webkit-animation-delay:-1s;animation-delay:-1s}@-webkit-keyframes bounce{0%,100%{-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes bounce{0%,100%{-webkit-transform:scale(0);-moz-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1);-moz-transform:scale(1);transform:scale(1)}} \ No newline at end of file diff --git a/images/head-left-upper.gif b/images/head-left-upper.gif deleted file mode 100644 index a3b7dfd0..00000000 Binary files a/images/head-left-upper.gif and /dev/null differ diff --git a/images/header-background.gif b/images/header-background.gif deleted file mode 100644 index 4bca655e..00000000 Binary files a/images/header-background.gif and /dev/null differ diff --git a/images/header-left-corner.gif b/images/header-left-corner.gif deleted file mode 100644 index a6dc7a04..00000000 Binary files a/images/header-left-corner.gif and /dev/null differ diff --git a/images/header-left-solid.gif b/images/header-left-solid.gif deleted file mode 100644 index 17b393c7..00000000 Binary files a/images/header-left-solid.gif and /dev/null differ diff --git a/images/header-right-corner.gif b/images/header-right-corner.gif deleted file mode 100644 index 66f81e00..00000000 Binary files a/images/header-right-corner.gif and /dev/null differ diff --git a/images/header-right-solid.gif b/images/header-right-solid.gif deleted file mode 100644 index 303a0bb0..00000000 Binary files a/images/header-right-solid.gif and /dev/null differ diff --git a/images/left-low-corner.gif b/images/left-low-corner.gif deleted file mode 100644 index fc18e3f6..00000000 Binary files a/images/left-low-corner.gif and /dev/null differ diff --git a/images/nav-dots.gif b/images/nav-dots.gif deleted file mode 100644 index efb41dbd..00000000 Binary files a/images/nav-dots.gif and /dev/null differ diff --git a/images/par-head.png b/images/par-head.png deleted file mode 100644 index eac19221..00000000 Binary files a/images/par-head.png and /dev/null differ diff --git a/images/random-screenshot.png b/images/random-screenshot.png deleted file mode 100644 index 1eacedae..00000000 Binary files a/images/random-screenshot.png and /dev/null differ diff --git a/images/right-low-corner.gif b/images/right-low-corner.gif deleted file mode 100644 index baa66740..00000000 Binary files a/images/right-low-corner.gif and /dev/null differ diff --git a/images/rs-bottom.png b/images/rs-bottom.png deleted file mode 100644 index 6c50dd1f..00000000 Binary files a/images/rs-bottom.png and /dev/null differ diff --git a/images/rs-top-left.png b/images/rs-top-left.png deleted file mode 100644 index aedc0ba7..00000000 Binary files a/images/rs-top-left.png and /dev/null differ diff --git a/images/rs-top.png b/images/rs-top.png deleted file mode 100644 index 9a0acf95..00000000 Binary files a/images/rs-top.png and /dev/null differ diff --git a/images/shots-corner-left.gif b/images/shots-corner-left.gif deleted file mode 100644 index b1827065..00000000 Binary files a/images/shots-corner-left.gif and /dev/null differ diff --git a/images/shots-corner-right.gif b/images/shots-corner-right.gif deleted file mode 100644 index dd100fad..00000000 Binary files a/images/shots-corner-right.gif and /dev/null differ diff --git a/javascripts/baguetteBox.min.js b/javascripts/baguetteBox.min.js new file mode 100755 index 00000000..671d6ace --- /dev/null +++ b/javascripts/baguetteBox.min.js @@ -0,0 +1,7 @@ +/*! + * baguetteBox.js + * @author feimosi + * @version 1.9.1 + * @url https://github.com/feimosi/baguetteBox.js + */ +!function(t,e){"use strict";"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e():t.baguetteBox=e()}(this,function(){"use strict";function t(t,e){var n=document.querySelectorAll(t),o={galleries:[],nodeList:n};D[t]=o,[].forEach.call(n,function(t){e&&e.filter&&(z=e.filter);var n=[];if(n="A"===t.tagName?[t]:t.getElementsByTagName("a"),0!==(n=[].filter.call(n,function(t){if(-1===t.className.indexOf(e&&e.ignoreClass))return z.test(t.href)})).length){var i=[];[].forEach.call(n,function(t,n){var o=function(t){t.preventDefault?t.preventDefault():t.returnValue=!1,r(i,e),u(n)},a={eventHandler:o,imageElement:t};x(t,"click",o),i.push(a)}),o.galleries.push(i)}})}function e(){for(var t in D)D.hasOwnProperty(t)&&n(t)}function n(t){if(D.hasOwnProperty(t)){var e=D[t].galleries;[].forEach.call(e,function(t){[].forEach.call(t,function(t){E(t.imageElement,"click",t.eventHandler)}),X===t&&(X=[])}),delete D[t]}}function o(){if(N=B("baguetteBox-overlay"))return A=B("baguetteBox-slider"),L=B("previous-button"),S=B("next-button"),void(P=B("close-button"));(N=T("div")).setAttribute("role","dialog"),N.id="baguetteBox-overlay",document.getElementsByTagName("body")[0].appendChild(N),(A=T("div")).id="baguetteBox-slider",N.appendChild(A),(L=T("button")).setAttribute("type","button"),L.id="previous-button",L.setAttribute("aria-label","Previous"),L.innerHTML=j.svg?F:"<",N.appendChild(L),(S=T("button")).setAttribute("type","button"),S.id="next-button",S.setAttribute("aria-label","Next"),S.innerHTML=j.svg?H:">",N.appendChild(S),(P=T("button")).setAttribute("type","button"),P.id="close-button",P.setAttribute("aria-label","Close"),P.innerHTML=j.svg?I:"×",N.appendChild(P),L.className=S.className=P.className="baguetteBox-button",a()}function i(t){switch(t.keyCode){case 37:h();break;case 39:p();break;case 27:g()}}function a(){x(N,"click",W),x(L,"click",G),x(S,"click",J),x(P,"click",K),x(A,"contextmenu",_),x(N,"touchstart",Q),x(N,"touchmove",Z),x(N,"touchend",$),x(document,"focus",tt,!0)}function l(){E(N,"click",W),E(L,"click",G),E(S,"click",J),E(P,"click",K),E(A,"contextmenu",_),E(N,"touchstart",Q),E(N,"touchmove",Z),E(N,"touchend",$),E(document,"focus",tt,!0)}function r(t,e){if(X!==t){for(X=t,s(e);A.firstChild;)A.removeChild(A.firstChild);V.length=0;for(var n,o=[],i=[],a=0;a
',Y.captions&&l){var u=T("figcaption");u.id="baguetteBox-figcaption-"+t,u.innerHTML=l,s.appendChild(u)}n.appendChild(s);var c=T("img");c.onload=function(){var n=document.querySelector("#baguette-img-"+t+" .baguetteBox-spinner");s.removeChild(n),!Y.async&&e&&e()},c.setAttribute("src",r),c.alt=a?a.alt||"":"",Y.titleTag&&l&&(c.title=l),s.appendChild(c),Y.async&&e&&e()}}function b(t){var e=t.href;if(t.dataset){var n=[];for(var o in t.dataset)"at-"!==o.substring(0,3)||isNaN(o.substring(3))||(n[o.replace("at-","")]=t.dataset[o]);for(var i=Object.keys(n).sort(function(t,e){return parseInt(t,10)=1?(M--,y(),C(M),t=!0):Y.animation&&(A.className="bounce-from-left",setTimeout(function(){A.className=""},400),t=!1),Y.onChange&&Y.onChange(M,V.length),t}function y(){var t=100*-M+"%";"fadeIn"===Y.animation?(A.style.opacity=0,setTimeout(function(){j.transforms?A.style.transform=A.style.webkitTransform="translate3d("+t+",0,0)":A.style.left=t,A.style.opacity=1},400)):j.transforms?A.style.transform=A.style.webkitTransform="translate3d("+t+",0,0)":A.style.left=t}function v(){var t=T("div");return"undefined"!=typeof t.style.perspective||"undefined"!=typeof t.style.webkitPerspective}function w(){var t=T("div");return t.innerHTML="","http://www.w3.org/2000/svg"===(t.firstChild&&t.firstChild.namespaceURI)}function k(t){t-M>=Y.preload||m(t+1,function(){k(t+1)})}function C(t){M-t>=Y.preload||m(t-1,function(){C(t-1)})}function x(t,e,n,o){t.addEventListener?t.addEventListener(e,n,o):t.attachEvent("on"+e,function(t){(t=t||window.event).target=t.target||t.srcElement,n(t)})}function E(t,e,n,o){t.removeEventListener?t.removeEventListener(e,n,o):t.detachEvent("on"+e,n)}function B(t){return document.getElementById(t)}function T(t){return document.createElement(t)}var N,A,L,S,P,F='',H='',I='',Y={},q={captions:!0,buttons:"auto",fullScreen:!1,noScrollbars:!1,bodyClass:"baguetteBox-open",titleTag:!1,async:!1,preload:2,animation:"slideIn",afterShow:null,afterHide:null,onChange:null,overlayBackgroundColor:"rgba(0,0,0,.8)"},j={},X=[],M=0,R={},O=!1,z=/.+\.(gif|jpe?g|png|webp)/i,D={},V=[],U=null,W=function(t){-1!==t.target.id.indexOf("baguette-img")&&g()},G=function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,h()},J=function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,p()},K=function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,g()},Q=function(t){R.count++,R.count>1&&(R.multitouch=!0),R.startX=t.changedTouches[0].pageX,R.startY=t.changedTouches[0].pageY},Z=function(t){if(!O&&!R.multitouch){t.preventDefault?t.preventDefault():t.returnValue=!1;var e=t.touches[0]||t.changedTouches[0];e.pageX-R.startX>40?(O=!0,h()):e.pageX-R.startX<-40?(O=!0,p()):R.startY-e.pageY>100&&g()}},$=function(){R.count--,R.count<=0&&(R.multitouch=!1),O=!1},_=function(){$()},tt=function(t){"block"===N.style.display&&N.contains&&!N.contains(t.target)&&(t.stopPropagation(),c())};return[].forEach||(Array.prototype.forEach=function(t,e){for(var n=0;n - MIT-style license. -*/ -(function(w){var E=w(window),u,g,F=-1,o,x,D,v,y,L,s,n=!window.XMLHttpRequest,e=window.opera&&(document.compatMode=="CSS1Compat")&&(w.browser.version>=9.3),m=document.documentElement,l={},t=new Image(),J=new Image(),H,a,h,q,I,d,G,c,A,K;w(function(){w("body").append(w([H=w('
')[0],a=w('
')[0],G=w('
')[0]]).css("display","none"));h=w('
').appendTo(a).append(q=w('
').append([I=w('').click(B)[0],d=w('').click(f)[0]])[0])[0];c=w('
').appendTo(G).append([w('').add(H).click(C)[0],A=w('
')[0],K=w('
')[0],w('
')[0]])[0]});w.slimbox=function(O,N,M){u=w.extend({loop:false,overlayOpacity:0.8,overlayFadeDuration:400,resizeDuration:400,resizeEasing:"swing",initialWidth:250,initialHeight:250,imageFadeDuration:400,captionAnimationDuration:400,counterText:"Image {x} of {y}",closeKeys:[27,88,67],previousKeys:[37,80],nextKeys:[39,78]},M);if(typeof O=="string"){O=[[O,N]];N=0}y=E.scrollTop()+((e?m.clientHeight:E.height())/2);L=u.initialWidth;s=u.initialHeight;w(a).css({top:Math.max(0,y-(s/2)),width:L,height:s,marginLeft:-L/2}).show();v=n||(H.currentStyle&&(H.currentStyle.position!="fixed"));if(v){H.style.position="absolute"}w(H).css("opacity",u.overlayOpacity).fadeIn(u.overlayFadeDuration);z();k(1);g=O;u.loop=u.loop&&(g.length>1);return b(N)};w.fn.slimbox=function(M,P,O){P=P||function(Q){return[Q.href,Q.title]};O=O||function(){return true};var N=this;return N.unbind("click").click(function(){var S=this,U=0,T,Q=0,R;T=w.grep(N,function(W,V){return O.call(S,W,V)});for(R=T.length;Q=0)?C():(M(N,u.nextKeys)>=0)?f():(M(N,u.previousKeys)>=0)?B():false}function B(){return b(x)}function f(){return b(D)}function b(M){if(M>=0){F=M;o=g[F][0];x=(F||(u.loop?g.length:0))-1;D=((F+1)%g.length)||(u.loop?0:-1);r();a.className="lbLoading";l=new Image();l.onload=j;l.src=o}return false}function j(){a.className="";w(h).css({backgroundImage:"url("+o+")",visibility:"hidden",display:""});w(q).width(l.width);w([q,I,d]).height(l.height);w(A).html(g[F][1]||"");w(K).html((((g.length>1)&&u.counterText)||"").replace(/{x}/,F+1).replace(/{y}/,g.length));if(x>=0){t.src=g[x][0]}if(D>=0){J.src=g[D][0]}L=h.offsetWidth;s=h.offsetHeight;var M=Math.max(0,y-(s/2));if(a.offsetHeight!=s){w(a).animate({height:s,top:M},u.resizeDuration,u.resizeEasing)}if(a.offsetWidth!=L){w(a).animate({width:L,marginLeft:-L/2},u.resizeDuration,u.resizeEasing)}w(a).queue(function(){w(G).css({width:L,top:M+s,marginLeft:-L/2,visibility:"hidden",display:""});w(h).css({display:"none",visibility:"",opacity:""}).fadeIn(u.imageFadeDuration,i)})}function i(){if(x>=0){w(I).show()}if(D>=0){w(d).show()}w(c).css("marginTop",-c.offsetHeight).animate({marginTop:0},u.captionAnimationDuration);G.style.visibility=""}function r(){l.onload=null;l.src=t.src=J.src=o;w([a,h,c]).stop(true);w([I,d,h,G]).hide()}function C(){if(F>=0){r();F=x=D=-1;w(a).hide();w(H).stop().fadeOut(u.overlayFadeDuration,k)}return false}})(jQuery); diff --git a/javascripts/slimbox/src/autoload.js b/javascripts/slimbox/src/autoload.js deleted file mode 100644 index 4e17f085..00000000 --- a/javascripts/slimbox/src/autoload.js +++ /dev/null @@ -1,6 +0,0 @@ -// AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED) -jQuery(function($) { - $("a[rel^='lightbox']").slimbox({/* Put custom options here */}, null, function(el) { - return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel)); - }); -}); \ No newline at end of file diff --git a/javascripts/slimbox/src/slimbox2.js b/javascripts/slimbox/src/slimbox2.js deleted file mode 100644 index 94fa320a..00000000 --- a/javascripts/slimbox/src/slimbox2.js +++ /dev/null @@ -1,236 +0,0 @@ -/*! - Slimbox v2.02 - The ultimate lightweight Lightbox clone for jQuery - (c) 2007-2009 Christophe Beyls - MIT-style license. -*/ - -(function($) { - - // Global variables, accessible to Slimbox only - var win = $(window), options, images, activeImage = -1, activeURL, prevImage, nextImage, compatibleOverlay, middle, centerWidth, centerHeight, ie6 = !window.XMLHttpRequest, - operaFix = window.opera && (document.compatMode == "CSS1Compat") && ($.browser.version >= 9.3), documentElement = document.documentElement, - - // Preload images - preload = {}, preloadPrev = new Image(), preloadNext = new Image(), - - // DOM elements - overlay, center, image, sizer, prevLink, nextLink, bottomContainer, bottom, caption, number; - - /* - Initialization - */ - - $(function() { - // Append the Slimbox HTML code at the bottom of the document - $("body").append( - $([ - overlay = $('
')[0], - center = $('
')[0], - bottomContainer = $('
')[0] - ]).css("display", "none") - ); - - image = $('
').appendTo(center).append( - sizer = $('
').append([ - prevLink = $('').click(previous)[0], - nextLink = $('').click(next)[0] - ])[0] - )[0]; - - bottom = $('
').appendTo(bottomContainer).append([ - $('').add(overlay).click(close)[0], - caption = $('
')[0], - number = $('
')[0], - $('
')[0] - ])[0]; - }); - - - /* - API - */ - - // Open Slimbox with the specified parameters - $.slimbox = function(_images, startImage, _options) { - options = $.extend({ - loop: false, // Allows to navigate between first and last images - overlayOpacity: 0.8, // 1 is opaque, 0 is completely transparent (change the color in the CSS file) - overlayFadeDuration: 400, // Duration of the overlay fade-in and fade-out animations (in milliseconds) - resizeDuration: 400, // Duration of each of the box resize animations (in milliseconds) - resizeEasing: "swing", // "swing" is jQuery's default easing - initialWidth: 250, // Initial width of the box (in pixels) - initialHeight: 250, // Initial height of the box (in pixels) - imageFadeDuration: 400, // Duration of the image fade-in animation (in milliseconds) - captionAnimationDuration: 400, // Duration of the caption animation (in milliseconds) - counterText: "Image {x} of {y}", // Translate or change as you wish, or set it to false to disable counter text for image groups - closeKeys: [27, 88, 67], // Array of keycodes to close Slimbox, default: Esc (27), 'x' (88), 'c' (67) - previousKeys: [37, 80], // Array of keycodes to navigate to the previous image, default: Left arrow (37), 'p' (80) - nextKeys: [39, 78] // Array of keycodes to navigate to the next image, default: Right arrow (39), 'n' (78) - }, _options); - - // The function is called for a single image, with URL and Title as first two arguments - if (typeof _images == "string") { - _images = [[_images, startImage]]; - startImage = 0; - } - - middle = win.scrollTop() + ((operaFix ? documentElement.clientHeight : win.height()) / 2); - centerWidth = options.initialWidth; - centerHeight = options.initialHeight; - $(center).css({top: Math.max(0, middle - (centerHeight / 2)), width: centerWidth, height: centerHeight, marginLeft: -centerWidth/2}).show(); - compatibleOverlay = ie6 || (overlay.currentStyle && (overlay.currentStyle.position != "fixed")); - if (compatibleOverlay) overlay.style.position = "absolute"; - $(overlay).css("opacity", options.overlayOpacity).fadeIn(options.overlayFadeDuration); - position(); - setup(1); - - images = _images; - options.loop = options.loop && (images.length > 1); - return changeImage(startImage); - }; - - /* - options: Optional options object, see jQuery.slimbox() - linkMapper: Optional function taking a link DOM element and an index as arguments and returning an array containing 2 elements: - the image URL and the image caption (may contain HTML) - linksFilter: Optional function taking a link DOM element and an index as arguments and returning true if the element is part of - the image collection that will be shown on click, false if not. "this" refers to the element that was clicked. - This function must always return true when the DOM element argument is "this". - */ - $.fn.slimbox = function(_options, linkMapper, linksFilter) { - linkMapper = linkMapper || function(el) { - return [el.href, el.title]; - }; - - linksFilter = linksFilter || function() { - return true; - }; - - var links = this; - - return links.unbind("click").click(function() { - // Build the list of images that will be displayed - var link = this, startIndex = 0, filteredLinks, i = 0, length; - filteredLinks = $.grep(links, function(el, i) { - return linksFilter.call(link, el, i); - }); - - // We cannot use jQuery.map() because it flattens the returned array - for (length = filteredLinks.length; i < length; ++i) { - if (filteredLinks[i] == link) startIndex = i; - filteredLinks[i] = linkMapper(filteredLinks[i], i); - } - - return $.slimbox(filteredLinks, startIndex, _options); - }); - }; - - - /* - Internal functions - */ - - function position() { - var l = win.scrollLeft(), w = operaFix ? documentElement.clientWidth : win.width(); - $([center, bottomContainer]).css("left", l + (w / 2)); - if (compatibleOverlay) $(overlay).css({left: l, top: win.scrollTop(), width: w, height: win.height()}); - } - - function setup(open) { - $("object").add(ie6 ? "select" : "embed").each(function(index, el) { - if (open) $.data(el, "slimbox", el.style.visibility); - el.style.visibility = open ? "hidden" : $.data(el, "slimbox"); - }); - var fn = open ? "bind" : "unbind"; - win[fn]("scroll resize", position); - $(document)[fn]("keydown", keyDown); - } - - function keyDown(event) { - var code = event.keyCode, fn = $.inArray; - // Prevent default keyboard action (like navigating inside the page) - return (fn(code, options.closeKeys) >= 0) ? close() - : (fn(code, options.nextKeys) >= 0) ? next() - : (fn(code, options.previousKeys) >= 0) ? previous() - : false; - } - - function previous() { - return changeImage(prevImage); - } - - function next() { - return changeImage(nextImage); - } - - function changeImage(imageIndex) { - if (imageIndex >= 0) { - activeImage = imageIndex; - activeURL = images[activeImage][0]; - prevImage = (activeImage || (options.loop ? images.length : 0)) - 1; - nextImage = ((activeImage + 1) % images.length) || (options.loop ? 0 : -1); - - stop(); - center.className = "lbLoading"; - - preload = new Image(); - preload.onload = animateBox; - preload.src = activeURL; - } - - return false; - } - - function animateBox() { - center.className = ""; - $(image).css({backgroundImage: "url(" + activeURL + ")", visibility: "hidden", display: ""}); - $(sizer).width(preload.width); - $([sizer, prevLink, nextLink]).height(preload.height); - - $(caption).html(images[activeImage][1] || ""); - $(number).html((((images.length > 1) && options.counterText) || "").replace(/{x}/, activeImage + 1).replace(/{y}/, images.length)); - - if (prevImage >= 0) preloadPrev.src = images[prevImage][0]; - if (nextImage >= 0) preloadNext.src = images[nextImage][0]; - - centerWidth = image.offsetWidth; - centerHeight = image.offsetHeight; - var top = Math.max(0, middle - (centerHeight / 2)); - if (center.offsetHeight != centerHeight) { - $(center).animate({height: centerHeight, top: top}, options.resizeDuration, options.resizeEasing); - } - if (center.offsetWidth != centerWidth) { - $(center).animate({width: centerWidth, marginLeft: -centerWidth/2}, options.resizeDuration, options.resizeEasing); - } - $(center).queue(function() { - $(bottomContainer).css({width: centerWidth, top: top + centerHeight, marginLeft: -centerWidth/2, visibility: "hidden", display: ""}); - $(image).css({display: "none", visibility: "", opacity: ""}).fadeIn(options.imageFadeDuration, animateCaption); - }); - } - - function animateCaption() { - if (prevImage >= 0) $(prevLink).show(); - if (nextImage >= 0) $(nextLink).show(); - $(bottom).css("marginTop", -bottom.offsetHeight).animate({marginTop: 0}, options.captionAnimationDuration); - bottomContainer.style.visibility = ""; - } - - function stop() { - preload.onload = null; - preload.src = preloadPrev.src = preloadNext.src = activeURL; - $([center, image, bottom]).stop(true); - $([prevLink, nextLink, image, bottomContainer]).hide(); - } - - function close() { - if (activeImage >= 0) { - stop(); - activeImage = prevImage = nextImage = -1; - $(center).hide(); - $(overlay).stop().fadeOut(options.overlayFadeDuration, setup); - } - - return false; - } - -})(jQuery); \ No newline at end of file