https://www.est-ensemble.fr/sites/default/files/js/js_7mdi7ZeZKXCtXdZr4K6nC967mFLLhcrfAQX9PNrYx7c.js
1Drupal.locale = { 'pluralFormula': function ($n) { return Number(($n>1)); }, 'strings': {"":{"An AJAX HTTP error occurred.":"Une erreur HTTP AJAX s\u0027est produite.","HTTP Result Code: !status":"Code de statut HTTP : !status","An AJAX HTTP request terminated abnormally.":"Une requ\u00eate HTTP AJAX s\u0027est termin\u00e9e anormalement.","Debugging information follows.":"Informations de d\u00e9bogage ci-dessous.","Path: !uri":"Chemin: !uri","StatusText: !statusText":"StatutTexte: !statusText","ResponseText: !responseText":"ReponseTexte: !responseText","ReadyState: !readyState":"ReadyState: !readyState","@title dialog":"dialogue de @title","Configure":"Configurer","Show shortcuts":"Afficher les raccourcis","Hide shortcuts":"Cacher les raccourcis","Loading":"En cours de chargement","(active tab)":"(onglet actif)","Re-order rows by numerical weight instead of dragging.":"R\u00e9-ordonner les lignes avec des poids num\u00e9riques plut\u00f4t qu\u0027en les d\u00e9placant.","Show row weights":"Afficher les poids des lignes","Hide row weights":"Cacher le poids des lignes","Drag to re-order":"Cliquer-d\u00e9poser pour r\u00e9-organiser","Changes made in this table will not be saved until the form is submitted.":"Les changements effectu\u00e9s dans ce tableau ne seront pris en compte que lorsque la configuration aura \u00e9t\u00e9 enregistr\u00e9e.","Hide":"Masquer","Show":"Afficher","Customize dashboard":"Personnaliser le tableau de bord","Edit":"Modifier","Enabled":"Activ\u00e9","This field is required.":"Ce champ est obligatoire.","Next":"Suivant","Cancel":"Annuler","Disabled":"D\u00e9sactiv\u00e9","none":"aucun(e)","Sunday":"Dimanche","Monday":"Lundi","Tuesday":"Mardi","Wednesday":"Mercredi","Thursday":"Jeudi","Friday":"Vendredi","Saturday":"Samedi","Add":"Ajouter","Upload":"Transf\u00e9rer","Done":"Termin\u00e9","OK":"OK","Prev":"Pr\u00e9c.","Mon":"lun","Tue":"mar","Wed":"mer","Thu":"jeu","Fri":"ven","Sat":"sam","Sun":"dim","January":"janvier","February":"f\u00e9vrier","March":"mars","April":"avril","May":"mai","June":"juin","July":"juillet","August":"ao\u00fbt","September":"septembre","October":"octobre","November":"novembre","December":"d\u00e9cembre","Select all rows in this table":"S\u00e9lectionner toutes les lignes du tableau","Deselect all rows in this table":"D\u00e9s\u00e9lectionner toutes les lignes du tableau","Today":"Aujourd\u0027hui","Jan":"Jan","Feb":"f\u00e9v","Mar":"mar","Apr":"avr","Jun":"juin","Jul":"jui","Aug":"ao\u00fb","Sep":"sep","Oct":"oct","Nov":"nov","Dec":"d\u00e9c","Su":"Di","Mo":"Lu","Tu":"Ma","We":"Me","Th":"Je","Fr":"Ve","Sa":"Sa","Not published":"Non publi\u00e9","Please wait...":"Veuillez patienter...","mm\/dd\/yy":"mm\/jj\/aa","Only files with the following extensions are allowed: %files-allowed.":"Seuls les fichiers se terminant par les extensions suivantes sont autoris\u00e9s\u00a0: %files-allowed.","By @name on @date":"Par @name le @date","By @name":"Par @name","Not in menu":"Pas dans le menu","Alias: @alias":"Alias : @alias","No alias":"Aucun alias","New revision":"Nouvelle r\u00e9vision","The changes to these blocks will not be saved until the \u003Cem\u003ESave blocks\u003C\/em\u003E button is clicked.":"N\u0027oubliez pas de cliquer sur \u003Cem\u003EEnregistrer les blocs\u003C\/em\u003E pour confirmer les modifications apport\u00e9es ici.","This permission is inherited from the authenticated user role.":"Ce droit est h\u00e9rit\u00e9e du r\u00f4le de l\u0027utilisateur authentifi\u00e9.","No revision":"Aucune r\u00e9vision","@number comments per page":"@number commentaires par page","Requires a title":"Titre obligatoire","Not restricted":"Non restreint","Not customizable":"Non personnalisable","Restricted to certain pages":"R\u00e9serv\u00e9 \u00e0 certaines pages","The block cannot be placed in this region.":"Le bloc ne peut pas \u00eatre plac\u00e9 dans cette r\u00e9gion.","Hide summary":"Masquer le r\u00e9sum\u00e9","Edit summary":"Modifier le r\u00e9sum\u00e9","Don\u0027t display post information":"Ne pas afficher les informations de la contribution","The selected file %filename cannot be uploaded. Only files with the following extensions are allowed: %extensions.":"Le fichier s\u00e9lectionn\u00e9 %filename ne peut pas \u00eatre transf\u00e9r\u00e9. Seulement les fichiers avec les extensions suivantes sont permis : %extensions.","Autocomplete popup":"Popup d\u0027auto-compl\u00e9tion","Searching for matches...":"Recherche de correspondances...","Submit":"Soumettre","%filename is not an image.":"%filename n\u0027est pas une image."}} };; 2 3(function ($) { 4 5/** 6 * This script transforms a set of fieldsets into a stack of vertical 7 * tabs. Another tab pane can be selected by clicking on the respective 8 * tab. 9 * 10 * Each tab may have a summary which can be updated by another
11 * script. For that to work, each fieldset has an associated 12 * 'verticalTabCallback' (with jQuery.data() attached to the fieldset), 13 * which is called every time the user performs an update to a form 14 * element inside the tab pane. 15 */ 16Drupal.behaviors.verticalTabs = { 17 attach: function (context) { 18 $('.vertical-tabs-panes', context).once('vertical-tabs', function () { 19 var focusID = $(':hidden.vertical-tabs-active-tab', this).val(); 20 var tab_focus; 21 22 // Check if there are some fieldsets that can be converted to vertical-tabs 23 var $fieldsets = $('> fieldset', this); 24 if ($fieldsets.length == 0) { 25 return; 26 } 27 28 // Create the tab column. 29 var tab_list = $('<ul class="vertical-tabs-list"></ul>'); 30 $(this).wrap('<div class="vertical-tabs clearfix"></div>').before(tab_list); 31 32 // Transform each fieldset into a tab. 33 $fieldsets.each(function () { 34 var vertical_tab = new Drupal.verticalTab({ 35 title: $('> legend', this).text(), 36 fieldset: $(this) 37 }); 38 tab_list.append(vertical_tab.item); 39 $(this) 40 .removeClass('collapsible collapsed') 41 .addClass('vertical-tabs-pane') 42 .data('verticalTab', vertical_tab); 43 if (this.id == focusID) { 44 tab_focus = $(this); 45 } 46 }); 47 48 $('> li:first', tab_list).addClass('first'); 49 $('> li:last', tab_list).addClass('last'); 50 51 if (!tab_focus) { 52 // If the current URL has a fragment and one of the tabs contains an 53 // element that matches the URL fragment, activate that tab. 54 if (window.location.hash && $(window.location.hash, this).length) { 55 tab_focus = $(window.location.hash, this).closest('.vertical-tabs-pane'); 56 } 57 else { 58 tab_focus = $('> .vertical-tabs-pane:first', this); 59 } 60 } 61 if (tab_focus.length) { 62 tab_focus.data('verticalTab').focus(); 63 } 64 }); 65 } 66}; 67 68/** 69 * The vertical tab object represents a single tab within a tab group. 70 * 71 * @param settings 72 * An object with the following keys: 73 * - title: The name of the tab. 74 * - fieldset: The jQuery object of the fieldset that is the tab pane. 75 */ 76Drupal.verticalTab = function (settings) { 77 var self = this; 78 $.extend(this, settings, Drupal.theme('verticalTab', settings)); 79 80 this.link.click(function () { 81 self.focus(); 82 return false; 83 }); 84 85 // Keyboard events added: 86 // Pressing the Enter key will open the tab pane. 87 this.link.keydown(function(event) { 88 if (event.keyCode == 13) { 89 self.focus(); 90 // Set focus on the first input field of the visible fieldset/tab pane. 91 $("fieldset.vertical-tabs-pane :input:visible:enabled:first").focus(); 92 return false; 93 } 94 }); 95 96 // Pressing the Enter key lets you leave the tab again. 97 this.fieldset.keydown(function(event) { 98 // Enter key should not trigger inside <textarea> to allow for multi-line entries. 99 if (event.keyCode == 13 && event.target.nodeName != "TEXTAREA") { 100 // Set focus on the selected tab button again. 101 $(".vertical-tab-button.selected a").focus(); 102 return false; 103 } 104 }); 105 106 this.fieldset 107 .bind('summaryUpdated', function () { 108 self.updateSummary(); 109 }) 110 .trigger('summaryUpdated'); 111}; 112 113Drupal.verticalTab.prototype = { 114 /** 115 * Displays the tab's content pane. 116 */ 117 focus: function () { 118 this.fieldset 119 .siblings('fieldset.vertical-tabs-pane') 120 .each(function () { 121 var tab = $(this).data('verticalTab'); 122 tab.fieldset.hide(); 123 tab.item.removeClass('selected'); 124 }) 125 .end() 126 .show() 127 .siblings(':hidden.vertical-tabs-active-tab') 128 .val(this.fieldset.attr('id')); 129 this.item.addClass('selected'); 130 // Mark the active tab for screen readers. 131 $('#active-vertical-tab').remove(); 132 this.link.append('<span id="active-vertical-tab" class="offscreen">' + Drupal.t('(active tab)') + '</span>'); 133 }, 134 135 /** 136 * Updates the tab's summary. 137 */ 138 updateSummary: function () { 139 this.summary.html(this.fieldset.drupalGetSummary()); 140 }, 141 142 /** 143 * Shows a vertical tab pane. 144 */ 145 tabShow: function () { 146 // Display the tab. 147 this.item.show(); 148 // Update .first marker for items. We need recurse from parent to retain the 149 // actual DOM element order as jQuery implements sortOrder, but not as public 150 // method. 151 this.item.parent().children('.vertical-tab-button').removeClass('first') 152 .filter(':visible:first').addClass('first'); 153 // Display the fieldset. 154 this.fieldset.removeClass('vertical-tab-hidden').show(); 155 // Focus this tab. 156 this.focus(); 157 return this; 158 }, 159 160 /** 161 * Hides a vertical tab pane. 162 */ 163 tabHide: function () { 164 // Hide this tab. 165 this.item.hide(); 166 // Update .first marker for items. We need recurse from parent to retain the 167 // actual DOM element order as jQuery implements sortOrder, but not as public 168 // method. 169 this.item.parent().children('.vertical-tab-button').removeClass('first') 170 .filter(':visible:first').addClass('first'); 171 // Hide the fieldset. 172 this.fieldset.addClass('vertical-tab-hidden').hide(); 173 // Focus the first visible tab (if there is one). 174 var $firstTab = this.fieldset.siblings('.vertical-tabs-pane:not(.vertical-tab-hidden):first'); 175 if ($firstTab.length) { 176 $firstTab.data('verticalTab').focus(); 177 } 178 return this; 179 } 180}; 181 182/** 183 * Theme function for a vertical tab. 184 * 185 * @param settings 186 * An object with the following keys: 187 * - title: The name of the tab. 188 * @return 189 * This function has to return an object with at least these keys: 190 * - item: The root tab jQuery element 191 * - link: The anchor tag that acts as the clickable area of the tab 192 * (jQuery version) 193 * - summary: The jQuery element that contains the tab summary 194 */ 195Drupal.theme.prototype.verticalTab = function (settings) { 196 var class_name = 'vertical-tab-button'; 197 if ($('.error', settings.fieldset).length>0) { 198 class_name += ' vertical-tab-button-error'; 199 } 200 var tab = {}; 201 tab.item = $('<li class="'+class_name+'" tabindex="-1"></li>') 202 .append(tab.link = $('<a href="#"></a>') 203 .append(tab.title = $('<strong></strong>
203').text(settings.title)) 204 .append(tab.summary = $('<span class="summary"></span>') 205 ) 206 ); 207 return tab; 208}; 209 210})(jQuery); 211; 212/* 213 * FancyBox - jQuery Plugin 214 * Simple and fancy lightbox alternative 215 * 216 * Examples and documentation at: http://fancybox.net 217 * 218 * Copyright (c) 2008 - 2010 Janis Skarnelis 219 * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. 220 * 221 * Version: 1.3.4 (11/11/2010) 222 * Requires: jQuery v1.3+ 223 * 224 * Dual licensed under the MIT and GPL licenses: 225 * http://www.opensource.org/licenses/mit-license.php 226 * http://www.gnu.org/licenses/gpl.html 227 */ 228 229;(function($) { 230 var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right, 231 232 selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [], 233 234 ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i, 235 236 loadingTimer, loadingFrame = 1, 237 238 titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx
238= $.extend($('<div/>')[0], { prop: 0 }), 239 240 isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest, 241 242 /* 243 * Private methods 244 */ 245 246 _abort = function() { 247 loading.hide(); 248 249 imgPreloader.onerror = imgPreloader.onload = null; 250 251 if (ajaxLoader) { 252 ajaxLoader.abort(); 253 } 254 255 tmp.empty(); 256 }, 257 258 _error = function() { 259 if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) { 260 loading.hide(); 261 busy = false; 262 return; 263 } 264 265 selectedOpts.titleShow = false; 266 267 selectedOpts.width = 'auto'; 268 selectedOpts.height = 'auto'; 269 270 tmp.html( '<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>' ); 271 272 _process_inline(); 273 }, 274 275 _start = function() { 276 var obj = selectedArray[ selectedIndex ], 277 href, 278 type, 279 title, 280 str, 281 emb, 282 ret; 283 284 _abort(); 285 286 selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox'))); 287 288 ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts); 289 290 if (ret === false) { 291 busy = false; 292 return; 293 } else if (typeof ret == 'object') { 294 selectedOpts = $.extend(selectedOpts, ret); 295 } 296 297 title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || ''; 298 299 if (obj.nodeName && !selectedOpts.orig) { 300 selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj); 301 } 302 303 if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) { 304 title = selectedOpts.orig.attr('alt'); 305 } 306 307 href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null; 308 309 if ((/^(?:javascript)/i).test(href) || href == '#') { 310 href = null; 311 } 312 313 if (selectedOpts.type) { 314 type = selectedOpts.type; 315 316 if (!href) { 317 href = selectedOpts.content; 318 } 319 320 } else if (selectedOpts.content) { 321 type = 'html'; 322 323 } else if (href) { 324 if (href.match(imgRegExp)) { 325 type = 'image'; 326 327 } else if (href.match(swfRegExp)) { 328 type = 'swf'; 329 330 } else if ($(obj).hasClass("iframe")) { 331 type = 'iframe'; 332 333 } else if (href.indexOf("#") === 0) { 334 type = 'inline'; 335 336 } else { 337 type = 'ajax'; 338 } 339 } 340 341 if (!type) { 342 _error(); 343 return; 344 } 345 346 if (type == 'inline') { 347 obj = href.substr(href.indexOf("#")); 348 type = $(obj).length > 0 ? 'inline' : 'ajax'; 349 } 350 351 selectedOpts.type = type; 352 selectedOpts.href = href; 353 selectedOpts.title = title; 354 355 if (selectedOpts.autoDimensions) { 356 if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') { 357 selectedOpts.width = 'auto'; 358 selectedOpts.height = 'auto'; 359 } else { 360 selectedOpts.autoDimensions = false; 361 } 362 } 363 364 if (selectedOpts.modal) { 365 selectedOpts.overlayShow = true; 366 selectedOpts.hideOnOverlayClick = false; 367 selectedOpts.hideOnContentClick = false; 368 selectedOpts.enableEscapeButton = false; 369 selectedOpts.showCloseButton = false; 370 } 371 372 selectedOpts.padding = parseInt(selectedOpts.padding, 10); 373 selectedOpts.margin = parseInt(selectedOpts.margin, 10); 374 375 tmp.css('padding', (selectedOpts.padding + selectedOpts.margin)); 376 377 $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() { 378 $(this).replaceWith(content.children()); 379 }); 380 381 switch (type) { 382 case 'html' : 383 tmp.html( selectedOpts.content ); 384 _process_inline(); 385 break; 386 387 case 'inline' : 388 if ( $(obj).parent().is('#fancybox-content') === true) { 389 busy = false; 390 return; 391 } 392 393 $('<div class="fancybox-inline-tmp" />') 394 .hide() 395 .insertBefore( $(obj) ) 396 .bind('fancybox-cleanup', function() { 397 $(this).replaceWith(content.children()); 398 }).bind('fancybox-cancel', function() { 399 $(this).replaceWith(tmp.children()); 400 }); 401 402 $(obj).appendTo(tmp); 403 404 _process_inline(); 405 break; 406 407 case 'image': 408 busy = false; 409 410 $.fancybox.showActivity(); 411 412 imgPreloader = new Image(); 413 414 imgPreloader.onerror = function() { 415 _error(); 416 }; 417 418 imgPreloader.onload = function() { 419 busy = true; 420 421 imgPreloader.onerror = imgPreloader.onload = null; 422 423 _process_image(); 424 }; 425 426 imgPreloader.src = href; 427 break; 428 429 case 'swf': 430 selectedOpts.scrolling = 'no'; 431 432 str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>'; 433 emb = ''; 434 435 $.each(selectedOpts.swf, function(name, val) { 436 str += '<param name="' + name + '" value="' + val + '"></param>'; 437 emb += ' ' + name + '="' + val + '"'; 438 });
439 440 str += '<embed src="' + href + '" type="application/x-shockwave-flash" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"' + emb + '></embed></object>'; 441 442 tmp.html(str); 443 444 _process_inline(); 445 break; 446 447 case 'ajax': 448 busy = false; 449 450 $.fancybox.showActivity(); 451 452 selectedOpts.ajax.win = selectedOpts.ajax.success; 453 454 ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, { 455 url : href, 456 data : selectedOpts.ajax.data || {}, 457 error : function(XMLHttpRequest, textStatus, errorThrown) { 458 if ( XMLHttpRequest.status > 0 ) { 459 _error(); 460 } 461 }, 462 success : function(data, textStatus, XMLHttpRequest) { 463 var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader; 464 if (o.status == 200) { 465 if ( typeof selectedOpts.ajax.win == 'function' ) { 466 ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest); 467 468 if (ret === false) { 469 loading.hide(); 470 return; 471 } else if (typeof ret == 'string' || typeof ret == 'object') { 472 data = ret; 473 } 474 } 475 476 tmp.html( data ); 477 _process_inline(); 478 } 479 } 480 })); 481 482 break; 483 484 case 'iframe': 485 _show(); 486 break; 487 } 488 }, 489 490 _process_inline = function() { 491 var 492 w = selectedOpts.width, 493 h = selectedOpts.height; 494 495 if (w.toString().indexOf('%') > -1) { 496 w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px'; 497 498 } else { 499 w = w == 'auto' ? 'auto' : w + 'px'; 500 } 501 502 if (h.toString().indexOf('%') > -1) { 503 h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px'; 504 505 } else { 506 h = h == 'auto' ? 'auto' : h + 'px'; 507 } 508 509 tmp.wrapInner('<div style="width:' + w + ';height:' + h + ';overflow: ' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:relative;"></div>'); 510 511 selectedOpts.width = tmp.width(); 512 selectedOpts.height = tmp.height(); 513 514 _show(); 515 }, 516 517 _process_image = function() { 518 selectedOpts.width = imgPreloader.width; 519 selectedOpts.height = imgPreloader.height; 520 521 $("<img />").attr({ 522 'id' : 'fancybox-img', 523 'src' : imgPreloader.src, 524 'alt' : selectedOpts.title 525 }).appendTo( tmp ); 526 527 _show(); 528 }, 529 530 _show = function() { 531 var pos, equal; 532 533 loading.hide(); 534 535 if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { 536 $.event.trigger('fancybox-cancel'); 537 538 busy = false; 539 return; 540 } 541 542 busy = true; 543 544 $(content.add( overlay )).unbind(); 545 546 $(window).unbind("resize.fb scroll.fb"); 547 $(document).unbind('keydown.fb'); 548 549 if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') { 550 wrap.css('height', wrap.height()); 551 } 552 553 currentArray = selectedArray; 554 currentIndex = selectedIndex; 555 currentOpts = selectedOpts; 556 557 if (currentOpts.overlayShow) { 558 overlay.css({ 559 'background-color' : currentOpts.overlayColor, 560 'opacity' : currentOpts.overlayOpacity, 561 'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto', 562 'height' : $(document).height() 563 }); 564 565 if (!overlay.is(':visible')) { 566 if (isIE6) { 567 $('select:not(#fancybox-tmp select)').filter(function() { 568 return this.style.visibility !== 'hidden'; 569 }).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() { 570 this.style.visibility = 'inherit'; 571 }); 572 } 573 574 overlay.show(); 575 } 576 } else { 577 overlay.hide(); 578 } 579 580 final_pos = _get_zoom_to(); 581 582 _process_title(); 583 584 if (wrap.is(":visible")) { 585 $( close.add( nav_left ).add( nav_right ) ).hide(); 586 587 pos = wrap.position(), 588 589 start_pos = { 590 top : pos.top, 591 left : pos.left, 592 width : wrap.width(), 593 height : wrap.height() 594 }; 595 596 equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height); 597 598 content.fadeTo(currentOpts.changeFade, 0.3, function() { 599 var finish_resizing = function() { 600 content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish); 601 }; 602 603 $.event.trigger('fancybox-change'); 604 605 content 606 .empty() 607 .removeAttr('filter') 608 .css({ 609 'border-width' : currentOpts.padding, 610 'width' : final_pos.width - currentOpts.padding * 2, 611 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 612 });
613 614 if (equal) { 615 finish_resizing(); 616 617 } else { 618 fx.prop = 0; 619 620 $(fx).animate({prop: 1}, { 621 duration : currentOpts.changeSpeed, 622 easing : currentOpts.easingChange, 623 step : _draw, 624 complete : finish_resizing 625 }); 626 } 627 }); 628 629 return; 630 } 631 632 wrap.removeAttr("style"); 633 634 content.css('border-width', currentOpts.padding); 635 636 if (currentOpts.transitionIn == 'elastic') { 637 start_pos = _get_zoom_from(); 638 639 content.html( tmp.contents() ); 640 641 wrap.show(); 642 643 if (currentOpts.opacity) { 644 final_pos.opacity = 0; 645 } 646 647 fx.prop = 0; 648 649 $(fx).animate({prop: 1}, { 650 duration : currentOpts.speedIn, 651 easing : currentOpts.easingIn, 652 step : _draw, 653 complete : _finish 654 }); 655 656 return; 657 } 658 659 if (currentOpts.titlePosition == 'inside' && titleHeight > 0) { 660 title.show(); 661 } 662 663 content 664 .css({ 665 'width' : final_pos.width - currentOpts.padding * 2, 666 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 667 }) 668 .html( tmp.contents() ); 669 670 wrap 671 .css(final_pos) 672 .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish ); 673 }, 674 675 _format_title = function(title) { 676 if (title && title.length) { 677 if (currentOpts.titlePosition == 'float') { 678 return '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">' + title + '</td><td id="fancybox-title-float-right"></td></tr></table>'; 679 } 680 681 return '<div id="fancybox-title-' + currentOpts.titlePosition + '">' + title + '</div>'; 682 } 683 684 return false; 685 }, 686 687 _process_title = function() { 688 titleStr = currentOpts.title || ''; 689 titleHeight = 0; 690 691 title 692 .empty() 693 .removeAttr('style') 694 .removeClass(); 695 696 if (currentOpts.titleShow === false) { 697 title.hide(); 698 return; 699 } 700 701 titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr); 702 703 if (!titleStr || titleStr === '') { 704 title.hide(); 705 return; 706 } 707 708 title 709 .addClass('fancybox-title-' + currentOpts.titlePosition) 710 .html( titleStr ) 711 .appendTo( 'body' ) 712 .show(); 713 714 switch (currentOpts.titlePosition) { 715 case 'inside': 716 title 717 .css({ 718 'width' : final_pos.width - (currentOpts.padding * 2), 719 'marginLeft' : currentOpts.padding, 720 'marginRight' : currentOpts.padding 721 }); 722 723 titleHeight = title.outerHeight(true); 724 725 title.appendTo( outer ); 726 727 final_pos.height += titleHeight; 728 break; 729 730 case 'over': 731 title 732 .css({ 733 'marginLeft' : currentOpts.padding, 734 'width' : final_pos.width - (currentOpts.padding * 2), 735 'bottom' : currentOpts.padding 736 }) 737 .appendTo( outer ); 738 break; 739 740 case 'float': 741 title 742 .css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1) 743 .appendTo( wrap ); 744 break; 745 746 default: 747 title 748 .css({ 749 'width' : final_pos.width - (currentOpts.padding * 2), 750 'paddingLeft' : currentOpts.padding, 751 'paddingRight' : currentOpts.padding 752 }) 753 .appendTo( wrap ); 754 break; 755 } 756 757 title.hide(); 758 }, 759 760 _set_navigation = function() { 761 if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) { 762 $(document).bind('keydown.fb', function(e) { 763 if (e.keyCode == 27 && currentOpts.enableEscapeButton) { 764 e.preventDefault(); 765 $.fancybox.close(); 766 767 } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') { 768 e.preventDefault(); 769 $.fancybox[ e.keyCode == 37 ? 'prev' : 'next'](); 770 } 771 }); 772 } 773 774 if (!currentOpts.showNavArrows) { 775 nav_left.hide(); 776 nav_right.hide(); 777 return; 778 } 779 780 if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) { 781 nav_left.show(); 782 } 783 784 if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) { 785 nav_right.show(); 786 } 787 }, 788 789 _finish = function () { 790 if (!$.support.opacity) { 791 content.get(0).style.removeAttribute('filter'); 792 wrap.get(0).style.removeAttribute('filter'); 793 } 794 795 if (selectedOpts.autoDimensions) { 796 content.css('height', 'auto'); 797 } 798 799 wrap.css('height', 'auto'); 800 801 if (titleStr && titleStr.length) { 802 title.show(); 803 } 804 805 if (currentOpts.showCloseButton) { 806 close.show(); 807 } 808 809 _set_navigation(); 810 811 if (currentOpts.hideOnContentClick) { 812 content.bind('click', $.fancybox.close); 813 } 814 815 if (currentOpts.hideOnOverlayClick) { 816 overlay.bind('click', $.fancybox.close); 817 } 818 819 $(window).bind("resize.fb", $.fancybox.resize); 820 821 if (currentOpts.centerOnScroll) { 822 $(window).bind("scroll.fb", $.fancybox.center); 823 } 824 825 if (currentOpts.type == 'iframe') { 826 $('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" ' + ($.browser.msie ? 'allowtransparency="true""' : '') + ' scrolling="' + selectedOpts.scrolling + '" src="' + currentOpts.href + '"></iframe>').appendTo(content); 827 } 828 829 wrap.show(); 830 831 busy = false; 832 833 $.fancybox.center(); 834 835 currentOpts.onComplete(currentArray, currentIndex, currentOpts); 836 837 _preload_images(); 838 }, 839 840 _preload_images = function() { 841 var href, 842 objNext; 843 844 if ((currentArray.length -1) > currentIndex) { 845 href = currentArray[ currentIndex + 1 ].href; 846 847 if (typeof href !== 'undefined' && href.match(imgRegExp)) { 848 objNext = new Image(); 849 objNext.src = href; 850 } 851 } 852 853 if (currentIndex > 0) { 854 href = currentArray[ currentIndex - 1 ].href; 855 856 if (typeof href !== 'undefined' && href.match(imgRegExp)) { 857 objNext = new Image(); 858 objNext.src = href; 859 } 860 } 861 }, 862 863 _draw = function(pos) { 864 var dim = { 865 width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10), 866 height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10), 867 868 top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10), 869 left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10) 870 }; 871 872 if (typeof final_pos.opacity !== 'undefined') { 873 dim.opacity = pos < 0.5 ? 0.5 : pos; 874 } 875 876 wrap.css(dim); 877 878 content.css({ 879 'width' : dim.width - currentOpts.padding * 2,
880 'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2 881 }); 882 }, 883 884 _get_viewport = function() { 885 return [ 886 $(window).width() - (currentOpts.margin * 2), 887 $(window).height() - (currentOpts.margin * 2), 888 $(document).scrollLeft() + currentOpts.margin, 889 $(document).scrollTop() + currentOpts.margin 890 ]; 891 }, 892 893 _get_zoom_to = function () { 894 var view = _get_viewport(), 895 to = {}, 896 resize = currentOpts.autoScale, 897 double_padding = currentOpts.padding * 2, 898 ratio; 899 900 if (currentOpts.width.toString().indexOf('%') > -1) { 901 to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10); 902 } else { 903 to.width = currentOpts.width + double_padding; 904 } 905 906 if (currentOpts.height.toString().indexOf('%') > -1) { 907 to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10); 908 } else { 909 to.height = currentOpts.height + double_padding; 910 } 911 912 if (resize && (to.width > view[0] || to.height > view[1])) { 913 if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') { 914 ratio = (currentOpts.width ) / (currentOpts.height ); 915 916 if ((to.width ) > view[0]) { 917 to.width = view[0]; 918 to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10); 919 } 920 921 if ((to.height) > view[1]) { 922 to.height = view[1]; 923 to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10); 924 } 925 926 } else { 927 to.width = Math.min(to.width, view[0]); 928 to.height = Math.min(to.height, view[1]); 929 } 930 } 931 932 to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10); 933 to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10); 934 935 return to; 936 }, 937 938 _get_obj_pos = function(obj) { 939 var pos = obj.offset(); 940 941 pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0; 942 pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0; 943 944 pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0; 945 pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0; 946 947 pos.width = obj.width(); 948 pos.height = obj.height(); 949 950 return pos; 951 }, 952 953 _get_zoom_from = function() { 954 var orig = selectedOpts.orig ? $(selectedOpts.orig) : false, 955 from = {}, 956 pos, 957 view; 958 959 if (orig && orig.length) { 960 pos = _get_obj_pos(orig); 961 962 from = { 963 width : pos.width + (currentOpts.padding * 2), 964 height : pos.height + (currentOpts.padding * 2), 965 top : pos.top - currentOpts.padding - 20, 966 left : pos.left - currentOpts.padding - 20 967 }; 968 969 } else { 970 view = _get_viewport(); 971 972 from = { 973 width : currentOpts.padding * 2, 974 height : currentOpts.padding * 2, 975 top : parseInt(view[3] + view[1] * 0.5, 10), 976 left : parseInt(view[2] + view[0] * 0.5, 10) 977 }; 978 } 979 980 return from; 981 }, 982 983 _animate_loading = function() { 984 if (!loading.is(':visible')){ 985 clearInterval(loadingTimer); 986 return; 987 } 988 989 $('div', loading).css('top', (loadingFrame * -40) + 'px'); 990 991 loadingFrame = (loadingFrame + 1) % 12; 992 }; 993 994 /* 995 * Public methods 996 */ 997 998 $.fn.fancybox = function(options) { 999 if (!$(this).length) { 1000 return this; 1001 } 1002 1003 $(this) 1004 .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {}))) 1005 .unbind('click.fb') 1006 .bind('click.fb', function(e) { 1007 e.preventDefault(); 1008 1009 if (busy) { 1010 return; 1011 } 1012 1013 busy = true; 1014 1015 $(this).blur(); 1016 1017 selectedArray = []; 1018 selectedIndex = 0; 1019 1020 var rel = $(this).attr('rel') || ''; 1021 1022 if (!rel || rel == '' || rel === 'nofollow') { 1023 selectedArray.push(this); 1024 1025 } else { 1026 selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]"); 1027 selectedIndex = selectedArray.index( this ); 1028 } 1029 1030 _start(); 1031 1032 return; 1033 }); 1034 1035 return this; 1036 }; 1037 1038 $.fancybox = function(obj) { 1039 var opts; 1040 1041 if (busy) { 1042 return; 1043 } 1044 1045 busy = true; 1046 opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {}; 1047 1048 selectedArray = []; 1049 selectedIndex = parseInt(opts.index, 10) || 0; 1050 1051 if ($.isArray(obj)) { 1052 for (var i = 0, j = obj.length; i < j; i++) { 1053 if (typeof obj[i] == 'object') { 1054 $(obj[i]).data('fancybox', $.extend({}, opts, obj[i])); 1055 } else { 1056 obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts)); 1057 } 1058 } 1059 1060 selectedArray = jQuery.merge(selectedArray, obj); 1061 1062 } else { 1063 if (typeof obj == 'object') { 1064 $(obj).data('fancybox', $.extend({}, opts, obj)); 1065 } else { 1066 obj = $({}).data('fancybox', $.extend({content : obj}, opts)); 1067 } 1068 1069 selectedArray.push(obj); 1070 } 1071 1072 if (selectedIndex > selectedArray.length || selectedIndex < 0) { 1073 selectedIndex = 0; 1074 } 1075 1076 _start(); 1077 }; 1078 1079 $.fancybox.showActivity = function() { 1080 clearInterval(loadingTimer); 1081 1082 loading.show(); 1083 loadingTimer = setInterval(_animate_loading, 66); 1084 }; 1085 1086 $.fancybox.hideActivity = function() { 1087 loading.hide(); 1088 }; 1089 1090 $.fancybox.next = function() { 1091 return $.fancybox.pos( currentIndex + 1); 1092 }; 1093 1094 $.fancybox.prev = function() { 1095 return $.fancybox.pos( currentIndex - 1); 1096 }; 1097 1098 $.fancybox.pos = function(pos) { 1099 if (busy) { 1100 return; 1101 } 1102 1103 pos = parseInt(pos); 1104 1105 selectedArray = currentArray; 1106 1107 if (pos > -1 && pos < currentArray.length) { 1108 selectedIndex = pos; 1109 _start(); 1110 1111 } else if (currentOpts.cyclic && currentArray.length > 1) { 1112 selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1; 1113 _start(); 1114 } 1115 1116 return; 1117 }; 1118 1119 $.fancybox.cancel = function() { 1120 if (busy) { 1121 return; 1122 } 1123 1124 busy = true; 1125 1126 $.event.trigger('fancybox-cancel'); 1127 1128 _abort(); 1129 1130 selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts); 1131 1132 busy = false; 1133 }; 1134 1135 // Note: within an iframe use - parent.$.fancybox.close(); 1136 $.fancybox.close = function() { 1137 if (busy || wrap.is(':hidden')) { 1138 return; 1139 } 1140 1141 busy = true; 1142 1143 if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { 1144 busy = false; 1145 return; 1146 } 1147 1148 _abort(); 1149 1150 $(close.add( nav_left ).add( nav_right )).hide(); 1151 1152 $(content.add( overlay )).unbind(); 1153 1154 $(window).unbind("resize.fb scroll.fb"); 1155 $(document).unbind('keydown.fb'); 1156 1157 content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank'); 1158 1159 if (currentOpts.titlePosition !== 'inside') { 1160 title.empty(); 1161 } 1162 1163 wrap.stop(); 1164 1165 function _cleanup() { 1166 overlay.fadeOut('fast'); 1167 1168 title.empty().hide(); 1169 wrap.hide(); 1170 1171 $.event.trigger('fancybox-cleanup'); 1172 1173 content.empty(); 1174 1175 currentOpts.onClosed(currentArray, currentIndex, currentOpts); 1176 1177 currentArray = selectedOpts = []; 1178 currentIndex = selectedIndex = 0; 1179 currentOpts = selectedOpts = {}; 1180 1181 busy = false; 1182 } 1183 1184 if (currentOpts.transitionOut == 'elastic') { 1185 start_pos = _get_zoom_from(); 1186 1187 var pos = wrap.position(); 1188 1189 final_pos = { 1190 top : pos.top , 1191 left : pos.left, 1192 width : wrap.width(), 1193 height : wrap.height() 1194 }; 1195 1196 if (currentOpts.opacity) { 1197 final_pos.opacity = 1; 1198 } 1199 1200 title.empty().hide(); 1201 1202 fx.prop = 1; 1203 1204 $(fx).animate({ prop: 0 }, { 1205 duration : currentOpts.speedOut, 1206 easing : currentOpts.easingOut, 1207 step : _draw, 1208 complete : _cleanup 1209 }); 1210 1211 } else { 1212 wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup); 1213 } 1214 }; 1215 1216 $.fancybox.resize = function() { 1217 if (overlay.is(':visible')) { 1218 overlay.css('height', $(document).height()); 1219 } 1220 1221 $.fancybox.center(true); 1222 }; 1223 1224 $.fancybox.center = function() { 1225 var view, align; 1226 1227 if (busy) { 1228 return; 1229 } 1230 1231 align = arguments[0] === true ? 1 : 0; 1232 view = _get_viewport(); 1233 1234 if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) { 1235 return; 1236 } 1237 1238 wrap 1239 .stop() 1240 .animate({ 1241 'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)), 1242 'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding)) 1243 }, typeof arguments[0] == 'number' ? arguments[0] : 200); 1244 }; 1245 1246 $.fancybox.init = function() { 1247 if ($("#fancybox-wrap").length) { 1248 return; 1249 } 1250 1251 $('body').append( 1252 tmp = $('<div id="fancybox-tmp"></div>'), 1253 loading = $('<div id="fancybox-loading"><div></div></div>'), 1254 overlay = $('<div id="fancybox-overlay"></div>'), 1255 wrap = $('<div id="fancybox-wrap"></div>') 1256 ); 1257
1258 outer = $('<div id="fancybox-outer"></div>') 1259 .append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>') 1260 .appendTo( wrap ); 1261 1262 outer.append( 1263 content = $('<div id="fancybox-content"></div>'), 1264 close = $('<a id="fancybox-close"></a>'), 1265 title = $('<div id="fancybox-title"></div>'), 1266 1267 nav_left = $('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'), 1268 nav_right = $('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>') 1269 ); 1270 1271 close.click($.fancybox.close); 1272 loading.click($.fancybox.cancel); 1273 1274 nav_left.click(function(e) { 1275 e.preventDefault(); 1276 $.fancybox.prev(); 1277 }); 1278 1279 nav_right.click(function(e) { 1280 e.preventDefault(); 1281 $.fancybox.next(); 1282 }); 1283 1284 if ($.fn.mousewheel) { 1285 wrap.bind('mousewheel.fb', function(e, delta) { 1286 if (busy) { 1287 e.preventDefault(); 1288 1289 } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) { 1290 e.preventDefault(); 1291 $.fancybox[ delta > 0 ? 'prev' : 'next'](); 1292 } 1293 }); 1294 } 1295 1296 if (!$.support.opacity) { 1297 wrap.addClass('fancybox-ie'); 1298 } 1299 1300 if (isIE6) { 1301 loading.addClass('fancybox-ie6'); 1302 wrap.addClass('fancybox-ie6'); 1303 1304 $('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank' ) + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(outer); 1305 } 1306 }; 1307 1308 $.fn.fancybox.defaults = { 1309 padding : 10, 1310 margin : 40, 1311 opacity : false, 1312 modal : false, 1313 cyclic : false, 1314 scrolling : 'auto', // 'auto', 'yes' or 'no' 1315 1316 width : 560, 1317 height : 340, 1318 1319 autoScale : true, 1320 autoDimensions : true, 1321 centerOnScroll : false, 1322 1323 ajax : {}, 1324 swf : { wmode: 'transparent' }, 1325 1326 hideOnOverlayClick : true, 1327 hideOnContentClick : false, 1328 1329 overlayShow : true, 1330 overlayOpacity : 0.7, 1331 overlayColor : '#777', 1332 1333 titleShow : true, 1334 titlePosition : 'float', // 'float', 'outside', 'inside' or 'over' 1335 titleFormat : null, 1336 titleFromAlt : false, 1337 1338 transitionIn : 'fade', // 'elastic', 'fade' or 'none' 1339 transitionOut : 'fade', // 'elastic', 'fade' or 'none' 1340 1341 speedIn : 300, 1342 speedOut : 300, 1343 1344 changeSpeed : 300, 1345 changeFade : 'fast', 1346 1347 easingIn : 'swing', 1348 easingOut : 'swing', 1349 1350 showCloseButton : true, 1351 showNavArrows : true, 1352 enableEscapeButton : true, 1353 enableKeyboardNav : true, 1354 1355 onStart : function(){}, 1356 onCancel : function(){}, 1357 onComplete : function(){}, 1358 onCleanup : function(){}, 1359 onClosed : function(){}, 1360 onError : function(){} 1361 }; 1362 1363 $(document).ready(function() { 1364 $.fancybox.init(); 1365 }); 1366 1367})(jQuery);; 1368/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) 1369* Licensed under the MIT License (LICENSE.txt). 1370* 1371* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. 1372* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. 1373* Thanks to: Seamus Leahy for adding deltaX and deltaY 1374* 1375* Version: 3.0.4 1376* 1377* Requires: 1.2.2+ 1378*/ 1379 1380(function(d){function g(a){var b=a||window.event,i=[].slice.call(arguments,1),c=0,h=0,e=0;a=d.event.fix(b);a.type="mousewheel";if(a.wheelDelta)c=a.wheelDelta/120;if(a.detail)c=-a.detail/3;e=c;if(b.axis!==undefined&&b.axis===b.HORIZONTAL_AXIS){e=0;h=-1*c}if(b.wheelDeltaY!==undefined)e=b.wheelDeltaY/120;if(b.wheelDeltaX!==undefined)h=-1*b.wheelDeltaX/120;i.unshift(a,c,h,e);return d.event.handle.apply(this,i)}var f=["DOMMouseScroll","mousewheel"];d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a= 1381f.length;a;)this.addEventListener(f[--a],g,false);else this.onmousewheel=g},teardown:function(){if(this.removeEventListener)for(var a=f.length;a;)this.removeEventListener(f[--a],g,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);; 1382/* 1383 * FancyBox - jQuery Plugin 1384 * Simple and fancy lightbox alternative 1385 * 1386 * Examples and documentation at: http://fancybox.net 1387 * 1388 * Copyright (c) 2008 - 2010 Janis Skarnelis 1389 * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. 1390 * 1391 * Version: 1.3.4 (11/11/2010) 1392 * Requires: jQuery v1.3+ 1393 * 1394 * Dual licensed under the MIT and GPL licenses: 1395 * http://www.opensource.org/licenses/mit-license.php 1396 * http://www.gnu.org/licenses/gpl.html 1397 */ 1398 1399;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>'); 1400F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)|| 1401c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick= 1402false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel", 1403function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+ 1404'"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';
1404P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win== 1405"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+ 1406";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor, 1407opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length? 1408d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding}); 1409y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height== 1410i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents()); 1411f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode== 141237||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});
1412if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto"); 1413s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j); 1414f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c); 1415j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type== 1416"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"), 141710)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)}; 1418b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k= 14190,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+ 14201)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h= 1421true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");
1421b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1; 1422b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5- 1423d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f); 1424D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()}); 1425b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}}; 1426b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing", 1427easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);; 1428(function($) { 1429 $(document).ready(function () { 1430 1431 $('#ee_photo_gallery a').addClass('fancybox'); 1432 1433 $('.fancybox').fancybox({ 1434 'titlePosition' : 'inside', 1435 'padding' : '25', 1436 'type' : 'image' 1437 }); 1438 1439 var img_w = $("#fancybox-content img").width(); 1440 img_w2 = img_w - 60; 1441 $('#fancybox-content #page-title').css('width', img_w2 + 'px' ); 1442 $('#fancybox-content .field-name-field-legende-photo').css('width', img_w + 'px' ); 1443 }); 1444}(jQuery)); 1445 1446; 1447(function($) { 1448 $(document).ready(function(){ 1449 1450 // Egalisateur de colonnes Membres 1451 $('.group_members').each(function() { 1452 var tallest = 0; 1453 $(this).children('div.member').each(function() { 1454 var thisHeight = $(this).height(); 1455 if (thisHeight > tallest) { 1456 tallest = thisHeight; 1457 } 1458 }); 1459 $(this).children().height(tallest); 1460 }); 1461 1462 $(".group_list").collapse({ 1463 head:".group_title", 1464 show: function(){ 1465 this.animate({ 1466 opacity: 'toggle', 1467 height: 'toggle' 1468 }, 300); 1469 }, 1470 hide : function() { 1471 this.animate({ 1472 opacity: 'toggle', 1473 height: 'toggle' 1474 }, 300); 1475 } 1476 }); 1477 1478 }); 1479}(jQuery)); 1480; 1481(function ($) { 1482 1483 Drupal.behaviors.captcha = { 1484 attach: function (context) { 1485 1486 // Turn off autocompletion for the CAPTCHA response field. 1487 // We do it here with JavaScript (instead of directly in the markup) 1488 // because this autocomplete attribute is not standard and 1489 // it would break (X)HTML compliance. 1490 $("#edit-captcha-response").attr("autocomplete", "off"); 1491 1492 } 1493 }; 1494 1495 Drupal.behaviors.captchaAdmin = { 1496 attach: function (context) {
1497 // Add onclick handler to checkbox for adding a CAPTCHA description 1498 // so that the textfields for the CAPTCHA description are hidden 1499 // when no description should be added. 1500 // @todo: div.form-item-captcha-description depends on theming, maybe 1501 // it's better to add our own wrapper with id (instead of a class). 1502 $("#edit-captcha-add-captcha-description").click(function() { 1503 if ($("#edit-captcha-add-captcha-description").is(":checked")) { 1504 // Show the CAPTCHA description textfield(s). 1505 $("div.form-item-captcha-description").show('slow'); 1506 } 1507 else { 1508 // Hide the CAPTCHA description textfield(s). 1509 $("div.form-item-captcha-description").hide('slow'); 1510 } 1511 }); 1512 // Hide the CAPTCHA description textfields if option is disabled on page load. 1513 if (!$("#edit-captcha-add-captcha-description").is(":checked")) { 1514 $("div.form-item-captcha-description").hide(); 1515 } 1516 } 1517 1518 }; 1519 1520})(jQuery); 1521; 1522; 1523(function ($) { 1524 1525/** 1526 * A progressbar object. Initialized with the given id. Must be inserted into 1527 * the DOM afterwards through progressBar.element. 1528 * 1529 * method is the function which will perform the HTTP request to get the 1530 * progress bar state. Either "GET" or "POST". 1531 * 1532 * e.g. pb = new progressBar('myProgressBar'); 1533 * some_element.appendChild(pb.element); 1534 */ 1535Drupal.progressBar = function (id, updateCallback, method, errorCallback) { 1536 var pb = this; 1537 this.id = id; 1538 this.method = method || 'GET'; 1539 this.updateCallback = updateCallback; 1540 this.errorCallback = errorCallback; 1541 1542 // The WAI-ARIA setting aria-live="polite" will announce changes after users 1543 // have completed their current activity and not interrupt the screen reader. 1544 this.element = $('<div class="progress" aria-live="polite"></div>').attr('id', id); 1545 this.element.html('<div class="bar"><div class="filled"></div></div>' + 1546 '<div class="percentage"></div>' + 1547 '<div class="message"> </div>'); 1548}; 1549 1550/** 1551 * Set the percentage and status message for the progressbar. 1552 */ 1553Drupal.progressBar.prototype.setProgress = function (percentage, message) { 1554 if (percentage >= 0 && percentage <= 100) { 1555 $('div.filled', this.element).css('width', percentage + '%'); 1556 $('div.percentage', this.element).html(percentage + '%'); 1557 } 1558 $('div.message', this.element).html(message); 1559 if (this.updateCallback) { 1560 this.updateCallback(percentage, message, this); 1561 } 1562}; 1563 1564/** 1565 * Start monitoring progress via Ajax. 1566 */ 1567Drupal.progressBar.prototype.startMonitoring = function (uri, delay) { 1568 this.delay = delay; 1569 this.uri = uri; 1570 this.sendPing(); 1571}; 1572 1573/** 1574 * Stop monitoring progress via Ajax. 1575 */ 1576Drupal.progressBar.prototype.stopMonitoring = function () { 1577 clearTimeout(this.timer); 1578 // This allows monitoring to be stopped from within the callback. 1579 this.uri = null; 1580}; 1581 1582/** 1583 * Request progress data from server. 1584 */ 1585Drupal.progressBar.prototype.sendPing = function () { 1586 if (this.timer) { 1587 clearTimeout(this.timer); 1588 } 1589 if (this.uri) { 1590 var pb = this; 1591 // When doing a post request, you need non-null data. Otherwise a 1592 // HTTP 411 or HTTP 406 (with Apache mod_security) error may result. 1593 $.ajax({ 1594 type: this.method, 1595 url: this.uri, 1596 data: '', 1597 dataType: 'json', 1598 success: function (progress) { 1599 // Display errors. 1600 if (progress.status == 0) { 1601 pb.displayError(progress.data); 1602 return; 1603 } 1604 // Update display. 1605 pb.setProgress(progress.percentage, progress.message); 1606 // Schedule next timer. 1607 pb.timer = setTimeout(function () { pb.sendPing(); }, pb.delay); 1608 }, 1609 error: function (xmlhttp) { 1610 pb.displayError(Drupal.ajaxError(xmlhttp, pb.uri)); 1611 } 1612 }); 1613 } 1614}; 1615 1616/** 1617 * Display errors on the page. 1618 */ 1619Drupal.progressBar.prototype.displayError = function (string) { 1620 var error = $('<div class="messages error"></div>').html(string); 1621 $(this.element).before(error).hide(); 1622 1623 if (this.errorCallback) { 1624 this.errorCallback(this); 1625 } 1626}; 1627 1628})(jQuery); 1629;
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.