1Drupal.locale = { 'pluralFormula': function ($n) { return Number(($n!=1)); }, 'strings': {"":{"An AJAX HTTP error occurred.":"Houbo un erro HTTP AJAX.","HTTP Result Code: !status":"C\u00f3digo de Resultado HTTP: !status","An AJAX HTTP request terminated abnormally.":"Unha solicitude HTTP de AJAX finalizou de maneira anormal.","Debugging information follows.":"A continuaci\u00f3n det\u00e1llase a informaci\u00f3n de depuraci\u00f3n","Path: !uri":"Ruta: !uri","StatusText: !statusText":"StatusText: !statusText","ResponseText: !responseText":"ResponseText: !responseText","ReadyState: !readyState":"ReadyState: !readyState","Hide":"Agochar","Show":"Amosar","Please wait...":"Espere, por favor...","Next":"Seguinte","Configure":"Configurar","Re-order rows by numerical weight instead of dragging.":"Reordenar as filas por peso num\u00e9rico en lugar de arrastrar.","Show row weights":"Mostrar pesos da fila","Hide row weights":"Ocultar pesos da fila","Drag to re-order":"Arrastre para reordenar","Changes made in this table will not be saved until the form is submitted.":"Os cambios feitos nesta t\u00e1boa non se han gardar ata que se env\u00ede o formulario.","Edit":"Editar","Add":"Engadir","Customize dashboard":"Personalizar panel de control.","View":"Ver","Not published":"Non publicado","Search":"Procurar","(active tab)":"(solapa activa)","Enabled":"Activado","This field is required.":"Este campo \u00e9 necesario.","Sunday":"domingo","Monday":"luns","Tuesday":"martes","Wednesday":"m\u00e9rcores","Thursday":"xoves","Friday":"venres","Saturday":"s\u00e1bado","Disabled":"Desactivado","Mon":"Lun","Select all rows in this table":"Seleccionar todas as filas desta t\u00e1boa","Deselect all rows in this table":"Elminar a selecci\u00f3n de todas as filas desta t\u00e1boa","OK":"Aceptar","none":"ning\u00fan","Upload":"Subir","All":"Todo","Done":"Feito","Prev":"Ant","Tue":"Mar","Wed":"M\u00e9r","Thu":"Xov","Fri":"Ven","Sat":"S\u00e1b","Sun":"Dom","January":"Xaneiro","February":"Febreiro","March":"Marzo","April":"Abril","May":"Mai","June":"Xu\u00f1o","July":"Xullo","August":"Agosto","September":"Setembro","October":"Outubro","November":"Novembro","December":"Decembro","Today":"Hoxe","Jan":"Xan","Feb":"Feb","Mar":"Mar","Apr":"Abr","Jun":"Xu\u00f1","Jul":"Xul","Aug":"Ago","Sep":"Set","Oct":"Out","Nov":"Nov","Dec":"Dec","Su":"Do","Mo":"Lu","Tu":"Ma","We":"M\u00e9","Th":"Xo","Fr":"Ve","Sa":"S\u00e1","mm\/dd\/yy":"mm\/dd\/aa","Only files with the following extensions are allowed: %files-allowed.":"So est\u
100e1n permitidos os ficheiros coas seguintes extensi\u00f3ns: %files-allowed.","By @name on @date":"Por @name en @date","By @name":"Por @name","Not in menu":"Sin menu","Alias: @alias":"Alias: @alias","No alias":"Sen alias","New revision":"Nova revisi\u00f3n","The changes to these blocks will not be saved until the \u003Cem\u003ESave blocks\u003C\/em\u003E button is clicked.":"O cambios a estos bloques non se gardar\u00e1n ate que se prema o bot\u00f3n \u003Cem\u003EGardar bloques\u003C\/em\u003E.","This permission is inherited from the authenticated user role.":"Este permiso \u00e9 herdado do rol de usuario rexistrado.","No revision":"Sen revisi\u00f3n","@number comments per page":"@number comentarios por p\u00e1xina","Requires a title":"Necesita un t\u00edtulo","Not restricted":"Sen restricci\u00f3n","Not customizable":"Non personalizable","Restricted to certain pages":"Restrinxida a determinadas p\u00e1xinas","The block cannot be placed in this region.":"O bloque non pode ser colocado nesta rexi\u00f3n.","Hide summary":"Ocultar resumo","Edit summary":"Editar resumo","Don\u0027t display post information":"Non mostrar informaci\u00f3n do env\u00edo","The selected file %filename cannot be uploaded. Only files with the following extensions are allowed: %extensions.":"O arquivo seleccionado %filename non pode ser subido. S\u00f3 se permiten arquivos cas seguientes extensi\u00f3ns: %extensions.","Autocomplete popup":"Popup con autocompletado","Searching for matches...":"Buscando coincidencias..."}} };; 2/** 3 * @file 4 * Colorbox module init js. 5 */ 6 7(function ($) { 8 9Drupal.behaviors.initColorbox = { 10 attach: function (context, settings) { 11 if (!$.isFunction($('a, area, input', context).colorbox) || typeof settings.colorbox === 'undefined') { 12 return; 13 } 14 15 if (settings.colorbox.mobiledetect && window.matchMedia) { 16 // Disable Colorbox for small screens. 17 var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")"); 18 if (mq.matches) { 19 return; 20 } 21 } 22 23 // Use "data-colorbox-gallery" if set otherwise use "rel". 24 settings.colorbox.rel = function () { 25 if ($(this).data('colorbox-gallery')) { 26 return $(this).data('colorbox-gallery'); 27 } 28 else { 29 return $(this).attr('rel'); 30 } 31 }; 32 33 $('.colorbox', context) 34 .once('init-colorbox').each(function(){ 35 // Only images are supported for the "colorbox" class. 36 // The "photo" setting forces the href attribute to be treated as an image. 37 var extendParams = { 38 photo: true 39 }; 40 // If a title attribute is supplied, sanitize it. 41 var title = $(this).attr('title'); 42 if (title) { 43 extendParams.title = Drupal.colorbox.sanitizeMarkup(title); 44 } 45 $(this).colorbox($.extend({}, settings.colorbox, extendParams)); 46 }); 47 48 $(context).bind('cbox_complete', function () { 49 Drupal.attachBehaviors('#cboxLoadedContent'); 50 }); 51 } 52}; 53 54// Create colorbox namespace if it doesn't exist. 55if (!Drupal.hasOwnProperty('colorbox')) { 56 Drupal.colorbox = {}; 57} 58 59/** 60 * Global function to allow sanitizing captions and control strings. 61 * 62 * @param markup 63 * String containing potential markup. 64 * @return @string 65 * Sanitized string with potentially dangerous markup removed. 66 */ 67Drupal.colorbox.sanitizeMarkup = function(markup) { 68 // If DOMPurify installed, allow some HTML. Otherwise, treat as plain text. 69 if (typeof DOMPurify !== 'undefined') { 70 var purifyConfig = { 71 ALLOWED_TAGS: [ 72 'a', 73 'b', 74 'strong', 75 'i', 76 'em', 77 'u', 78 'cite', 79 'code', 80 'br' 81 ], 82 ALLOWED_ATTR: [ 83 'href', 84 'hreflang', 85 'title', 86 'target' 87 ] 88 } 89 if (Drupal.settings.hasOwnProperty('dompurify_custom_config')) { 90 purifyConfig = Drupal.settings.dompurify_custom_config; 91 } 92 return DOMPurify.sanitize(markup, purifyConfig); 93 } 94 else { 95 return Drupal.checkPlain(markup); 96 } 97} 98 99})(jQuery); 100; 101/** 102 * @file 103 * Colorbox module style js. 104 */ 105 106(function ($) { 107 108Drupal.behaviors.initColorboxDefaultStyle = { 109 attach: function (context, settings) { 110 $(context).bind('cbox_complete', function () { 111 // Only run if there is a title. 112 if ($('#cboxTitle:empty', context).length == false) { 113 $('#cboxLoadedContent img', context).bind('mouseover', function () { 114 $('#cboxTitle', context).slideDown(); 115 }); 116 $('#cboxOverlay', context).bind('mouseover', function () {
117 $('#cboxTitle', context).slideUp(); 118 }); 119 } 120 else { 121 $('#cboxTitle', context).hide(); 122 } 123 }); 124 } 125}; 126 127})(jQuery); 128; 129/** 130 * @file 131 * Colorbox module load js. 132 */ 133(function ($) { 134 135Drupal.behaviors.initColorboxLoad = { 136 attach: function (context, settings) { 137 if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') { 138 return; 139 } 140 141 if (settings.colorbox.mobiledetect && window.matchMedia) { 142 // Disable Colorbox for small screens. 143 var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")"); 144 if (mq.matches) { 145 return; 146 } 147 } 148 149 $.urlParams = function (url) { 150 var p = {}, 151 e, 152 a = /\+/g, // Regex for replacing addition symbol with a space. 153 r = /([^&=]+)=?([^&]*)/g, 154 d = function (s) { return decodeURIComponent(s.replace(a, ' ')); }, 155 q = url.split('?'); 156 while (e = r.exec(q[1])) { 157 e[1] = d(e[1]); 158 e[2] = d(e[2]); 159 switch (e[2].toLowerCase()) { 160 case 'true': 161 case 'yes': 162 e[2] = true; 163 break; 164 case 'false': 165 case 'no': 166 e[2] = false; 167 break; 168 } 169 if (e[1] == 'width') { e[1] = 'innerWidth'; } 170 if (e[1] == 'height') { e[1] = 'innerHeight'; } 171 if (e[2]) { 172 e[2] = Drupal.checkPlain(e[2]); 173 } 174 p[e[1]] = e[2]; 175 } 176 return p; 177 }; 178 179 $('.colorbox-load', context) 180 .once('init-colorbox-load', function () { 181 var href = $(this).attr('href'); 182 183 var params = $.urlParams(href); 184 185 // Always load in an iframe. 186 params.iframe = true; 187 188 // Set inner width and height if not already specified. 189 if (!params.hasOwnProperty('innerWidth')) { 190 params.innerWidth = $(window).width() * .8; 191 } 192 if (!params.hasOwnProperty('innerHeight')) { 193 params.innerHeight = $(window).height() * .8; 194 } 195 196 if (!params.hasOwnProperty('title')) { 197 // If a title attribute is supplied, sanitize it. 198 var title = $(this).attr('title'); 199 if (title) { 200 params.title = Drupal.colorbox.sanitizeMarkup(title); 201 } 202 } 203 $(this).colorbox($.extend({}, settings.colorbox, params)); 204 }); 205 } 206}; 207 208})(jQuery); 209; 210/** 211 * @file 212 * Colorbox module inline js. 213 */ 214 215(function ($) { 216 217Drupal.behaviors.initColorboxInline = { 218 attach: function (context, settings) { 219 if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') { 220 return; 221 } 222 223 if (settings.colorbox.mobiledetect && window.matchMedia) { 224 // Disable Colorbox for small screens. 225 var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")"); 226 if (mq.matches) { 227 return; 228 } 229 } 230 231 $.urlParam = function(name, url){ 232 if (name == 'fragment') { 233 var results = new RegExp('(#[^&#]*)').exec(url); 234 } 235 else { 236 var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(url); 237 } 238 if (!results) { return ''; } 239 return results[1] || ''; 240 }; 241 $('.colorbox-inline', context).once('init-colorbox-inline').colorbox({ 242 transition:settings.colorbox.transition, 243 speed:settings.colorbox.speed, 244 opacity:settings.colorbox.opacity, 245 slideshow:settings.colorbox.slideshow, 246 slideshowAuto:settings.colorbox.slideshowAuto, 247 slideshowSpeed:settings.colorbox.slideshowSpeed, 248 slideshowStart:settings.colorbox.slideshowStart, 249 slideshowStop:settings.colorbox.slideshowStop, 250 current:settings.colorbox.current, 251 previous:settings.colorbox.previous, 252 next:settings.colorbox.next, 253 close:settings.colorbox.close, 254 overlayClose:settings.colorbox.overlayClose, 255 maxWidth:settings.colorbox.maxWidth, 256 maxHeight:settings.colorbox.maxHeight, 257 innerWidth:function(){ 258 return $.urlParam('width', $(this).attr('href')); 259 }, 260 innerHeight:function(){ 261 return $.urlParam('height', $(this).attr('href')); 262 }, 263 title:function(){ 264 return Drupal.colorbox.sanitizeMarkup( 265 decodeURIComponent($.urlParam('title', $(this).attr('href')))); 266 }, 267 iframe:function(){ 268 return $.urlParam('iframe', $(this).attr('href')); 269 }, 270 inline:function(){ 271 return $.urlParam('inline', $(this).attr('href')); 272 }, 273 href:function(){ 274 return $.urlParam('fragment', $(this).attr('href')); 275 } 276 }); 277 } 278}; 279 280})(jQuery); 281; 282/* $Id: lightbox.js,v 1.5.2.6.2.136 2010/09/24 08:39:40 snpower Exp $ */ 283 284/** 285 * jQuery Lightbox 286 * @author 287 * Stella Power, <http://drupal.org/user/66894> 288 * 289 * Based on Lightbox v2.03.3 by Lokesh Dhakar 290 * <http://www.huddletogether.com/projects/lightbox2/> 291 * Also partially based on the jQuery Lightbox by Warren Krewenki 292 * <http://warren.mesozen.com> 293 * 294 * Permission has been granted to Mark Ashmead & other Drupal Lightbox2 module 295 * maintainers to distribute this file via Drupal.org 296 * Under GPL license. 297 * 298 * Slideshow, iframe and video functionality added by Stella Power. 299 */ 300 301var Lightbox; 302(function($) { 303Lightbox = { 304 auto_modal : false, 305 overlayOpacity : 0.8, // Controls transparency of shadow overlay. 306 overlayColor : '000', // Controls colour of shadow overlay. 307 disableCloseClick : true, 308 // Controls the order of the lightbox resizing animation sequence. 309 resizeSequence: 0, // 0: simultaneous, 1: width then height, 2: height then width. 310 resizeSpeed: 'normal', // Controls the speed of the lightbox resizing animation. 311 fadeInSpeed: 'normal', // Controls the speed of the image appearance. 312 slideDownSpeed: 'slow', // Controls the speed of the image details appearance. 313 minWidth: 240, 314 borderSize : 10, 315 boxColor : 'fff', 316 fontColor : '000', 317 topPosition : '', 318 infoHeight: 20, 319 alternative_layout : false, 320 imageArray : [], 321 imageNum : null, 322 total : 0, 323 activeImage : null, 324 inprogress : false, 325 disableResize : false, 326 disableZoom : false, 327 isZoomedIn : false, 328 rtl : false, 329 loopItems : false, 330 keysClose : ['c', 'x', 27], 331 keysPrevious : ['p', 37], 332 keysNext : ['n', 39], 333 keysZoom : ['z'], 334 keysPlayPause : [32], 335 336 // Slideshow options. 337 slideInterval : 5000, // In milliseconds. 338 showPlayPause : true, 339 autoStart : true, 340 autoExit : true, 341 pauseOnNextClick : false, // True to pause the slideshow when the "Next" button is clicked. 342 pauseOnPrevClick : true, // True to pause the slideshow when the "Prev" button is clicked. 343 slideIdArray : [], 344 slideIdCount : 0, 345 isSlideshow : false, 346 isPaused : false, 347 loopSlides : false, 348 349 // Iframe options. 350 isLightframe : false, 351 iframe_width : 600, 352 iframe_height : 400, 353 iframe_border : 1, 354 355 // Video and modal options. 356 enableVideo : false, 357 flvPlayer : '/flvplayer.swf', 358 flvFlashvars : '', 359 isModal : false, 360 isVideo : false, 361 videoId : false, 362 modalWidth : 400,
363 modalHeight : 400, 364 modalHTML : null, 365 366 367 // initialize() 368 // Constructor runs on completion of the DOM loading. 369 // The function inserts html at the bottom of the page which is used 370 // to display the shadow overlay and the image container. 371 initialize: function() { 372 373 var s = Drupal.settings.lightbox2; 374 Lightbox.overlayOpacity = s.overlay_opacity; 375 Lightbox.overlayColor = s.overlay_color; 376 Lightbox.disableCloseClick = s.disable_close_click; 377 Lightbox.resizeSequence = s.resize_sequence; 378 Lightbox.resizeSpeed = s.resize_speed; 379 Lightbox.fadeInSpeed = s.fade_in_speed; 380 Lightbox.slideDownSpeed = s.slide_down_speed; 381 Lightbox.borderSize = s.border_size; 382 Lightbox.boxColor = s.box_color; 383 Lightbox.fontColor = s.font_color; 384 Lightbox.topPosition = s.top_position; 385 Lightbox.rtl = s.rtl; 386 Lightbox.loopItems = s.loop_items; 387 Lightbox.keysClose = s.keys_close.split(" "); 388 Lightbox.keysPrevious = s.keys_previous.split(" "); 389 Lightbox.keysNext = s.keys_next.split(" "); 390 Lightbox.keysZoom = s.keys_zoom.split(" "); 391 Lightbox.keysPlayPause = s.keys_play_pause.split(" "); 392 Lightbox.disableResize = s.disable_resize; 393 Lightbox.disableZoom = s.disable_zoom; 394 Lightbox.slideInterval = s.slideshow_interval; 395 Lightbox.showPlayPause = s.show_play_pause; 396 Lightbox.showCaption = s.show_caption; 397 Lightbox.autoStart = s.slideshow_automatic_start; 398 Lightbox.autoExit = s.slideshow_automatic_exit; 399 Lightbox.pauseOnNextClick = s.pause_on_next_click; 400 Lightbox.pauseOnPrevClick = s.pause_on_previous_click; 401 Lightbox.loopSlides = s.loop_slides; 402 Lightbox.alternative_layout = s.use_alt_layout; 403 Lightbox.iframe_width = s.iframe_width; 404 Lightbox.iframe_height = s.iframe_height; 405 Lightbox.iframe_border = s.iframe_border; 406 Lightbox.enableVideo = s.enable_video; 407 if (s.enable_video) { 408 Lightbox.flvPlayer = s.flvPlayer; 409 Lightbox.flvFlashvars = s.flvFlashvars; 410 } 411 412 // Make the lightbox divs. 413 var layout_class = (s.use_alt_layout ? 'lightbox2-alt-layout' : 'lightbox2-orig-layout'); 414 var output = '<div id="lightbox2-overlay" style="display: none;"></div>\ 415 <div id="lightbox" style="display: none;" class="' + layout_class + '">\ 416 <div id="outerImageContainer"></div>\ 417 <div id="imageDataContainer" class="clearfix">\ 418 <div id="imageData"></div>\ 419 </div>\ 420 </div>'; 421 var loading = '<div id="loading"><a href="#" id="loadingLink"></a></div>'; 422 var modal = '<div id="modalContainer" style="display: none;"></div>'; 423 var frame = '<div id="frameContainer" style="display: none;"></div>'; 424 var imageContainer = '<div id="imageContainer" style="display: none;"></div>'; 425 var details = '<div id="imageDetails"></div>'; 426 var bottomNav = '<div id="bottomNav"></div>'; 427 var image = '<img id="lightboxImage" alt="" />'; 428 var hoverNav = '<div id="hoverNav"><a id="prevLink" href="#"></a><a id="nextLink" href="#"></a></div>'; 429 var frameNav = '<div id="frameHoverNav"><a id="framePrevLink" href="#"></a><a id="frameNextLink" href="#"></a></div>'; 430 var hoverNav = '<div id="hoverNav"><a id="prevLink" title="' + Drupal.t('Previous') + '" href="#"></a><a id="nextLink" title="' + Drupal.t('Next') + '" href="#"></a></div>'; 431 var frameNav = '<div id="frameHoverNav"><a id="framePrevLink" title="' + Drupal.t('Previous') + '" href="#"></a><a id="frameNextLink" title="' + Drupal.t('Next') + '" href="#"></a></div>'; 432 var caption = '<span id="caption"></span>'; 433 var numberDisplay = '<span id="numberDisplay"></span>'; 434 var close = '<a id="bottomNavClose" title="' + Drupal.t('Close') + '" href="#"></a>'; 435 var zoom = '<a id="bottomNavZoom" href="#"></a>'; 436 var zoomOut = '<a id="bottomNavZoomOut" href="#"></a>'; 437 var pause = '<a id="lightshowPause" title="' + Drupal.t('Pause Slideshow') + '" href="#" style="display: none;"></a>'; 438 var play = '<a id="lightshowPlay" title="' + Drupal.t('Play Slideshow') + '" href="#" style="display: none;"></a>'; 439 440 $("body").append(output); 441 $('#outerImageContainer').append(modal + frame + imageContainer + loading); 442 if (!s.use_alt_layout) { 443 $('#imageContainer').append(image + hoverNav);
444 $('#imageData').append(details + bottomNav); 445 $('#imageDetails').append(caption + numberDisplay); 446 $('#bottomNav').append(frameNav + close + zoom + zoomOut + pause + play); 447 } 448 else { 449 $('#outerImageContainer').append(bottomNav); 450 $('#imageContainer').append(image); 451 $('#bottomNav').append(close + zoom + zoomOut); 452 $('#imageData').append(hoverNav + details); 453 $('#imageDetails').append(caption + numberDisplay + pause + play); 454 } 455 456 // Setup onclick handlers. 457 if (Lightbox.disableCloseClick) { 458 $('#lightbox2-overlay').click(function() { Lightbox.end(); return false; } ).hide(); 459 } 460 $('#loadingLink, #bottomNavClose').click(function() { Lightbox.end('forceClose'); return false; } ); 461 $('#prevLink, #framePrevLink').click(function() { Lightbox.changeData(Lightbox.activeImage - 1); return false; } ); 462 $('#nextLink, #frameNextLink').click(function() { Lightbox.changeData(Lightbox.activeImage + 1); return false; } ); 463 $('#bottomNavZoom').click(function() { Lightbox.changeData(Lightbox.activeImage, true); return false; } ); 464 $('#bottomNavZoomOut').click(function() { Lightbox.changeData(Lightbox.activeImage, false); return false; } ); 465 $('#lightshowPause').click(function() { Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); return false; } ); 466 $('#lightshowPlay').click(function() { Lightbox.togglePlayPause("lightshowPlay", "lightshowPause"); return false; } ); 467 468 // Fix positioning. 469 $('#prevLink, #nextLink, #framePrevLink, #frameNextLink').css({ 'paddingTop': Lightbox.borderSize + 'px'}); 470 $('#imageContainer, #frameContainer, #modalContainer').css({ 'padding': Lightbox.borderSize + 'px'}); 471 $('#outerImageContainer, #imageDataContainer, #bottomNavClose').css({'backgroundColor': '#' + Lightbox.boxColor, 'color': '#'+Lightbox.fontColor}); 472 if (Lightbox.alternative_layout) { 473 $('#bottomNavZoom, #bottomNavZoomOut').css({'bottom': Lightbox.borderSize + 'px', 'right': Lightbox.borderSize + 'px'}); 474 } 475 else if (Lightbox.rtl == 1 && Drupal.settings.lightbox2.useragent.search('MSIE') !== -1) { 476 $('#bottomNavZoom, #bottomNavZoomOut').css({'left': '0px'}); 477 } 478 479 // Force navigation links to always be displayed 480 if (s.force_show_nav) { 481 $('#prevLink, #nextLink').addClass("force_show_nav"); 482 } 483 484 }, 485 486 // initList() 487 // Loops through anchor tags looking for 'lightbox', 'lightshow' and 488 // 'lightframe', etc, references and applies onclick events to appropriate 489 // links. You can rerun after dynamically adding images w/ajax. 490 initList : function(context) { 491 492 if (context == undefined || context == null) { 493 context = document; 494 } 495 496 // Attach lightbox to any links with rel 'lightbox', 'lightshow' or 497 // 'lightframe', etc. 498 $("a[rel^='lightbox']:not(.lightbox-processed), area[rel^='lightbox']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { 499 if (Lightbox.disableCloseClick) { 500 $('#lightbox').unbind('click'); 501 $('#lightbox').click(function() { Lightbox.end('forceClose'); } ); 502 } 503 Lightbox.start(this, false, false, false, false); 504 if (e.preventDefault) { e.preventDefault(); } 505 return false; 506 }); 507 $("a[rel^='lightshow']:not(.lightbox-processed), area[rel^='lightshow']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { 508 if (Lightbox.disableCloseClick) { 509 $('#lightbox').unbind('click'); 510 $('#lightbox').click(function() { Lightbox.end('forceClose'); } ); 511 } 512 Lightbox.start(this, true, false, false, false); 513 if (e.preventDefault) { e.preventDefault(); } 514 return false; 515 }); 516 $("a[rel^='lightframe']:not(.lightbox-processed), area[rel^='lightframe']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { 517 if (Lightbox.disableCloseClick) { 518 $('#lightbox').unbind('click'); 519 $('#lightbox').click(function() { Lightbox.end('forceClose'); } ); 520 } 521 Lightbox.start(this, false, true, false, false); 522 if (e.preventDefault) { e.preventDefault(); } 523 return false;
524 }); 525 if (Lightbox.enableVideo) { 526 $("a[rel^='lightvideo']:not(.lightbox-processed), area[rel^='lightvideo']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { 527 if (Lightbox.disableCloseClick) { 528 $('#lightbox').unbind('click'); 529 $('#lightbox').click(function() { Lightbox.end('forceClose'); } ); 530 } 531 Lightbox.start(this, false, false, true, false); 532 if (e.preventDefault) { e.preventDefault(); } 533 return false; 534 }); 535 } 536 $("a[rel^='lightmodal']:not(.lightbox-processed), area[rel^='lightmodal']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { 537 $('#lightbox').unbind('click'); 538 // Add classes from the link to the lightbox div - don't include lightbox-processed 539 $('#lightbox').addClass($(this).attr('class')); 540 $('#lightbox').removeClass('lightbox-processed'); 541 Lightbox.start(this, false, false, false, true); 542 if (e.preventDefault) { e.preventDefault(); } 543 return false; 544 }); 545 $("#lightboxAutoModal:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { 546 Lightbox.auto_modal = true; 547 $('#lightbox').unbind('click'); 548 Lightbox.start(this, false, false, false, true); 549 if (e.preventDefault) { e.preventDefault(); } 550 return false; 551 }); 552 }, 553 554 // start() 555 // Display overlay and lightbox. If image is part of a set, add siblings to 556 // imageArray. 557 start: function(imageLink, slideshow, lightframe, lightvideo, lightmodal) { 558 559 Lightbox.isPaused = !Lightbox.autoStart; 560 561 // Replaces hideSelectBoxes() and hideFlash() calls in original lightbox2. 562 Lightbox.toggleSelectsFlash('hide'); 563 564 // Stretch overlay to fill page and fade in. 565 var arrayPageSize = Lightbox.getPageSize(); 566 $("#lightbox2-overlay").hide().css({ 567 'width': '100%', 568 'zIndex': '10090', 569 'height': arrayPageSize[1] + 'px', 570 'backgroundColor' : '#' + Lightbox.overlayColor 571 }); 572 // Detect OS X FF2 opacity + flash issue. 573 if (lightvideo && this.detectMacFF2()) { 574 $("#lightbox2-overlay").removeClass("overlay_default"); 575 $("#lightbox2-overlay").addClass("overlay_macff2"); 576 $("#lightbox2-overlay").css({'opacity' : null}); 577 } 578 else { 579 $("#lightbox2-overlay").removeClass("overlay_macff2"); 580 $("#lightbox2-overlay").addClass("overlay_default"); 581 $("#lightbox2-overlay").css({'opacity' : Lightbox.overlayOpacity}); 582 } 583 $("#lightbox2-overlay").fadeIn(Lightbox.fadeInSpeed); 584 585 586 Lightbox.isSlideshow = slideshow; 587 Lightbox.isLightframe = lightframe; 588 Lightbox.isVideo = lightvideo; 589 Lightbox.isModal = lightmodal; 590 Lightbox.imageArray = []; 591 Lightbox.imageNum = 0; 592 593 var anchors = $(imageLink.tagName); 594 var anchor = null; 595 var rel_parts = Lightbox.parseRel(imageLink); 596 var rel = rel_parts["rel"]; 597 var rel_group = rel_parts["group"]; 598 var title = (rel_parts["title"] ? rel_parts["title"] : imageLink.title); 599 var rel_style = null; 600 var i = 0; 601 602 if (rel_parts["flashvars"]) { 603 Lightbox.flvFlashvars = Lightbox.flvFlashvars + '&' + rel_parts["flashvars"]; 604 } 605 606 // Set the title for image alternative text. 607 var alt = imageLink.title; 608 if (!alt) { 609 var img = $(imageLink).find("img"); 610 if (img && $(img).attr("alt")) { 611 alt = $(img).attr("alt"); 612 } 613 else { 614 alt = title; 615 } 616 } 617 618 if ($(imageLink).attr('id') == 'lightboxAutoModal') { 619 rel_style = rel_parts["style"]; 620 Lightbox.imageArray.push(['#lightboxAutoModal > *', title, alt, rel_style, 1]); 621 } 622 else { 623 // Handle lightbox images with no grouping. 624 if ((rel == 'lightbox' || rel == 'lightshow') && !rel_group) { 625 Lightbox.imageArray.push([imageLink.href, title, alt]); 626 } 627 628 // Handle other items with no grouping. 629 else if (!rel_group) { 630 rel_style = rel_parts["style"]; 631 Lightbox.imageArray.push([imageLink.href, title, alt, rel_style]); 632 } 633 634 // Handle grouped items. 635 else { 636 637 // Loop through anchors and add them to imageArray. 638 for (i = 0; i < anchors.length; i++) { 639 anchor = anchors[i]; 640 if (anchor.href && typeof(anchor.href) == "string" && $(anchor).attr('rel')) { 641 var rel_data = Lightbox.parseRel(anchor); 642 var anchor_title = (rel_data["title"] ? rel_data["title"] : anchor.title); 643 img_alt = anchor.title; 644 if (!img_alt) { 645 var anchor_img = $(anchor).find("img"); 646 if (anchor_img && $(anchor_img).attr("alt")) { 647 img_alt = $(anchor_img).attr("alt"); 648 } 649 else { 650 img_alt = title; 651 } 652 } 653 if (rel_data["rel"] == rel) { 654 if (rel_data["group"] == rel_group) { 655 if (Lightbox.isLightframe || Lightbox.isModal || Lightbox.isVideo) { 656 rel_style = rel_data["style"]; 657 } 658 Lightbox.imageArray.push([anchor.href, anchor_title, img_alt, rel_style]); 659 } 660 } 661 } 662 } 663 664 // Remove duplicates. 665 for (i = 0; i < Lightbox.imageArray.length; i++) { 666 for (j = Lightbox.imageArray.length-1; j > i; j--) { 667 if (Lightbox.imageArray[i][0] == Lightbox.imageArray[j][0]) { 668 Lightbox.imageArray.splice(j,1); 669 } 670 } 671 } 672 while (Lightbox.imageArray[Lightbox.imageNum][0] != imageLink.href) { 673 Lightbox.imageNum++; 674 } 675 } 676 } 677 678 if (Lightbox.isSlideshow && Lightbox.showPlayPause && Lightbox.isPaused) { 679 $('#lightshowPlay').show(); 680 $('#lightshowPause').hide(); 681 } 682 683 // Calculate top and left offset for the lightbox. 684 var arrayPageScroll = Lightbox.getPageScroll(); 685 var lightboxTop = arrayPageScroll[1] + (Lightbox.topPosition == '' ? (arrayPageSize[3] / 10) : Lightbox.topPosition) * 1; 686 var lightboxLeft = arrayPageScroll[0]; 687 $('#frameContainer, #modalContainer, #lightboxImage').hide();
688 $('#hoverNav, #prevLink, #nextLink, #frameHoverNav, #framePrevLink, #frameNextLink').hide(); 689 $('#imageDataContainer, #numberDisplay, #bottomNavZoom, #bottomNavZoomOut').hide(); 690 $('#outerImageContainer').css({'width': '250px', 'height': '250px'}); 691 $('#lightbox').css({ 692 'zIndex': '10500', 693 'top': lightboxTop + 'px', 694 'left': lightboxLeft + 'px' 695 }).show(); 696 697 Lightbox.total = Lightbox.imageArray.length; 698 Lightbox.changeData(Lightbox.imageNum); 699 }, 700 701 // changeData() 702 // Hide most elements and preload image in preparation for resizing image 703 // container. 704 changeData: function(imageNum, zoomIn) { 705 706 if (Lightbox.inprogress === false) { 707 if (Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) { 708 if (imageNum >= Lightbox.total) imageNum = 0; 709 if (imageNum < 0) imageNum = Lightbox.total - 1; 710 } 711 712 if (Lightbox.isSlideshow) { 713 for (var i = 0; i < Lightbox.slideIdCount; i++) { 714 window.clearTimeout(Lightbox.slideIdArray[i]); 715 } 716 } 717 Lightbox.inprogress = true; 718 Lightbox.activeImage = imageNum; 719 720 if (Lightbox.disableResize && !Lightbox.isSlideshow) { 721 zoomIn = true; 722 } 723 Lightbox.isZoomedIn = zoomIn; 724 725 726 // Hide elements during transition. 727 $('#loading').css({'zIndex': '10500'}).show(); 728 if (!Lightbox.alternative_layout) { 729 $('#imageContainer').hide(); 730 } 731 $('#frameContainer, #modalContainer, #lightboxImage').hide(); 732 $('#hoverNav, #prevLink, #nextLink, #frameHoverNav, #framePrevLink, #frameNextLink').hide(); 733 $('#imageDataContainer, #numberDisplay, #bottomNavZoom, #bottomNavZoomOut').hide(); 734 735 // Preload image content, but not iframe pages. 736 if (!Lightbox.isLightframe && !Lightbox.isVideo && !Lightbox.isModal) { 737 $("#lightbox #imageDataContainer").removeClass('lightbox2-alt-layout-data'); 738 imgPreloader = new Image(); 739 imgPreloader.onerror = function() { Lightbox.imgNodeLoadingError(this); }; 740 741 imgPreloader.onload = function() { 742 var photo = document.getElementById('lightboxImage'); 743 photo.src = Lightbox.imageArray[Lightbox.activeImage][0]; 744 photo.alt = Lightbox.imageArray[Lightbox.activeImage][2]; 745 746 var imageWidth = imgPreloader.width; 747 var imageHeight = imgPreloader.height; 748 749 // Resize code. 750 var arrayPageSize = Lightbox.getPageSize(); 751 var targ = { w:arrayPageSize[2] - (Lightbox.borderSize * 2), h:arrayPageSize[3] - (Lightbox.borderSize * 6) - (Lightbox.infoHeight * 4) - (arrayPageSize[3] / 10) }; 752 var orig = { w:imgPreloader.width, h:imgPreloader.height }; 753 754 // Image is very large, so show a smaller version of the larger image 755 // with zoom button. 756 if (zoomIn !== true) { 757 var ratio = 1.0; // Shrink image with the same aspect. 758 $('#bottomNavZoomOut, #bottomNavZoom').hide(); 759 if ((orig.w >= targ.w || orig.h >= targ.h) && orig.h && orig.w) { 760 ratio = ((targ.w / orig.w) < (targ.h / orig.h)) ? targ.w / orig.w : targ.h / orig.h; 761 if (!Lightbox.disableZoom && !Lightbox.isSlideshow) { 762 $('#bottomNavZoom').css({'zIndex': '10500'}).show(); 763 } 764 } 765 766 imageWidth = Math.floor(orig.w * ratio); 767 imageHeight = Math.floor(orig.h * ratio); 768 } 769 770 else { 771 $('#bottomNavZoom').hide();
772 // Only display zoom out button if the image is zoomed in already. 773 if ((orig.w >= targ.w || orig.h >= targ.h) && orig.h && orig.w) { 774 // Only display zoom out button if not a slideshow and if the 775 // buttons aren't disabled. 776 if (!Lightbox.disableResize && Lightbox.isSlideshow === false && !Lightbox.disableZoom) { 777 $('#bottomNavZoomOut').css({'zIndex': '10500'}).show(); 778 } 779 } 780 } 781 782 photo.style.width = (imageWidth) + 'px'; 783 photo.style.height = (imageHeight) + 'px'; 784 Lightbox.resizeContainer(imageWidth, imageHeight); 785 786 // Clear onLoad, IE behaves irratically with animated gifs otherwise. 787 imgPreloader.onload = function() {}; 788 }; 789 790 imgPreloader.src = Lightbox.imageArray[Lightbox.activeImage][0]; 791 imgPreloader.alt = Lightbox.imageArray[Lightbox.activeImage][2]; 792 } 793 794 // Set up frame size, etc. 795 else if (Lightbox.isLightframe) { 796 $("#lightbox #imageDataContainer").addClass('lightbox2-alt-layout-data'); 797 var src = Lightbox.imageArray[Lightbox.activeImage][0]; 798 $('#frameContainer').html('<iframe id="lightboxFrame" style="display: none;" src="'+src+'"></iframe>'); 799 800 // Enable swf support in Gecko browsers. 801 if (Drupal.settings.lightbox2.useragent.search('Mozilla') !== -1 && src.indexOf('.swf') != -1) { 802 setTimeout(function () { 803 document.getElementById("lightboxFrame").src = Lightbox.imageArray[Lightbox.activeImage][0]; 804 }, 1000); 805 } 806 807 if (!Lightbox.iframe_border) { 808 $('#lightboxFrame').css({'border': 'none'}); 809 $('#lightboxFrame').attr('frameborder', '0'); 810 } 811 var iframe = document.getElementById('lightboxFrame'); 812 var iframeStyles = Lightbox.imageArray[Lightbox.activeImage][3]; 813 iframe = Lightbox.setStyles(iframe, iframeStyles); 814 Lightbox.resizeContainer(parseInt(iframe.width, 10), parseInt(iframe.height, 10)); 815 } 816 else if (Lightbox.isVideo || Lightbox.isModal) { 817 $("#lightbox #imageDataContainer").addClass('lightbox2-alt-layout-data'); 818 var container = document.getElementById('modalContainer'); 819 var modalStyles = Lightbox.imageArray[Lightbox.activeImage][3]; 820 container = Lightbox.setStyles(container, modalStyles); 821 if (Lightbox.isVideo) { 822 Lightbox.modalHeight = parseInt(container.height, 10) - 10; 823 Lightbox.modalWidth = parseInt(container.width, 10) - 10; 824 Lightvideo.startVideo(Lightbox.imageArray[Lightbox.activeImage][0]); 825 } 826 Lightbox.resizeContainer(parseInt(container.width, 10), parseInt(container.height, 10)); 827 } 828 } 829 }, 830 831 // imgNodeLoadingError() 832 imgNodeLoadingError: function(image) { 833 var s = Drupal.settings.lightbox2; 834 var original_image = Lightbox.imageArray[Lightbox.activeImage][0]; 835 if (s.display_image_size !== "") { 836 original_image = original_image.replace(new RegExp("."+s.display_image_size), ""); 837 } 838 Lightbox.imageArray[Lightbox.activeImage][0] = original_image; 839 image.onerror = function() { Lightbox.imgLoadingError(image); }; 840 image.src = original_image; 841 }, 842 843 // imgLoadingError() 844 imgLoadingError: function(image) { 845 var s = Drupal.settings.lightbox2; 846 Lightbox.imageArray[Lightbox.activeImage][0] = s.default_image; 847 image.src = s.default_image; 848 }, 849 850 // resizeContainer() 851 resizeContainer: function(imgWidth, imgHeight) { 852 853 imgWidth = (imgWidth < Lightbox.minWidth ? Lightbox.minWidth : imgWidth); 854 855 this.widthCurrent = $('#outerImageContainer').width(); 856 this.heightCurrent = $('#outerImageContainer').height(); 857 858 var widthNew = (imgWidth + (Lightbox.borderSize * 2)); 859 var heightNew = (imgHeight + (Lightbox.borderSize * 2)); 860 861 // Scalars based on change from old to new. 862 this.xScale = ( widthNew / this.widthCurrent) * 100; 863 this.yScale = ( heightNew / this.heightCurrent) * 100; 864 865 // Calculate size difference between new and old image, and resize if 866 // necessary. 867 wDiff = this.widthCurrent - widthNew; 868 hDiff = this.heightCurrent - heightNew; 869 870 $('#modalContainer').css({'width': imgWidth, 'height': imgHeight}); 871 // Detect animation sequence. 872 if (Lightbox.resizeSequence) { 873 var animate1 = {width: widthNew}; 874 var animate2 = {height: heightNew}; 875 if (Lightbox.resizeSequence == 2) { 876 animate1 = {height: heightNew}; 877 animate2 = {width: widthNew}; 878 } 879 $('#outerImageContainer').animate(animate1, Lightbox.resizeSpeed).animate(animate2, Lightbox.resizeSpeed, 'linear', function() { Lightbox.showData(); }); 880 } 881 // Simultaneous. 882 else { 883 $('#outerImageContainer').animate({'width': widthNew, 'height': heightNew}, Lightbox.resizeSpeed, 'linear', function() { Lightbox.showData(); }); 884 } 885 886 // If new and old image are same size and no scaling transition is necessary 887 // do a quick pause to prevent image flicker. 888 if ((hDiff === 0) && (wDiff === 0)) { 889 if (Drupal.settings.lightbox2.useragent.search('MSIE') !== -1) { 890 Lightbox.pause(250); 891 } 892 else { 893 Lightbox.pause(100); 894 } 895 } 896 897 var s = Drupal.settings.lightbox2; 898 if (!s.use_alt_layout) { 899 $('#prevLink, #nextLink').css({'height': imgHeight + 'px'}); 900 } 901 $('#imageDataContainer').css({'width': widthNew + 'px'}); 902 }, 903 904 // showData() 905 // Display image and begin preloading neighbors. 906 showData: function() { 907 $('#loading').hide(); 908 909 if (Lightbox.isLightframe || Lightbox.isVideo || Lightbox.isModal) { 910 Lightbox.updateDetails(); 911 if (Lightbox.isLightframe) { 912 $('#frameContainer').show(); 913 if (Drupal.settings.lightbox2.useragent.search('Safari') !== -1 || Lightbox.fadeInSpeed === 0) { 914 $('#lightboxFrame').css({'zIndex': '10500'}).show(); 915 } 916 else { 917 $('#lightboxFrame').css({'zIndex': '10500'}).fadeIn(Lightbox.fadeInSpeed); 918 } 919 } 920 else { 921 if (Lightbox.isVideo) { 922 $("#modalContainer").html(Lightbox.modalHTML).click(function(){return false;}).css('zIndex', '10500').show(); 923 } 924 else { 925 var src = unescape(Lightbox.imageArray[Lightbox.activeImage][0]); 926 if (Lightbox.imageArray[Lightbox.activeImage][4]) { 927 $(src).appendTo("#modalContainer"); 928 $('#modalContainer').css({'zIndex': '10500'}).show(); 929 } 930 else { 931 // Use a callback to show the new image, otherwise you get flicker. 932 $("#modalContainer").hide().load(src, function () {$('#modalContainer').css({'zIndex': '10500'}).show();}); 933 } 934 $('#modalContainer').unbind('click'); 935 } 936 // This might be needed in the Lightframe section above. 937 //$('#modalContainer').css({'zIndex': '10500'}).show(); 938 } 939 } 940 941 // Handle display of image content. 942 else { 943 $('#imageContainer').show(); 944 if (Drupal.settings.lightbox2.useragent.search('Safari') !== -1 || Lightbox.fadeInSpeed === 0) { 945 $('#lightboxImage').css({'zIndex': '10500'}).show(); 946 } 947 else { 948 $('#lightboxImage').css({'zIndex': '10500'}).fadeIn(Lightbox.fadeInSpeed); 949 } 950 Lightbox.updateDetails(); 951 this.preloadNeighborImages(); 952 } 953 Lightbox.inprogress = false;
954 955 // Slideshow specific stuff. 956 if (Lightbox.isSlideshow) { 957 if (!Lightbox.loopSlides && Lightbox.activeImage == (Lightbox.total - 1)) { 958 if (Lightbox.autoExit) { 959 Lightbox.slideIdArray[Lightbox.slideIdCount++] = setTimeout(function () {Lightbox.end('slideshow');}, Lightbox.slideInterval); 960 } 961 } 962 else { 963 if (!Lightbox.isPaused && Lightbox.total > 1) { 964 Lightbox.slideIdArray[Lightbox.slideIdCount++] = setTimeout(function () {Lightbox.changeData(Lightbox.activeImage + 1);}, Lightbox.slideInterval); 965 } 966 } 967 if (Lightbox.showPlayPause && Lightbox.total > 1 && !Lightbox.isPaused) { 968 $('#lightshowPause').show(); 969 $('#lightshowPlay').hide(); 970 } 971 else if (Lightbox.showPlayPause && Lightbox.total > 1) { 972 $('#lightshowPause').hide(); 973 $('#lightshowPlay').show(); 974 } 975 } 976 977 // Adjust the page overlay size. 978 var arrayPageSize = Lightbox.getPageSize(); 979 var arrayPageScroll = Lightbox.getPageScroll(); 980 var pageHeight = arrayPageSize[1]; 981 if (Lightbox.isZoomedIn && arrayPageSize[1] > arrayPageSize[3]) { 982 var lightboxTop = (Lightbox.topPosition == '' ? (arrayPageSize[3] / 10) : Lightbox.topPosition) * 1; 983 pageHeight = pageHeight + arrayPageScroll[1] + lightboxTop; 984 } 985 $('#lightbox2-overlay').css({'height': pageHeight + 'px', 'width': arrayPageSize[0] + 'px'}); 986 987 // Gecko browsers (e.g. Firefox, SeaMonkey, etc) don't handle pdfs as 988 // expected. 989 if (Drupal.settings.lightbox2.useragent.search('Mozilla') !== -1) { 990 if (Lightbox.imageArray[Lightbox.activeImage][0].indexOf(".pdf") != -1) { 991 setTimeout(function () { 992 document.getElementById("lightboxFrame").src = Lightbox.imageArray[Lightbox.activeImage][0]; 993 }, 1000); 994 } 995 } 996 }, 997 998 // updateDetails() 999 // Display caption, image number, and bottom nav. 1000 updateDetails: function() { 1001 1002 $("#imageDataContainer").hide(); 1003 1004 var s = Drupal.settings.lightbox2; 1005 1006 if (s.show_caption) { 1007 var caption = Lightbox.filterXSS(Lightbox.imageArray[Lightbox.activeImage][1]); 1008 if (!caption) caption = ''; 1009 $('#caption').html(caption).css({'zIndex': '10500'}).show(); 1010 } 1011 1012 // If image is part of set display 'Image x of x'. 1013 var numberDisplay = null; 1014 if (s.image_count && Lightbox.total > 1) { 1015 var currentImage = Lightbox.activeImage + 1; 1016 if (!Lightbox.isLightframe && !Lightbox.isModal && !Lightbox.isVideo) { 1017 numberDisplay = s.image_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total); 1018 } 1019 else if (Lightbox.isVideo) { 1020 numberDisplay = s.video_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total); 1021 } 1022 else { 1023 numberDisplay = s.page_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total); 1024 }
1025 $('#numberDisplay').html(numberDisplay).css({'zIndex': '10500'}).show(); 1026 } 1027 else { 1028 $('#numberDisplay').hide(); 1029 } 1030 1031 $("#imageDataContainer").hide().slideDown(Lightbox.slideDownSpeed, function() { 1032 $("#bottomNav").show(); 1033 }); 1034 if (Lightbox.rtl == 1) { 1035 $("#bottomNav").css({'float': 'left'}); 1036 } 1037 Lightbox.updateNav(); 1038 }, 1039 1040 // updateNav() 1041 // Display appropriate previous and next hover navigation. 1042 updateNav: function() { 1043 1044 $('#hoverNav').css({'zIndex': '10500'}).show(); 1045 var prevLink = '#prevLink'; 1046 var nextLink = '#nextLink'; 1047 1048 // Slideshow is separated as we need to show play / pause button. 1049 if (Lightbox.isSlideshow) { 1050 if ((Lightbox.total > 1 && Lightbox.loopSlides) || Lightbox.activeImage !== 0) { 1051 $(prevLink).css({'zIndex': '10500'}).show().click(function() { 1052 if (Lightbox.pauseOnPrevClick) { 1053 Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); 1054 } 1055 Lightbox.changeData(Lightbox.activeImage - 1); return false; 1056 }); 1057 } 1058 else { 1059 $(prevLink).hide(); 1060 } 1061 1062 // If not last image in set, display next image button. 1063 if ((Lightbox.total > 1 && Lightbox.loopSlides) || Lightbox.activeImage != (Lightbox.total - 1)) { 1064 $(nextLink).css({'zIndex': '10500'}).show().click(function() { 1065 if (Lightbox.pauseOnNextClick) { 1066 Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); 1067 } 1068 Lightbox.changeData(Lightbox.activeImage + 1); return false; 1069 }); 1070 } 1071 // Safari browsers need to have hide() called again. 1072 else { 1073 $(nextLink).hide(); 1074 } 1075 } 1076 1077 // All other types of content. 1078 else { 1079 1080 if ((Lightbox.isLightframe || Lightbox.isModal || Lightbox.isVideo) && !Lightbox.alternative_layout) { 1081 $('#frameHoverNav').css({'zIndex': '10500'}).show(); 1082 $('#hoverNav').css({'zIndex': '10500'}).hide(); 1083 prevLink = '#framePrevLink'; 1084 nextLink = '#frameNextLink'; 1085 } 1086 1087 // If not first image in set, display prev image button. 1088 if ((Lightbox.total > 1 && Lightbox.loopItems) || Lightbox.activeImage !== 0) { 1089 // Unbind any other click handlers, otherwise this adds a new click handler 1090 // each time the arrow is clicked. 1091 $(prevLink).css({'zIndex': '10500'}).show().unbind().click(function() { 1092 Lightbox.changeData(Lightbox.activeImage - 1); return false; 1093 }); 1094 } 1095 // Safari browsers need to have hide() called again. 1096 else { 1097 $(prevLink).hide(); 1098 } 1099 1100 // If not last image in set, display next image button. 1101 if ((Lightbox.total > 1 && Lightbox.loopItems) || Lightbox.activeImage != (Lightbox.total - 1)) { 1102 // Unbind any other click handlers, otherwise this adds a new click handler 1103 // each time the arrow is clicked. 1104 $(nextLink).css({'zIndex': '10500'}).show().unbind().click(function() { 1105 Lightbox.changeData(Lightbox.activeImage + 1); return false; 1106 }); 1107 } 1108 // Safari browsers need to have hide() called again. 1109 else { 1110 $(nextLink).hide(); 1111 } 1112 } 1113 1114 // Don't enable keyboard shortcuts so forms will work. 1115 if (!Lightbox.isModal) { 1116 this.enableKeyboardNav(); 1117 } 1118 }, 1119 1120 1121 // enableKeyboardNav() 1122 enableKeyboardNav: function() { 1123 $(document).bind("keydown", this.keyboardAction); 1124 }, 1125 1126 // disableKeyboardNav() 1127 disableKeyboardNav: function() { 1128 $(document).unbind("keydown", this.keyboardAction); 1129 }, 1130 1131 // keyboardAction() 1132 keyboardAction: function(e) { 1133 if (e === null) { // IE. 1134 keycode = event.keyCode; 1135 escapeKey = 27; 1136 } 1137 else { // Mozilla. 1138 keycode = e.keyCode; 1139 escapeKey = e.DOM_VK_ESCAPE; 1140 } 1141 1142 key = String.fromCharCode(keycode).toLowerCase(); 1143 1144 // Close lightbox. 1145 if (Lightbox.checkKey(Lightbox.keysClose, key, keycode)) { 1146 Lightbox.end('forceClose'); 1147 } 1148 // Display previous image (p, <-). 1149 else if (Lightbox.checkKey(Lightbox.keysPrevious, key, keycode)) { 1150 if ((Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) || Lightbox.activeImage !== 0) { 1151 Lightbox.changeData(Lightbox.activeImage - 1); 1152 } 1153 1154 } 1155 // Display next image (n, ->). 1156 else if (Lightbox.checkKey(Lightbox.keysNext, key, keycode)) { 1157 if ((Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) || Lightbox.activeImage != (Lightbox.total - 1)) { 1158 Lightbox.changeData(Lightbox.activeImage + 1); 1159 } 1160 } 1161 // Zoom in. 1162 else if (Lightbox.checkKey(Lightbox.keysZoom, key, keycode) && !Lightbox.disableResize && !Lightbox.disableZoom && !Lightbox.isSlideshow && !Lightbox.isLightframe) { 1163 if (Lightbox.isZoomedIn) { 1164 Lightbox.changeData(Lightbox.activeImage, false); 1165 } 1166 else if (!Lightbox.isZoomedIn) { 1167 Lightbox.changeData(Lightbox.activeImage, true); 1168 } 1169 return false;
1170 } 1171 // Toggle play / pause (space). 1172 else if (Lightbox.checkKey(Lightbox.keysPlayPause, key, keycode) && Lightbox.isSlideshow) { 1173 1174 if (Lightbox.isPaused) { 1175 Lightbox.togglePlayPause("lightshowPlay", "lightshowPause"); 1176 } 1177 else { 1178 Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); 1179 } 1180 return false; 1181 } 1182 }, 1183 1184 preloadNeighborImages: function() { 1185 1186 if ((Lightbox.total - 1) > Lightbox.activeImage) { 1187 preloadNextImage = new Image(); 1188 preloadNextImage.src = Lightbox.imageArray[Lightbox.activeImage + 1][0]; 1189 } 1190 if (Lightbox.activeImage > 0) { 1191 preloadPrevImage = new Image(); 1192 preloadPrevImage.src = Lightbox.imageArray[Lightbox.activeImage - 1][0]; 1193 } 1194 1195 }, 1196 1197 end: function(caller) { 1198 var closeClick = (caller == 'slideshow' ? false : true); 1199 if (Lightbox.isSlideshow && Lightbox.isPaused && !closeClick) { 1200 return; 1201 } 1202 // To prevent double clicks on navigation links. 1203 if (Lightbox.inprogress === true && caller != 'forceClose') { 1204 return; 1205 } 1206 Lightbox.disableKeyboardNav(); 1207 $('#lightbox').hide(); 1208 $("#lightbox2-overlay").fadeOut(); 1209 Lightbox.isPaused = true; 1210 Lightbox.inprogress = false; 1211 Lightbox.imageArray = []; 1212 Lightbox.imageNum = 0; 1213 // Replaces calls to showSelectBoxes() and showFlash() in original 1214 // lightbox2. 1215 Lightbox.toggleSelectsFlash('visible'); 1216 if (Lightbox.isSlideshow) { 1217 for (var i = 0; i < Lightbox.slideIdCount; i++) { 1218 window.clearTimeout(Lightbox.slideIdArray[i]); 1219 } 1220 $('#lightshowPause, #lightshowPlay').hide(); 1221 } 1222 else if (Lightbox.isLightframe) { 1223 $('#frameContainer').empty().hide(); 1224 } 1225 else if (Lightbox.isVideo || Lightbox.isModal) { 1226 if (!Lightbox.auto_modal) { 1227 $('#modalContainer').hide().html(""); 1228 } 1229 Lightbox.auto_modal = false; 1230 } 1231 }, 1232 1233 1234 // getPageScroll() 1235 // Returns array with x,y page scroll values. 1236 // Core code from - quirksmode.com. 1237 getPageScroll : function() { 1238 1239 var xScroll, yScroll; 1240 1241 if (self.pageYOffset || self.pageXOffset) { 1242 yScroll = self.pageYOffset; 1243 xScroll = self.pageXOffset; 1244 } 1245 else if (document.documentElement && (document.documentElement.scrollTop || document.documentElement.scrollLeft)) { // Explorer 6 Strict. 1246 yScroll = document.documentElement.scrollTop; 1247 xScroll = document.documentElement.scrollLeft; 1248 } 1249 else if (document.body) {// All other Explorers. 1250 yScroll = document.body.scrollTop; 1251 xScroll = document.body.scrollLeft; 1252 } 1253 1254 arrayPageScroll = [xScroll,yScroll]; 1255 return arrayPageScroll; 1256 }, 1257 1258 // getPageSize() 1259 // Returns array with page width, height and window width, height. 1260 // Core code from - quirksmode.com. 1261 // Edit for Firefox by pHaez. 1262 1263 getPageSize : function() { 1264 1265 var xScroll, yScroll; 1266 1267 if (window.innerHeight && window.scrollMaxY) { 1268 xScroll = window.innerWidth + window.scrollMaxX; 1269 yScroll = window.innerHeight + window.scrollMaxY; 1270 } 1271 else if (document.body.scrollHeight > document.body.offsetHeight) { // All but Explorer Mac. 1272 xScroll = document.body.scrollWidth; 1273 yScroll = document.body.scrollHeight; 1274 } 1275 else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari. 1276 xScroll = document.body.offsetWidth; 1277 yScroll = document.body.offsetHeight; 1278 } 1279 1280 var windowWidth, windowHeight; 1281 1282 if (self.innerHeight) { // All except Explorer. 1283 if (document.documentElement.clientWidth) { 1284 windowWidth = document.documentElement.clientWidth; 1285 } 1286 else { 1287 windowWidth = self.innerWidth; 1288 } 1289 windowHeight = self.innerHeight; 1290 } 1291 else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode. 1292 windowWidth = document.documentElement.clientWidth; 1293 windowHeight = document.documentElement.clientHeight; 1294 } 1295 else if (document.body) { // Other Explorers. 1296 windowWidth = document.body.clientWidth; 1297 windowHeight = document.body.clientHeight; 1298 } 1299 // For small pages with total height less than height of the viewport. 1300 if (yScroll < windowHeight) { 1301 pageHeight = windowHeight; 1302 } 1303 else { 1304 pageHeight = yScroll; 1305 } 1306 // For small pages with total width less than width of the viewport. 1307 if (xScroll < windowWidth) { 1308 pageWidth = xScroll; 1309 } 1310 else { 1311 pageWidth = windowWidth; 1312 } 1313 arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight); 1314 return arrayPageSize; 1315 }, 1316 1317 1318 // pause(numberMillis) 1319 pause : function(ms) { 1320 var date = new Date(); 1321 var curDate = null; 1322 do { curDate = new Date(); } 1323 while (curDate - date < ms); 1324 }, 1325 1326 1327 // toggleSelectsFlash() 1328 // Hide / unhide select lists and flash objects as they appear above the 1329 // lightbox in some browsers. 1330 toggleSelectsFlash: function (state) { 1331 if (state == 'visible') { 1332 $("select.lightbox_hidden, embed.lightbox_hidden, object.lightbox_hidden").show(); 1333 } 1334 else if (state == 'hide') { 1335 $("select:visible, embed:visible, object:visible").not('#lightboxAutoModal select, #lightboxAutoModal embed, #lightboxAutoModal object').addClass("lightbox_hidden"); 1336 $("select.lightbox_hidden, embed.lightbox_hidden, object.lightbox_hidden").hide(); 1337 } 1338 }, 1339 1340 1341 // parseRel() 1342 parseRel: function (link) { 1343 var parts = []; 1344 parts["rel"] = parts["title"] = parts["group"] = parts["style"] = parts["flashvars"] = null; 1345 if (!$(link).attr('rel')) return parts; 1346 parts["rel"] = $(link).attr('rel').match(/\w+/)[0]; 1347 1348 if ($(link).attr('rel').match(/\[(.*)\]/)) { 1349 var info = $(link).attr('rel').match(/\[(.*?)\]/)[1].split('|'); 1350 parts["group"] = info[0]; 1351 parts["style"] = info[1]; 1352 if (parts["style"] != undefined && parts["style"].match(/flashvars:\s?(.*?);/)) { 1353 parts["flashvars"] = parts["style"].match(/flashvars:\s?(.*?);/)[1]; 1354 } 1355 } 1356 if ($(link).attr('rel').match(/\[.*\]\[([\s\S]*)\]/)) { 1357 var title = $(link).attr('rel').match(/\[.*\]\[([\s\S]*)\]/)[1]; 1358 parts["title"] = title.replace(/\n/g, '<br />'); 1359 } 1360 return parts; 1361 }, 1362 1363 // setStyles() 1364 setStyles: function(item, styles) { 1365 item.width = Lightbox.iframe_width; 1366 item.height = Lightbox.iframe_height; 1367 item.scrolling = "auto"; 1368 1369 if (!styles) return item; 1370 var stylesArray = styles.split(';'); 1371 for (var i = 0; i< stylesArray.length; i++) { 1372 if (stylesArray[i].indexOf('width:') >= 0) { 1373 var w = stylesArray[i].replace('width:', ''); 1374 item.width = jQuery.trim(w); 1375 } 1376 else if (stylesArray[i].indexOf('height:') >= 0) { 1377 var h = stylesArray[i].replace('height:', ''); 1378 item.height = jQuery.trim(h); 1379 } 1380 else if (stylesArray[i].indexOf('scrolling:') >= 0) { 1381 var scrolling = stylesArray[i].replace('scrolling:', ''); 1382 item.scrolling = jQuery.trim(scrolling); 1383 } 1384 else if (stylesArray[i].indexOf('overflow:') >= 0) { 1385 var overflow = stylesArray[i].replace('overflow:', ''); 1386 item.overflow = jQuery.trim(overflow); 1387 } 1388 } 1389 return item; 1390 }, 1391 1392 1393 // togglePlayPause() 1394 // Hide the pause / play button as appropriate. If pausing the slideshow also 1395 // clear the timers, otherwise move onto the next image. 1396 togglePlayPause: function(hideId, showId) { 1397 if (Lightbox.isSlideshow && hideId == "lightshowPause") { 1398 for (var i = 0; i < Lightbox.slideIdCount; i++) { 1399 window.clearTimeout(Lightbox.slideIdArray[i]); 1400 } 1401 } 1402 $('#' + hideId).hide(); 1403 $('#' + showId).show(); 1404 1405 if (hideId == "lightshowPlay") { 1406 Lightbox.isPaused = false;
1407 if (!Lightbox.loopSlides && Lightbox.activeImage == (Lightbox.total - 1)) { 1408 Lightbox.end(); 1409 } 1410 else if (Lightbox.total > 1) { 1411 Lightbox.changeData(Lightbox.activeImage + 1); 1412 } 1413 } 1414 else { 1415 Lightbox.isPaused = true; 1416 } 1417 }, 1418 1419 triggerLightbox: function (rel_type, rel_group) { 1420 if (rel_type.length) { 1421 if (rel_group && rel_group.length) { 1422 $("a[rel^='" + rel_type +"\[" + rel_group + "\]'], area[rel^='" + rel_type +"\[" + rel_group + "\]']").eq(0).trigger("click"); 1423 } 1424 else { 1425 $("a[rel^='" + rel_type +"'], area[rel^='" + rel_type +"']").eq(0).trigger("click"); 1426 } 1427 } 1428 }, 1429 1430 detectMacFF2: function() { 1431 var ua = navigator.userAgent.toLowerCase(); 1432 if (/firefox[\/\s](\d+\.\d+)/.test(ua)) { 1433 var ffversion = new Number(RegExp.$1); 1434 if (ffversion < 3 && ua.indexOf('mac') != -1) { 1435 return true; 1436 } 1437 } 1438 return false; 1439 }, 1440 1441 checkKey: function(keys, key, code) { 1442 return (jQuery.inArray(key, keys) != -1 || jQuery.inArray(String(code), keys) != -1); 1443 }, 1444 1445 filterXSS: function(str, allowed_tags) { 1446 var output = ""; 1447 var prefix = Drupal.settings.pathPrefix; 1448 if (!prefix) prefix = ''; 1449 $.ajax({ 1450 url: Drupal.settings.basePath + prefix + '?q=system/lightbox2/filter-xss', 1451 data: { 1452 'string' : str, 1453 'allowed_tags' : allowed_tags 1454 }, 1455 type: "POST", 1456 async: false, 1457 dataType: "json", 1458 success: function(data) { 1459 output = data; 1460 } 1461 }); 1462 return output; 1463 } 1464 1465}; 1466 1467// Initialize the lightbox. 1468Drupal.behaviors.initLightbox = { 1469 attach: function(context) { 1470 1471 $('body:not(.lightbox-processed)', context).addClass('lightbox-processed').each(function() { 1472 Lightbox.initialize(); 1473 return false; // Break the each loop. 1474 }); 1475 1476 // Attach lightbox to any links with lightbox rels. 1477 Lightbox.initList(context); 1478 $('#lightboxAutoModal', context).triggerHandler('click'); 1479 } 1480}; 1481})(jQuery); 1482; 1483(function ($) { 1484 1485Drupal.jQueryUiFilter = Drupal.jQueryUiFilter || {} 1486Drupal.jQueryUiFilter.accordionOptions = Drupal.jQueryUiFilter.accordionOptions || {} 1487 1488/** 1489 * Scroll to an accordion's active element. 1490 */ 1491Drupal.jQueryUiFilter.accordionScrollTo = function(accordion) { 1492 var options = $(accordion).data('options') || {} 1493 if (!options['scrollTo'] || !$(accordion).find('.ui-state-active').length) { 1494 return; 1495 } 1496 1497 var top = $(accordion).find('.ui-state-active').offset().top; 1498 if (options['scrollTo']['duration']) { 1499 $('html, body').animate({scrollTop: top}, options['scrollTo']['duration']); 1500 } 1501 else { 1502 $('html, body').scrollTop(top); 1503 } 1504} 1505 1506/** 1507 * Accordion change event handler to bookmark active element in location.hash. 1508 */ 1509Drupal.jQueryUiFilter.accordionChangeStart = function(event, ui) { 1510 var href = ui.newHeader.find('a').attr('href'); 1511 if (href) { 1512 location.hash = href; 1513 return false; // Cancel event and let accordionHashChangeEvent handler activate the element. 1514 } 1515 else { 1516 return true; 1517 } 1518} 1519 1520/** 1521 * On hash change activate and scroll to an accordion element. 1522 */ 1523Drupal.jQueryUiFilter.accordionHashChangeEvent = function() { 1524 $accordionHeader = $('.ui-accordion > .ui-accordion-header:has(a[href="' + location.hash + '"])') 1525 $accordion = $accordionHeader.parent(); 1526 var index = $accordionHeader.prevAll('.ui-accordion-header').length; 1527 1528 if ($.ui.version == '1.8.7') { 1529 // NOTE: Accordion 'Active' property not change'ing http://bugs.jqueryui.com/ticket/4576 1530 $accordion.accordion('activate', index); 1531 } 1532 else { 1533 // NOTE: Accordion 'Active' property http://api.jqueryui.com/accordion/#option-active 1534 $accordion.accordion('option', 'active', index); 1535 } 1536} 1537 1538/** 1539 * jQuery UI filter accordion behavior. 1540 */ 1541Drupal.behaviors.jQueryUiFilterAccordion = {attach: function(context) { 1542 if (Drupal.settings.jQueryUiFilter.disabled) { 1543 return; 1544 } 1545 1546 var headerTag = Drupal.settings.jQueryUiFilter.accordionHeaderTag; 1547 1548 $('div.jquery-ui-filter-accordion', context).once('jquery-ui-filter-accordion', function () { 1549 var options = Drupal.jQueryUiFilter.getOptions('accordion'); 1550 1551 // Look for jQuery UI filter header class. 1552 options['header'] = '.jquery-ui-filter-accordion-header'; 1553 1554 if ($(this).hasClass('jquery-ui-filter-accordion-collapsed')) { // Set collapsed options 1555 options['collapsible'] = true; 1556 options['active'] = false;
1557 } 1558 1559 // Convert <h*> to div to remove tag and insure the accordion does not use the existing h3 style. 1560 // Sets active item based on location.hash. 1561 var index = 0; 1562 $(this).find(headerTag + '.jquery-ui-filter-accordion-header').each(function(){ 1563 var id = this.id || $(this).text().toLowerCase().replace(/[^-a-z0-9]+/gm, '-'); 1564 var hash = '#' + id; 1565 if (hash == location.hash) { 1566 options['active'] = index; 1567 } 1568 index++; 1569 1570 $(this).replaceWith('<div class="jquery-ui-filter-header jquery-ui-filter-accordion-header"><a href="' + hash + '">' + $(this).html() + '</a></div>'); 1571 }); 1572 1573 // DEBUG: 1574 // console.log(options); 1575 1576 // Save options as data and init accordion 1577 $(this).data('options', options).accordion(options); 1578 1579 // Scroll to active 1580 Drupal.jQueryUiFilter.accordionScrollTo(this); 1581 1582 // Bind accordion change event to record history 1583 if (options['history']) { 1584 $(this).bind('accordionchangestart', Drupal.jQueryUiFilter.accordionChangeStart); 1585 } 1586 1587 // Init hash change event handling once 1588 if (!Drupal.jQueryUiFilter.accordionInitialized) { 1589 Drupal.jQueryUiFilter.hashChange(Drupal.jQueryUiFilter.accordionHashChangeEvent); 1590 } 1591 Drupal.jQueryUiFilter.accordionInitialized = true; 1592 }); 1593 1594}} 1595 1596})(jQuery); 1597; 1598(function ($) { 1599 1600Drupal.jQueryUiFilter = Drupal.jQueryUiFilter || {} 1601Drupal.jQueryUiFilter.dialogOptions = Drupal.jQueryUiFilter.dialogOptions || {closeText : 'close'} 1602 1603// Set default dialog query parameter. 1604var match = /dialogFeatures=([^&]+)/.exec(location.search); 1605Drupal.jQueryUiFilter.dialogOptions.dialogFeatures = ((match) ? match[1] : {}); 1606 1607/** 1608 * Reload page with uuid to insure cache is cleared 1609 */ 1610Drupal.jQueryUiFilter.dialogReloadPage = function() { 1611 top.location.href = top.location.pathname + 1612 ((top.location.search) ? top.location.search + '&' : '?') + 1613 'no-cache=' + ((new Date().getTime()) * Math.random(10)); 1614 1615 // Close dialog so that the user sees something has happened. 1616 $('#jquery-ui-filter-dialog').dialog('destroy'); 1617} 1618 1619/** 1620 * Convert dialogFeatures array to string. 1621 */ 1622Drupal.jQueryUiFilter.dialogFeaturesToString = function(dialogFeatures) { 1623 if (typeof dialogFeatures == 'string') { 1624 return dialogFeatures; 1625 } 1626 1627 dialogFeatures['protocol'] = location.protocol.replace(':', ''); 1628 1629 var features = []; 1630 for(var name in dialogFeatures) { 1631 features[features.length] = name + '=' + dialogFeatures[name]; 1632 } 1633 return features.join(','); 1634} 1635 1636/** 1637 * Append to dialogFeatures to URL query string via '?dialogFeatures=1' or '?dialogFeatures=form-onsubmit_close=1'. 1638 */ 1639Drupal.jQueryUiFilter.dialogFeaturesAppendToURL = function(url, dialogFeatures) { 1640 if (url.indexOf('dialogFeatures') !== -1) { 1641 return url; 1642 } 1643 1644 dialogFeatures = dialogFeatures || Drupal.jQueryUiFilter.dialogOptions.dialogFeatures; 1645 dialogFeatures = Drupal.jQueryUiFilter.dialogFeaturesToString(dialogFeatures); 1646 1647 var query = ((url.indexOf('?') === -1) ? '?' : '&') + 'dialogFeatures=' + dialogFeatures; 1648 if (url.indexOf('#') !== -1) { 1649 return url.replace('#', query + '#'); 1650 } 1651 else { 1652 return url + query; 1653 } 1654} 1655 1656/** 1657 * Open jQuery UI filter dialog. Allows other modules to re-use this functionality. 1658 */ 1659Drupal.jQueryUiFilter.dialogOpen = function(url, options) { 1660 // Check url against whitelist 1661 if (url.indexOf('://') !== -1) { 1662 var domain = url.match(/:\/\/(.[^/]+)/)[1]; 1663 var whitelist = Drupal.settings.jQueryUiFilter.dialogWhitelist.split(/\s+/); 1664 whitelist[whitelist.length] = location.hostname; // Always add custom host 1665 if (jQuery.inArray(domain, whitelist) == -1) { 1666 window.location = url; 1667 return; 1668 } 1669 } 1670 1671 // Initialize options with dialogFeatures. 1672 options = jQuery.extend( 1673 {dialogFeatures: {}}, 1674 $.ui.dialog.prototype.options, 1675 options 1676 ); 1677 1678 // Destroy dialog when it is closed. 1679 options['close'] = function(event, ui) { 1680 $(this).dialog('destroy').remove(); 1681 } 1682 1683 // Automatically adjust iframe height based on window settings. 1684 var windowHeight = $(window).height() - 50; 1685 var windowWidth = $(window).width() - 50; 1686 if (options['height'] == 'auto') { 1687 options['height'] = options['maxHeight'] || windowHeight; 1688 } 1689 if (options['width'] == 'auto') { 1690 options['width'] = options['maxWidth'] || windowWidth; 1691 } 1692 1693 // Make sure dialog is not larger then the viewport. 1694 if (options['height'] > windowHeight) { 1695 options['height'] = windowHeight; 1696 } 1697 if (options['width'] > windowWidth) { 1698 options['width'] = windowWidth; 1699 } 1700 1701 // Add close button to dialog 1702 if (options['closeButton']) { 1703 options['buttons'][ Drupal.t(options['closeText'] || 'Close') ] = function() { 1704 $(this).dialog('close'); 1705 } 1706 } 1707 delete options['closeButton']; 1708 1709 // Set iframe scrolling attribute. 1710 options['scrolling'] = options['scrolling'] || 'auto'; 1711 1712 // Set dialog URL with ?dialogFeature= parameters. 1713 url = Drupal.jQueryUiFilter.dialogFeaturesAppendToURL(url, options['dialogFeatures']); 1714 1715 // Remove existing dialog and iframe, this allows us to reset the 1716 // dialog's options and allow dialogs to open external domains. 1717 $('#jquery-ui-filter-dialog').dialog('destroy').remove(); 1718 1719 // Create iframe 1720 $('body').append('<div id="jquery-ui-filter-dialog">' 1721 + '<div id="jquery-ui-filter-dialog-container">' 1722 + '<iframe id="jquery-ui-filter-dialog-iframe" name="jquery-ui-filter-dialog-iframe" width="100%" height="100%" marginWidth="0" marginHeight="0" frameBorder="0" scrolling="' + options['scrolling'] + '" src="' + url + '" />' 1723 + '</div>' 1724 + '</div>' 1725 ); 1726 1727 // Open dialog 1728 $('#jquery-ui-filter-dialog').dialog(options); 1729 1730 // DEBUG: 1731 // console.log(options); 1732} 1733 1734/** 1735 * jQuery UI filter dialog behavior 1736 */ 1737Drupal.behaviors.jQueryUiFilterDialog = {attach: function(context) { 1738 if (Drupal.settings.jQueryUiFilter.disabled) { 1739 return; 1740 } 1741 1742 // Append ?jquery_ui_filter_dialog=1 to all link and form action inside a dialog iframe with dialogFeatures. 1743 if ((top != self) && (self.location.search.indexOf('dialogFeatures') !== -1)) { 1744 $('a', context).once('jquery-ui-filter-dialog-link', function() { 1745 if (this.tagName == 'A') { 1746 this.href = Drupal.jQueryUiFilter.dialogFeaturesAppendToURL(this.href); 1747 } 1748 else if (this.tagName == 'FORM') { 1749 this.action = Drupal.jQueryUiFilter.dialogFeaturesAppendToURL(this.action); 1750 } 1751 }); 1752
1753 // Do not allow dialogs to be nested inside of dialogs. 1754 return; 1755 } 1756 1757 $('a.jquery-ui-filter-dialog', context).once('jquery-ui-filter-dialog', function () { 1758 $(this).click(function() { 1759 // Get hidden JSON string that has been cleaned up on the server using PHP. 1760 // See _jquery_ui_filter_dialog_process_replacer(). 1761 var json = $(this).attr('rel'); 1762 if (json) { 1763 var options = Drupal.jQueryUiFilter.getOptions('dialog', JSON.parse(unescape(json))); 1764 } 1765 else { 1766 var options = Drupal.jQueryUiFilter.getOptions('dialog', {}); 1767 } 1768 // Customize dialog using the link's title. 1769 if ($(this).attr('title')) { 1770 options['title'] = $(this).attr('title'); 1771 } 1772 1773 Drupal.jQueryUiFilter.dialogOpen(this.href, options); 1774 return false; 1775 }); 1776 }); 1777}} 1778 1779})(jQuery); 1780; 1781(function ($) { 1782 1783/** 1784 * Equal height plugin. 1785 * 1786 * From: http://www.problogdesign.com/coding/30-pro-jquery-tips-tricks-and-strategies/ 1787 */ 1788if (jQuery.fn.equalHeight == undefined) { 1789 jQuery.fn.equalHeight = function () { 1790 var tallest = 0; 1791 this.each(function() { 1792 tallest = ($(this).height() > tallest)? $(this).height() : tallest; 1793 }); 1794 return this.height(tallest); 1795 } 1796} 1797 1798Drupal.jQueryUiFilter = Drupal.jQueryUiFilter || {} 1799Drupal.jQueryUiFilter.tabsOptions = Drupal.jQueryUiFilter.tabsOptions || {} 1800 1801/** 1802 * Tabs pagings 1803 * 1804 * Inspired by : http://css-tricks.com/2361-jquery-ui-tabs-with-nextprevious/ 1805 */ 1806Drupal.jQueryUiFilter.tabsPaging = function(selector, options) { 1807 options = jQuery.extend({paging: {'back': '« Previous', 'next': 'Next »'}}, options); 1808 1809 var $tabs = $(selector); 1810 var numberOfTabs = $tabs.find(".ui-tabs-panel").size() - 1; 1811 1812 // Add back and next buttons. 1813 // NOTE: Buttons are not 'themeable' since they should look like a themerolled jQuery UI button. 1814 $tabs.find('.ui-tabs-panel').each(function(i){ 1815 var html = ''; 1816 if (i != 0) { 1817 html += '<button type="button" class="ui-tabs-prev" rel="' + (i-1) + '" style="float:left">' + Drupal.t(options.paging.back) + '</button>'; 1818 } 1819 if (i != numberOfTabs) { 1820 html += '<button type="button" href="#" class="ui-tabs-next" rel="' + (i+1) + '" style="float:right">' + Drupal.t(options.paging.next) + '</button>'; 1821 } 1822 $(this).append('<div class="ui-tabs-paging clearfix clear-block">' + html + '</div>'); 1823 }); 1824 1825 // Init buttons 1826 $tabs.find('button.ui-tabs-prev, button.ui-tabs-next').button(); 1827 1828 // Add event handler 1829 $tabs.find('.ui-tabs-next, .ui-tabs-prev').click(function() { 1830 if ($.ui.version == '1.8.7') { 1831 $tabs.tabs('select', parseInt($(this).attr("rel"))); 1832 } 1833 else { 1834 $tabs.tabs('option', 'active', parseInt($(this).attr("rel"))); 1835 } 1836 return false; 1837 }); 1838} 1839 1840/** 1841 * Scroll to an accordion's active element. 1842 */ 1843Drupal.jQueryUiFilter.tabsScrollTo = function(tabs) { 1844 var options = $(tabs).data('options') || {} 1845 if (!options['scrollTo']) { 1846 return; 1847 } 1848 1849 var top = $(tabs).offset().top; 1850 if (options['scrollTo']['duration']) { 1851 $('html, body').animate({scrollTop: top}, options['scrollTo']['duration']); 1852 } 1853 else { 1854 $('html, body').scrollTop(top); 1855 } 1856} 1857 1858 1859/** 1860 * Tabs select event handler to bookmark selected tab in location.hash. 1861 */ 1862Drupal.jQueryUiFilter.tabsSelect = function(event, ui) { 1863 location.hash = $(ui.tab).attr('href'); 1864} 1865 1866/** 1867 * On hash change select tab. 1868 * 1869 * Inspired by: http://benalman.com/code/projects/jquery-bbq/examples/fragment-jquery-ui-tabs/ 1870 */ 1871Drupal.jQueryUiFilter.tabsHashChangeEvent = function() { 1872 var $tab = $('.ui-tabs-nav > li:has(a[href="' + location.hash + '"])'); 1873 $tabs = $tab.parent().parent(); 1874 1875 var selected = $tab.prevAll().length; 1876 1877 if ($.ui.version == '1.8.7') { 1878 if ($tabs.tabs('option', 'selected') != selected) { 1879 $tabs.tabs('select', selected); 1880 } 1881 } 1882 else { 1883 if ($tabs.tabs('option', 'active') != selected) { 1884 $tabs.tabs('option', 'active', selected); 1885 } 1886 } 1887} 1888 1889/** 1890 * jQuery UI filter tabs behavior 1891 */ 1892Drupal.behaviors.jQueryUiFilterTabs = {attach: function(context) { 1893 if (Drupal.settings.jQueryUiFilter.disabled) { 1894 return; 1895 } 1896 1897 var headerTag = Drupal.settings.jQueryUiFilter.tabsHeaderTag; 1898 1899 // Tabs 1900 $('div.jquery-ui-filter-tabs', context).once('jquery-ui-filter-tabs', function () { 1901 var options = Drupal.jQueryUiFilter.getOptions('tabs'); 1902 1903 // Get <h*> text and add to tabs. 1904 // Sets selected tab based on location.hash. 1905 var scrollTo = false;
1906 var index = 0; 1907 var tabs = '<ul>'; 1908 $(this).find(headerTag + '.jquery-ui-filter-tabs-header').each(function(){ 1909 var id = this.id || $(this).text().toLowerCase().replace(/[^-a-z0-9]+/gm, '-'); 1910 var hash = '#' + id; 1911 1912 if (hash == location.hash) { 1913 scrollTo = true; 1914 options['selected'] = index; 1915 } 1916 index++; 1917 1918 tabs += '<li><a href="' + hash + '">' + $(this).html() + '</a></li>'; 1919 $(this).next('div.jquery-ui-filter-tabs-container').attr('id', id); 1920 $(this).remove(); 1921 }); 1922 tabs += '</ul>'; 1923 $(this).prepend(tabs); 1924 1925 // DEBUG: 1926 // console.log(options); 1927 1928 // Save options as data and init tabs 1929 $(this).data('options', options).tabs(options); 1930 1931 // Equal height tab 1932 $(this).find('.ui-tabs-nav li').equalHeight(); 1933 1934 // Add paging. 1935 if (options['paging']) { 1936 Drupal.jQueryUiFilter.tabsPaging(this, options); 1937 } 1938 1939 // Bind tabs select event to record history 1940 if (options['history']) { 1941 $(this).bind('tabsselect', Drupal.jQueryUiFilter.tabsSelect); 1942 } 1943 1944 // Scroll to selected tabs widget 1945 if (scrollTo) { 1946 Drupal.jQueryUiFilter.tabsScrollTo(this); 1947 } 1948 1949 // Init hash change event handling once 1950 if (!Drupal.jQueryUiFilter.hashChangeInit) { 1951 Drupal.jQueryUiFilter.hashChange(Drupal.jQueryUiFilter.tabsHashChangeEvent); 1952 } 1953 Drupal.jQueryUiFilter.hashChangeInit = true; 1954 }); 1955}} 1956 1957})(jQuery); 1958; 1959/* 1960 * jQuery FlexSlider v2.2.0 1961 * Copyright 2012 WooThemes 1962 * Contributing Author: Tyler Smith 1963 */ 1964 (function(e){if(typeof define==="function"&&define.amd){define(["jquery"],e)}else{e(jQuery)}})(function(e){e.flexslider=function(t,n){var r=e(t);r.vars=e.extend({},e.flexslider.defaults,n);var i=r.vars.namespace,s=("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)&&r.vars.touch,o="click touchend",u="",a,f=r.vars.direction==="vertical",l=r.vars.reverse,c=r.vars.itemWidth>0,h=r.vars.animation==="fade",p=r.vars.asNavFor!=="",d={};focused=true;e.data(t,"flexslider",r);d={init:function(){r.animating=false;r.currentSlide=r.vars.startAt;r.animatingTo=r.currentSlide;r.atEnd=r.currentSlide===0||r.currentSlide===r.last;r.containerSelector=r.vars.selector.substr(0,r.vars.selector.search(" "));r.slides=e(r.vars.selector,r);r.container=e(r.containerSelector,r);r.count=r.slides.length;r.syncExists=e(r.vars.sync).length>0;if(r.vars.animation==="slide")r.vars.animation="swing";r.prop=f?"top":"marginLeft";r.args={};r.manualPause=false;r.stopped=false;r.transitions=!r.vars.video&&!h&&r.vars.useCSS&&function(){var e=document.createElement("div"),t=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var n in t){if(e.style[t[n]]!==undefined){r.pfx=t[n].replace("Perspective","").toLowerCase();r.prop="-"+r.pfx+"-transform";return true}}return false}();if(r.vars.controlsContainer!=="")r.controlsContainer=e(r.vars.controlsContainer).length>0&&e(r.vars.controlsContainer);if(r.vars.manualControls!=="")r.manualControls=e(r.vars.manualControls).length>0&&e(r.vars.manualControls);if(r.vars.randomize){r.slides.sort(function(){return Math.round(Math.random())-.5});r.container.empty().append(r.slides)}r.doMath();if(p)d.asNav.setup();r.setup("init");if(r.vars.controlNav)d.controlNav.setup();if(r.vars.directionNav)d.directionNav.setup();if(r.vars.keyboard&&(e(r.containerSelector).length===1||r.vars.multipleKeyboard)){e(document).bind("keyup",function(e){var t=e.keyCode;if(!r.animating&&(t===39||t===37)){var n=t===39?r.getTarget("next"):t===37?r.getTarget("prev"):false;r.flexAnimate(n,r.vars.pauseOnAction)}})}if(r.vars.mousewheel){r.bind("mousewheel",function(e,t,n,i){e.preventDefault();var s=t<0?r.getTarget("next"):r.getTarget("prev");r.flexAnimate(s,r.vars.pauseOnAction)})}if(r.vars.pausePlay)d.pausePlay.setup();if(r.vars.slideshow){if(r.vars.pauseOnHover){r.hover(function(){if(!r.manualPlay&&!r.manualPause)r.pause()},function(){if(!r.manualPause&&!r.manualPlay&&!r.stopped)r.play()})}r.vars.initDelay>0?setTimeout(r.play,r.vars.initDelay):r.play()}if(s&&r.vars.touch)d.touch();if(!h||h&&r.vars.smoothHeight)e(window).bind("resize focus",d.resize);setTimeout(function(){r.vars.start(r)},200)},asNav:{setup:function(){r.asNav=true;r.animatingTo=Math.floor(r.currentSlide/r.move);r.currentItem=r.currentSlide;r.slides.removeClass(i+"active-slide").eq(r.currentItem).addClass(i+"active-slide");r.slides.click(function(t){t.preventDefault();var n=e(this),s=n.index();var o=n.offset().left-e(r).scrollLeft();if(o<=0&&n.hasClass(i+"active-slide")){r.flexAnimate(r.getTarget("prev"),true)}else if(!e(r.vars.asNavFor).data("flexslider").animating&&!n.hasClass(i+"active-slide")){r.direction=r.currentItem<s?"next":"prev";r.flexAnimate(s,r.vars.pauseOnAction,false,true,true)}})}},controlNav:{setup:function(){if(!r.manualControls){d.controlNav.setupPaging(
1964)}else{d.controlNav.setupManual()}},setupPaging:function(){var t=r.vars.controlNav==="thumbnails"?"control-thumbs":"control-paging",n=1,s;r.controlNavScaffold=e('<ol class="'+i+"control-nav "+i+t+'"></ol>');if(r.pagingCount>1){for(var a=0;a<r.pagingCount;a++){s=r.vars.controlNav==="thumbnails"?'<img src="'+r.slides.eq(a).attr("data-thumb")+'"/>':"<a>"+n+"</a>";r.controlNavScaffold.append("<li>"+s+"</li>");n++}}r.controlsContainer?e(r.controlsContainer).append(r.controlNavScaffold):r.append(r.controlNavScaffold);d.controlNav.set();d.controlNav.active();r.controlNavScaffold.delegate("a, img",o,function(t){t.preventDefault();if(u===""||u===t.type){var n=e(this),s=r.controlNav.index(n);if(!n.hasClass(i+"active")){r.direction=s>r.currentSlide?"next":"prev";r.flexAnimate(s,r.vars.pauseOnAction)}}if(u===""){u=t.type}d.setToClearWatchedEvent()})},setupManual:function(){r.controlNav=r.manualControls;d.controlNav.active();r.controlNav.bind(o,function(t){t.preventDefault();if(u===""||u===t.type){var n=e(this),s=r.controlNav.index(n);if(!n.hasClass(i+"active")){s>r.currentSlide?r.direction="next":r.direction="prev";r.flexAnimate(s,r.vars.pauseOnAction)}}if(u===""){u=t.type}d.setToClearWatchedEvent()})},set:function(){var t=r.vars.controlNav==="thumbnails"?"img":"a";r.controlNav=e("."+i+"control-nav li "+t,r.controlsContainer?r.controlsContainer:r)},active:function(){r.controlNav.removeClass(i+"active").eq(r.animatingTo).addClass(i+"active")},update:function(t,n){if(r.pagingCount>1&&t==="add"){r.controlNavScaffold.append(e("<li><a>"+r.count+"</a></li>"))}else if(r.pagingCount===1){r.controlNavScaffold.find("li").remove()}else{r.controlNav.eq(n).closest("li").remove()}d.controlNav.set();r.pagingCount>1&&r.pagingCount!==r.controlNav.length?r.update(n,t):d.controlNav.active()}},directionNav:{setup:function(){var t=e('<ul class="'+i+'direction-nav"><li><a class="'+i+'prev" href="#">'+r.vars.prevText+'</a></li><li><a class="'+i+'next" href="#">'+r.vars.nextText+"</a></li></ul>");if(r.controlsContainer){e(r.controlsContainer).append(t);r.directionNav=e("."+i+"direction-nav li a",r.controlsContainer)}else{r.append(t);r.directionNav=e("."+i+"direction-nav li a",r)}d.directionNav.update();r.directionNav.bind(o,function(t){t.preventDefault();var n;if(u===""||u===t.type){n=e(this).hasClass(i+"next")?r.getTarget("next"):r.getTarget("prev");r.flexAnimate(n,r.vars.pauseOnAction)}if(u===""){u=t.type}d.setToClearWatchedEvent()})},update:function(){var e=i+"disabled";if(r.pagingCount===1){r.directionNav.addClass(e).attr("tabindex","-1")}else if(!r.vars.animationLoop){if(r.animatingTo===0){r.directionNav.removeClass(e).filter("."+i+"prev").addClass(e).attr("tabindex","-1")}else if(r.animatingTo===r.last){r.directionNav.removeClass(e).filter("."+i+"next").addClass(e).attr("tabindex","-1")}else{r.directionNav.removeClass(e).removeAttr("tabindex")}}else{r.directionNav.removeClass(e).removeAttr("tabindex")}}},pausePlay:{setup:function(){var t=e('<div class="'+i+'pauseplay"><a></a></div>');if(r.controlsContainer){r.controlsContainer.append(t);r.pausePlay=e("."+i+"pauseplay a",r.controlsContainer)}else{r.append(t);r.pausePlay=e("."+i+"pauseplay a",r)}d.pausePlay.update(r.vars.slideshow?i+"pause":i+"play");r.pausePlay.bind(o,function(t){t.preventDefault();if(u===""||u===t.type){if(e(this).hasClass(i+"pause")){r.manualPause=true;r.manualPlay=false;r.pause()}else{r.manualPause=false;r.manualPlay=true;r.play()}}if(u===""){u=t.type}d.setToClearWatchedEvent()})},update:function(e){e==="play"?r.pausePlay.removeClass(i+"pause").addClass(i+"play").text(r.vars.playText):r.pausePlay.removeClass(i+"play").addClass(i+"pause").text(r.vars.pauseText)}},touch:function(){function p(o){if(r.animating){o.preventDefault()}else if(o.touches.length===1){r.pause();s=f?r.h:r.w;u=Number(new Date);i=c&&l&&r.animatingTo===r.last?0:c&&l?r.limit-(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo:c&&r.currentSlide===r.last?r.limit:c?(r.itemW+r.vars.itemMargin)*r.move*r.currentSlide:l?(r.last-r.currentSlide+r.cloneOffset)*s:(r.currentSlide+r.cloneOffset)*s;e=f?o.touches[0].pageY:o.touches[0].pageX;n=f?o.touches[0].pageX:o.touches[0].pageY;t.addEventListener("touchmove",d,false);t.addEventListener("touchend",v,false)}}function d(t){o=f?e-t.touches[0].pageY:e-t.touches[0].pageX;a=f?Math.abs(o)<Math.abs(t.touches[0].pageX-n):Math.abs(o)<Math.abs(t.touches[0].pageY-n);if(!a||Number(new Date)-u>500){t.preventDefault();if(!h&&r.transitions){if(!r.vars.animationLoop){o=o/(r.currentSlide===0&&o<0||r.currentSlide===r.last&&o>0?Math.abs(o)/s+2:1)}r.setProps(i+o,"setTouch")}}}function v(f){t.removeEventListener("touchmove",d,false);
1964if(r.animatingTo===r.currentSlide&&!a&&!(o===null)){var c=l?-o:o,p=c>0?r.getTarget("next"):r.getTarget("prev");if(r.canAdvance(p)&&(Number(new Date)-u<550&&Math.abs(c)>50||Math.abs(c)>s/2)){r.flexAnimate(p,r.vars.pauseOnAction)}else{if(!h)r.flexAnimate(r.currentSlide,r.vars.pauseOnAction,true)}}t.removeEventListener("touchend",v,false);e=null;n=null;o=null;i=null}var e,n,i,s,o,u,a=false;t.addEventListener("touchstart",p,false)},resize:function(){if(!r.animating&&r.is(":visible")){if(!c)r.doMath();if(h){d.smoothHeight()}else if(c){r.slides.width(r.computedW);r.update(r.pagingCount);r.setProps()}else if(f){r.viewport.height(r.h);r.setProps(r.h,"setTotal")}else{if(r.vars.smoothHeight)d.smoothHeight();r.newSlides.width(r.computedW);r.setProps(r.computedW,"setTotal")}}},smoothHeight:function(e){if(!f||h){var t=h?r:r.viewport;e?t.animate({height:r.slides.eq(r.animatingTo).height()},e):t.height(r.slides.eq(r.animatingTo).height())}},sync:function(t){var n=e(r.vars.sync).data("flexslider"),i=r.animatingTo;switch(t){case"animate":n.flexAnimate(i,r.vars.pauseOnAction,false,true);break;case"play":if(!n.playing&&!n.asNav){n.play()}break;case"pause":n.pause();break}},setToClearWatchedEvent:function(){clearTimeout(a);a=setTimeout(function(){u=""},3e3)}};r.flexAnimate=function(t,n,o,u,a){if(p&&r.pagingCount===1)r.direction=r.currentItem<t?"next":"prev";if(!r.animating&&(r.canAdvance(t,a)||o)&&r.is(":visible")){if(p&&u){var v=e(r.vars.asNavFor).data("flexslider");r.atEnd=t===0||t===r.count-1;v.flexAnimate(t,true,false,true,a);r.direction=r.currentItem<t?"next":"prev";v.direction=r.direction;if(Math.ceil((t+1)/r.visible)-1!==r.currentSlide&&t!==0){r.currentItem=t;r.slides.removeClass(i+"active-slide").eq(t).addClass(i+"active-slide");t=Math.floor(t/r.visible)}else{r.currentItem=t;r.slides.removeClass(i+"active-slide").eq(t).addClass(i+"active-slide");return false}}r.animating=true;r.animatingTo=t;r.vars.before(r);if(n)r.pause();if(r.syncExists&&!a)d.sync("animate");if(r.vars.controlNav)d.controlNav.active();if(!c)r.slides.removeClass(i+"active-slide").eq(t).addClass(i+"active-slide");r.atEnd=t===0||t===r.last;if(r.vars.directionNav)d.directionNav.update();if(t===r.last){r.vars.end(r);if(!r.vars.animationLoop)r.pause()}if(!h){var m=f?r.slides.filter(":first").height():r.computedW,g,y,b;if(c){g=r.vars.itemMargin;b=(r.itemW+g)*r.move*r.animatingTo;y=b>r.limit&&r.visible!==1?r.limit:b}else if(r.currentSlide===0&&t===r.count-1&&r.vars.animationLoop&&r.direction!=="next"){y=l?(r.count+r.cloneOffset)*m:0}else if(r.currentSlide===r.last&&t===0&&r.vars.animationLoop&&r.direction!=="prev"){y=l?0:(r.count+1)*m}else{y=l?(r.count-1-t+r.cloneOffset)*m:(t+r.cloneOffset)*m}r.setProps(y,"",r.vars.animationSpeed);if(r.transitions){if(!r.vars.animationLoop||!r.atEnd){r.animating=false;r.currentSlide=r.animatingTo}r.container.unbind("webkitTransitionEnd transitionend");r.container.bind("webkitTransitionEnd transitionend",function(){r.wrapup(m)})}else{r.container.animate(r.args,r.vars.animationSpeed,r.vars.easing,function(){r.wrapup(m)})}}else{if(!s){r.slides.eq(r.currentSlide).css({zIndex:1}).animate({opacity:0}
1964,r.vars.animationSpeed,r.vars.easing);r.slides.eq(t).css({zIndex:2}).animate({opacity:1},r.vars.animationSpeed,r.vars.easing,r.wrapup)}else{r.slides.eq(r.currentSlide).css({opacity:0,zIndex:1});r.slides.eq(t).css({opacity:1,zIndex:2});r.animating=false;r.currentSlide=r.animatingTo}}if(r.vars.smoothHeight)d.smoothHeight(r.vars.animationSpeed)}};r.wrapup=function(e){if(!h&&!c){if(r.currentSlide===0&&r.animatingTo===r.last&&r.vars.animationLoop){r.setProps(e,"jumpEnd")}else if(r.currentSlide===r.last&&r.animatingTo===0&&r.vars.animationLoop){r.setProps(e,"jumpStart")}}r.animating=false;r.currentSlide=r.animatingTo;r.vars.after(r)};r.animateSlides=function(){if(!r.animating&&focused)r.flexAnimate(r.getTarget("next"))};r.pause=function(){clearInterval(r.animatedSlides);r.animatedSlides=null;r.playing=false;if(r.vars.pausePlay)d.pausePlay.update("play");if(r.syncExists)d.sync("pause")};r.play=function(){r.animatedSlides=r.animatedSlides||setInterval(r.animateSlides,r.vars.slideshowSpeed);r.playing=true;if(r.vars.pausePlay)d.pausePlay.update("pause");if(r.syncExists)d.sync("play")};r.stop=function(){r.pause();r.stopped=true};r.canAdvance=function(e,t){var n=p?r.pagingCount-1:r.last;return t?true:p&&r.currentItem===r.count-1&&e===0&&r.direction==="prev"?true:p&&r.currentItem===0&&e===r.pagingCount-1&&r.direction!=="next"?false:e===r.currentSlide&&!p?false:r.vars.animationLoop?true:r.atEnd&&r.currentSlide===0&&e===n&&r.direction!=="next"?false:r.atEnd&&r.currentSlide===n&&e===0&&r.direction==="next"?false:true};r.getTarget=function(e){r.direction=e;if(e==="next"){return r.currentSlide===r.last?0:r.currentSlide+1}else{return r.currentSlide===0?r.last:r.currentSlide-1}};r.setProps=function(e,t,n){var i=function(){var n=e?e:(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo,i=function(){if(c){return t==="setTouch"?e:l&&r.animatingTo===r.last?0:l?r.limit-(r.itemW+r.vars.itemMargin)*r.move*r.animatingTo:r.animatingTo===r.last?r.limit:n}else{switch(t){case"setTotal":return l?(r.count-1-r.currentSlide+r.cloneOffset)*e:(r.currentSlide+r.cloneOffset)*e;case"setTouch":return l?e:e;case"jumpEnd":return l?e:r.count*e;case"jumpStart":return l?r.count*e:e;default:return e}}}();return i*-1+"px"}();if(r.transitions){i=f?"translate3d(0,"+i+",0)":"translate3d("+i+",0,0)";n=n!==undefined?n/1e3+"s":"0s";r.container.css("-"+r.pfx+"-transition-duration",n)}r.args[r.prop]=i;if(r.transitions||n===undefined)r.container.css(r.args)};r.setup=function(t){if(!h){var n,o;if(t==="init"){r.viewport=e('<div class="'+i+'viewport"></div>').css({overflow:"hidden",position:"relative"}).appendTo(r).append(r.container);r.cloneCount=0;r.cloneOffset=0;if(l){o=e.makeArray(r.slides).reverse();r.slides=e(o);r.container.empty().append(r.slides)}}if(r.vars.animationLoop&&!c){r.cloneCount=2;r.cloneOffset=1;if(t!=="init")r.container.find(".clone").remove();r.container.append(r.slides.first().clone().addClass("clone").attr("aria-hidden","true")).prepend(r.slides.last().clone().addClass("clone").attr("aria-hidden","true"))}r.newSlides=e(r.vars.selector,r);n=l?r.count-1-r.currentSlide+r.cloneOffset:r.currentSlide+r.cloneOffset;if(f&&!c){r.container.height((r.count+r.cloneCount)*200+"%").css("position","absolute").width("100%");setTimeout(function(){r.newSlides.css({display:"block"});r.doMath();r.viewport.height(r.h);r.setProps(n*r.h,"init")},t==="init"?100:0)}else{r.container.width((r.count+r.cloneCount)*200+"%");r.setProps(n*r.computedW,"init");setTimeout(function(){r.doMath();r.newSlides.css({width:r.computedW,"float":"left",display:"block"});if(r.vars.smoothHeight)d.smoothHeight()},t==="init"?100:0)}}else{r.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"});if(t==="init"){if(!s){r.slides.css({opacity:0,display:"block",zIndex:1}).eq(r.currentSlide).css({zIndex:2}).animate({opacity:1},r.vars.animationSpeed,r.vars.easing)}else{r.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+r.vars.animationSpeed/1e3+"s ease",zIndex:1}).eq(r.currentSlide).css({opacity:1,zIndex:2})}}if(r.vars.smoothHeight)d.smoothHeight()}if(!c)r.slides.removeClass(i+"active-slide").eq(r.currentSlide).addClass(i+"active-slide")};r.doMath=function(){var e=r.slides.first(),t=r.vars.itemMargin,n=r.vars.minItems,i=r.vars.maxItems;r.w=r.width();r.h=e.height();r.boxPadding=e.outerWidth()-e.width();if(c){r.itemT=r.vars.itemWidth+t;r.minW=n?n*r.itemT:r.w;r.maxW=i?i*r.itemT-t:r.w;r.itemW=r.minW>
1964r.w?(r.w-t*(n-1))/n:r.maxW<r.w?(r.w-t*(i-1))/i:r.vars.itemWidth>r.w?r.w:r.vars.itemWidth;r.visible=Math.floor(r.w/r.itemW);r.move=r.vars.move>0&&r.vars.move<r.visible?r.vars.move:r.visible;r.pagingCount=Math.ceil((r.count-r.visible)/r.move+1);r.last=r.pagingCount-1;r.limit=r.pagingCount===1?0:r.vars.itemWidth>r.w?r.itemW*(r.count-1)+t*(r.count-1):(r.itemW+t)*r.count-r.w-t}else{r.itemW=r.w;r.pagingCount=r.count;r.last=r.count-1}r.computedW=r.itemW-r.boxPadding};r.update=function(e,t){r.doMath();if(!c){if(e<r.currentSlide){r.currentSlide+=1}else if(e<=r.currentSlide&&e!==0){r.currentSlide-=1}r.animatingTo=r.currentSlide}if(r.vars.controlNav&&!r.manualControls){if(t==="add"&&!c||r.pagingCount>r.controlNav.length){d.controlNav.update("add")}else if(t==="remove"&&!c||r.pagingCount<r.controlNav.length){if(c&&r.currentSlide>r.last){r.currentSlide-=1;r.animatingTo-=1}d.controlNav.update("remove",r.last)}}if(r.vars.directionNav)d.directionNav.update()};r.addSlide=function(t,n){var i=e(t);r.count+=1;r.last=r.count-1;if(f&&l){n!==undefined?r.slides.eq(r.count-n).after(i):r.container.prepend(i)}else{n!==undefined?r.slides.eq(n).before(i):r.container.append(i)}r.update(n,"add");r.slides=e(r.vars.selector+":not(.clone)",r);r.setup();r.vars.added(r)};r.removeSlide=function(t){var n=isNaN(t)?r.slides.index(e(t)):t;r.count-=1;r.last=r.count-1;if(isNaN(t)){e(t,r.slides).remove()}else{f&&l?r.slides.eq(r.last).remove():r.slides.eq(t).remove()}r.doMath();r.update(n,"remove");r.slides=e(r.vars.selector+":not(.clone)",r);r.setup();r.vars.removed(r)};d.init()};e(window).blur(function(e){focused=false}).focus(function(e){focused=true});e.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:false,animationLoop:true,smoothHeight:false,startAt:0,slideshow:true,slideshowSpeed:7e3,animationSpeed:600,initDelay:0,randomize:false,pauseOnAction:true,pauseOnHover:false,useCSS:true,touch:true,video:false,controlNav:true,directionNav:true,prevText:"Previous",nextText:"Next",keyboard:true,multipleKeyboard:false,mousewheel:false,pausePlay:false,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:0,maxItems:0,move:0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){}};e.fn.flexslider=function(t){if(t===undefined)t={};if(typeof t==="object"){return this.each(function(){var n=e(this),r=t.selector?t.selector:".slides > li",i=n.find(r);if(i.length===1){i.fadeIn(400);if(t.start)t.start(n)}else if(n.data("flexslider")===undefined){new e.flexslider(this,t)}})}else{var n=e(this).data("flexslider");switch(t){case"play":n.play();break;case"pause":n.pause();break;case"stop":n.stop();break;case"next":n.flexAnimate(n.getTarget("next"),true);break;case"prev":case"previous":n.flexAnimate(n.getTarget("prev"),true);break;default:if(typeof t==="number")n.flexAnimate(t,true)}}}})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.