1(function ($) { 2 3/** 4 * A progressbar object. Initialized with the given id. Must be inserted into 5 * the DOM afterwards through progressBar.element. 6 * 7 * method is the function which will perform the HTTP request to get the 8 * progress bar state. Either "GET" or "POST". 9 * 10 * e.g. pb = new progressBar('myProgressBar'); 11 * some_element.appendChild(pb.element); 12 */ 13Drupal.progressBar = function (id, updateCallback, method, errorCallback) { 14 var pb = this; 15 this.id = id; 16 this.method = method || 'GET'; 17 this.updateCallback = updateCallback; 18 this.errorCallback = errorCallback; 19 20 // The WAI-ARIA setting aria-live="polite" will announce changes after users 21 // have completed their current activity and not interrupt the screen reader. 22 this.element = $('<div class="progress" aria-live="polite"></div>').attr('id', id); 23 this.element.html('<div class="bar"><div class="filled"></div></div>' + 24 '<div class="percentage"></div>' + 25 '<div class="message"> </div>'); 26}; 27 28/** 29 * Set the percentage and status message for the progressbar. 30 */ 31Drupal.progressBar.prototype.setProgress = function (percentage, message) { 32 if (percentage >= 0 && percentage <= 100) { 33 $('div.filled', this.element).css('width', percentage + '%'); 34 $('div.percentage', this.element).html(percentage + '%'); 35 } 36 $('div.message', this.element).html(message); 37 if (this.updateCallback) { 38 this.updateCallback(percentage, message, this); 39 } 40}; 41 42/** 43 * Start monitoring progress via Ajax. 44 */ 45Drupal.progressBar.prototype.startMonitoring = function (uri, delay) { 46 this.delay = delay; 47 this.uri = uri; 48 this.sendPing(); 49}; 50 51/** 52 * Stop monitoring progress via Ajax. 53 */ 54Drupal.progressBar.prototype.stopMonitoring = function () { 55 clearTimeout(this.timer); 56 // This allows monitoring to be stopped from within the callback. 57 this.uri = null; 58}; 59 60/** 61 * Request progress data from server. 62 */ 63Drupal.progressBar.prototype.sendPing = function () { 64 if (this.timer) { 65 clearTimeout(this.timer); 66 } 67 if (this.uri) { 68 var pb = this; 69 // When doing a post request, you need non-null data. Otherwise a 70 // HTTP 411 or HTTP 406 (with Apache mod_security) error may result. 71 $.ajax({ 72 type: this.method, 73 url: this.uri, 74 data: '', 75 dataType: 'json', 76 success: function (progress) { 77 // Display errors. 78 if (progress.status == 0) { 79 pb.displayError(progress.data); 80 return; 81 } 82 // Update display. 83 pb.setProgress(progress.percentage, progress.message); 84 // Schedule next timer. 85 pb.timer = setTimeout(function () { pb.sendPing(); }, pb.delay); 86 }, 87 error: function (xmlhttp) { 88 pb.displayError(Drupal.ajaxError(xmlhttp, pb.uri)); 89 } 90 }); 91 } 92}; 93 94/** 95 * Display errors on the page. 96 */ 97Drupal.progressBar.prototype.displayError = function (string) { 98 var error = $('<div class="messages error"></div>').html(string); 99 $(this.element).before(error).hide(); 100 101 if (this.errorCallback) { 102 this.errorCallback(this); 103 } 104}; 105 106})(jQuery); 107; 108Drupal.locale = { 'pluralFormula': function ($n) { return Number(($n!=1)); }, 'strings': {"":{"An AJAX HTTP error occurred.":"Hubo un error HTTP AJAX.","HTTP Result Code: !status":"C\u00f3digo de Resultado HTTP: !status","An AJAX HTTP request terminated abnormally.":"Una solicitud HTTP de AJAX termin\u00f3 de manera anormal.","Debugging information follows.":"A continuaci\u00f3n se detalla la informaci\u00f3n de depuraci\u00f3n.","Path: !uri":"Ruta: !uri","StatusText: !statusText":"StatusText: !statusText","ResponseText: !responseText":"ResponseText: !responseText","ReadyState: !readyState":"ReadyState: !readyState","CustomMessage: !customMessage":"CustomMessage: !customMessage","Query":"Consulta","No results":"No hay resultados","clear":"limpiar","All":"Todo(s)","New":"Nuevo","Modules installed within the last week.":"M\u00f3dulos instalados en la \u00faltima semana.","No modules added within the last week.":"No hay m\u00f3dulos adicionados en la \u00faltima semana.","Recent":"Reciente","Modules enabled\/disabled
108within the last week.":"M\u00f3dulos habilitados\/deshabilitados en la \u00faltima semana.","No modules were enabled or disabled within the last week.":"No hay m\u00f3dulos habilitados o deshabilitados en la \u00faltima semana.","@enabled of @total":"@enabled de @total","Show shortcuts":"Mostrar atajos","Hide shortcuts":"Ocultar atajos","Hide":"Ocultar","Show":"Mostrar","Hide description":"Esconder descripci\u00f3n","Show description":"Mostrar descripci\u00f3n","Re-order rows by numerical weight instead of dragging.":"Reordenar las filas por peso num\u00e9rico en lugar de arrastrar.","Show row weights":"Mostrar pesos de la fila","Hide row weights":"Ocultar pesos de la fila","Drag to re-order":"Arrastre para reordenar","Changes made in this table will not be saved until the form is submitted.":"Los cambios realizados en esta tabla no se guardar\u00e1n hasta que se env\u00ede el formulario","Cancel":"Cancelar","Disabled":"Desactivado","Enabled":"Activado","None":"Ninguno","none":"ninguno","Edit":"Editar","Save":"Guardar","January":"Enero","February":"Febrero","March":"Marzo","April":"Abril","May":"Mayo","June":"Junio","July":"Julio","August":"Agosto","September":"Septiembre","October":"Octubre","November":"Noviembre","December":"Diciembre","Enable":"Activar","Disable":"Desactivar","Search":"Buscar","Add":"Agregar","Configure":"Configurar","Loading":"Cargando","No title":"Sin t\u00edtulo","Other":"Otro(s)","Select":"Seleccionar","@count year from now":"@count a\u00f1o desde ahora","@count years from now":"@count a\u00f1os desde ahora","Next":"Siguiente","Sunday":"Domingo","Monday":"Lunes","Tuesday":"Martes","Wednesday":"Mi\u00e9rcoles","Thursday":"Jueves","Friday":"Viernes","Saturday":"S\u00e1bado","Upload":"Subir al servidor","Done":"Hecho","Filter":"Filtro","Prev":"Ant","Mon":"Lun","Tue":"Mar","Wed":"Mi\u00e9","Thu":"Jue","Fri":"Vie","Sat":"S\u00e1b","Sun":"Dom","Select all rows in this table":"Seleccionar todas las filas de esta tabla","Deselect all rows in this table":"Quitar la selecci\u00f3n a todas las filas de esta tabla","Today":"Hoy","Jan":"Ene","Feb":"Feb","Apr":"Abr","Jun":"Jun","Jul":"Jul","Aug":"Ago","Sep":"Sep","Oct":"Oct","Nov":"Nov","Dec":"Dic","Su":"Do","Mo":"Lu","Tu":"Ma","We":"Mi","Th":"Ju","Fr":"Vi","Sa":"Sa","Not published":"No publicado","Please wait...":"Espere, por favor...","mm\/dd\/yy":"mm\/dd\/yy","Only files with the following extensions are allowed: %files-allowed.":"S\u00f3lo se permiten archivos con las siguientes extensiones: %files-allowed.","Not in book":"No est\u00e1 en un libro","New book":"Nuevo libro","By @name on @date":"Por @name en @date","By @name":"Por @name","Not in menu":"No est\u00e1 en un men\u00fa","Alias: @alias":"Alias: @alias","No alias":"Sin alias","New revision":"Nueva revisi\u00f3n","The changes to these blocks will not be saved until the \u003Cem\u003ESave blocks\u003C\/em\u003E button is clicked.":"Los cambios sobre estos bloques no se guardar\u00e1n hasta que no pulse el bot\u00f3n \u003Cem\u003EGuardar bloques\u003C\/em\u003E.","This permission is inherited from the authenticated user role.":"Este permiso se hereda del rol de usuario registrado.","No revision":"Sin revisi\u00f3n","@number comments per page":"@number comentarios por p\u00e1gina","Requires a title":"Necesita un t\u00edtulo","Not restricted":"Sin restricci\u00f3n","(active tab)":"(solapa activa)","Status message":"Mensaje de estado","Not customizable":"No personalizable","Restricted to certain pages":"Restringido a algunas p\u00e1ginas","The block cannot be placed in this region.":"El bloque no se puede colocar en esta regi\u00f3n.","Customize dashboard":"Personalizar panel de control","Hide summary":"Ocultar resumen","Edit summary":"Editar resumen","Don\u0027t display post information":"No mostrar informaci\u00f3n del env\u00edo","@title dialog":"Di\u00e1logo @title","The selected file %filename cannot be uploaded. Only files with the following extensions are allowed: %extensions.":"El archivo seleccionado %filename no se puede subir al servidor. Solo se permiten archivos con las siguientes extensiones: %extensions.","Autocomplete popup":"Ventana emergente con autocompletado","Searching for matches...":"Bu
108scando coincidencias","The response failed verification so will not be processed.":"La respuesta de verificaci\u00f3n fall\u00f3, por lo que no se procesar\u00e1.","The callback URL is not local and not trusted: !url":"La URL de callback (llamada) no es local y no es confiable: !url","Next page":"Siguiente p\u00e1gina","Previous page":"P\u00e1gina anterior","Downloads":"Descargas","Colorbox":"Colorbox","On by default with opt out":"Activado por defecto con opci\u00f3n de desactivar","Off by default with opt in":"Desactivado por defecto con elecci\u00f3n de activar","Not tracked":"No monitorizado","One domain with multiple subdomains":"Un dominio con m\u00faltiples subdominios","Multiple top-level domains":"M\u00faltiples dominios de nivel superior","All pages with exceptions":"Todas las p\u00e1ginas con excepciones","Excepted: @roles":"Exceptuando: @roles","A single domain":"Un \u00fanico dominio","Universal web tracking opt-out":"Desactivaci\u00f3n universal de monitorizaci\u00f3n web","No privacy":"Sin privacidad","@items enabled":"@items activado","Mailto links":"Enlaces de Correo electr\u00f3nico","AdSense ads":"Anuncios de AdSense","Anonymize IP":"Anonimizar IP","Display features":"Caracter\u00edsticas de la presentaci\u00f3n","Ignored from settings":"Ignorado por los ajustes","No style":"Sin estilo","-Close all-":"-Cerrar todo-","-Open all-":"-Abrir todo-","Available tokens":"Comodines disponibles","Insert this token into your form":"Inserte este comod\u00edn en su formulario","First click a text field to insert your tokens into.":"Primero haga clic en un campo de texto en el que quiera insertar sus patrones de reemplazo.","Loading token browser...":"Cargando navegador de comodines...","No name":"Sin nombre","Remove group":"Eliminar grupo","Apply (all displays)":"Aplicar (todas las presentaciones)","Apply (this display)":"Aplicar (esta presentaci\u00f3n)","Revert to default":"Volver a los valores predeterminados","Mar":"Mar","@label: @value":"@label: @value","Using defaults":"Usando valores por defecto","List additional actions":"Lista adicional de acciones","Automatic alias":"Alias autom\u00e1tico","Close":"Cerrar","Select all children":"Seleccionar todos los descendientes","Deselect all children":"Anular la selecci\u00f3n de todos los hijos","Click update to save the configuration":"Pulse actualizar para guardar la configuraci\u00f3n","Select All":"Seleccionar todo","Select None":"Seleccione Ninguno","required":"necesario","Inclusion: @value":"Inclusi\u00f3n: @value","Priority: @value":"Prioridad: @value","Scheduled for publishing":"Estilo de panel para \u0022!pane\u0022","Publishing enabled":"Publicaci\u00f3n activada","Scheduled for unpublishing":"Planificado para ser despublicado","Not scheduled":"No planificado","Unpublishing enabled":"Anular la publicaci\u00f3n habilitado","Translatable":"Traducible","Not translatable":"No traducible","Restricted to certain languages":"Restringido a ciertos idiomas","Outbound links":"Enlaces salientes","Link attribution":"Atribuci\u00f3n de enlace","URL fragments":"Fragmentos de URL","Site search":"B\u00fasqueda en el sitio","No redirects":"Sin redirecciones","Contacting @title...":"Contactando con @title...","This will discard all unsaved changes. Are you sure?":"Esto descartar\u00e1 todos los cambios no guardados. \u00bfEst\u00e1 seguro?","Remove this pane?":"\u00bfEliminar este panel?","Log messages":"Registrar mensajes","Please select a file.":"Seleccione un documento, por favor.","You are not allowed to operate on more than %num files.":"No tiene permiso para actuar sobre m\u00e1s de %num documentos.","Please specify dimensions within the allowed range that is from 1x1 to @dimensions.":"Especifique unas dimensiones dentro de las permitidas, por favor. Eso va desde 1 \u00d7 1 a @dimensions.","%filename is not an image.":"%filename no es una imagen.","Do you want to refresh the current directory?":"\u00bfQuiere actualizar la vista de este directorio?","Delete selected files?":"\u00bfBorrar los documentos seleccionados?","Please select a thumbnail.":"Seleccione una minatura, por favor.","You must select at least %num files.":"Debe seleccionar al menos %num documentos.","You can not perform this operation.":"No puede realizar esta operaci\u00f3n.","Insert file":"Insertar archivo","Change view":"Cambiar vista","Approved by default.":"Aprobado de forma predeterminada.","Moderated by default.":"Moderado de forma predeterminada.","No message is displayed by default.":"De forma predeterminada, no se muestra
108ning\u00fan mensaje.","Message is displayed by default.":"Se muestra el mensaje de forma predeterminada.","%limit transactions, %usercount users per page.":"%limit transacciones, %usercount usuarios por p\u00e1gina.","Default: %category\u003Cbr \/\u003EDisplayed: %display_categories":"Predeterminado: %category\u003Cbr \/\u003EMostrado: %display_categories","Always use system time for transactions.":"Siempre utilizar la hora del sistema para transacciones.","Allow customization of transaction time.":"Permitir la personalizaci\u00f3n de la hora de las transacciones.","Expiration at %date.":"Vencimiento en %date.","Expiration in %date.":"Vencimiento en %date.","No expiration.":"Sin vencimiento.","Translate Text":"Traducir texto","An HTTP error @status occured.":"Ha ocurrido un error de HTTP @status."},"shs":{"\u003CAdd new item\u003E":"\u003C A\u00f1adir nuevo \u00edtem\u003E"}} };; 109(function ($) { 110Drupal.settings.views = Drupal.settings.views || {'ajax_path': '/views/ajax'}; 111 112Drupal.quicktabs = Drupal.quicktabs || {}; 113 114Drupal.quicktabs.getQTName = function (el) { 115 return el.id.substring(el.id.indexOf('-') +1); 116} 117 118Drupal.behaviors.quicktabs = { 119 attach: function (context, settings) { 120 $.extend(true, Drupal.settings, settings); 121 $('.quicktabs-wrapper', context).once(function(){ 122 Drupal.quicktabs.prepare(this); 123 }); 124 } 125} 126 127// Setting up the inital behaviours 128Drupal.quicktabs.prepare = function(el) { 129 // el.id format: "quicktabs-$name" 130 var qt_name = Drupal.quicktabs.getQTName(el); 131 var $ul = $(el).find('ul.quicktabs-tabs:first'); 132 133 $("ul.quicktabs-tabs li a span#active-quicktabs-tab").remove(); 134 135 $ul.find('li a').each(function(i, element){ 136 element.myTabIndex = i; 137 element.qt_name = qt_name; 138 139 var tab = new Drupal.quicktabs.tab(element); 140 var parent_li = $(element).parents('li').get(0); 141 if ($(parent_li).hasClass('active')) { 142 $(element).addClass('quicktabs-loaded'); 143 $(element).append('<span id="active-quicktabs-tab" class="element-invisible">' + Drupal.t('(active tab)') + '</span>'); 144 } 145 $(element).once(function() {$(this).bind('click', {tab: tab}, Drupal.quicktabs.clickHandler);}); 146 }); 147} 148 149Drupal.quicktabs.clickHandler = function(event) { 150 var tab = event.data.tab; 151 var element = this; 152 // Set clicked tab to active. 153 $(this).parents('li').siblings().removeClass('active'); 154 $(this).parents('li').addClass('active'); 155 156 $("ul.quicktabs-tabs li a span#active-quicktabs-tab").remove(); 157 $(this).append('<span id="active-quicktabs-tab" class="element-invisible">' + Drupal.t('(active tab)') + '</span>'); 158 159 // Hide all tabpages. 160 tab.container.children().addClass('quicktabs-hide'); 161 162 if (!tab.tabpage.hasClass("quicktabs-tabpage")) { 163 tab = new Drupal.quicktabs.tab(element); 164 } 165 166 tab.tabpage.removeClass('quicktabs-hide'); 167 $(element).trigger('switchtab'); 168 return false; 169} 170 171// Constructor for an individual tab 172Drupal.quicktabs.tab = function (el) { 173 this.element = el; 174 this.tabIndex = el.myTabIndex; 175 var qtKey = 'qt_' + el.qt_name; 176 var i = 0; 177 for (var key in Drupal.settings.quicktabs[qtKey].tabs) { 178 if (i == this.tabIndex) { 179 this.tabObj = Drupal.settings.quicktabs[qtKey].tabs[key]; 180 this.tabKey = key; 181 } 182 i++; 183 } 184 this.tabpage_id = 'quicktabs-tabpage-' + el.qt_name + '-' + this.tabKey; 185 this.container = $('#quicktabs-container-' + el.qt_name); 186 this.tabpage = this.container.find('#' + this.tabpage_id); 187} 188 189if (Drupal.ajax) { 190 /** 191 * Handle an event that triggers an AJAX response. 192 * 193 * We unfortunately need to override this function, which originally comes from 194 * misc/ajax.js, in order to be able to cache loaded tabs, i.e. once a tab 195 * content has loaded it should not need to be loaded again. 196 * 197 * I have removed all comments that were in the original core function, so that 198 * the only comments inside this function relate to the Quicktabs modification 199 * of it. 200 */ 201 Drupal.ajax.prototype.eventResponse = function (element, event) { 202 var ajax = this; 203 204 if (ajax.ajaxing) { 205 return false; 206 } 207 208 try { 209 if (ajax.form) { 210 if (ajax.setClick) { 211 element.form.clk = element; 212 } 213 214 ajax.form.ajaxSubmit(ajax.options); 215 } 216 else {
217 // Do not perform an ajax request for already loaded Quicktabs content. 218 if (!$(element).hasClass('quicktabs-loaded')) { 219 ajax.beforeSerialize(ajax.element, ajax.options); 220 $.ajax(ajax.options); 221 if ($(element).parents('ul').hasClass('quicktabs-tabs')) { 222 $(element).addClass('quicktabs-loaded'); 223 } 224 } 225 } 226 } 227 catch (e) { 228 ajax.ajaxing = false; 229 alert("An error occurred while attempting to process " + ajax.options.url + ": " + e.message); 230 } 231 return false; 232 }; 233} 234 235 236})(jQuery); 237; 238Drupal.TBMegaMenu = Drupal.TBMegaMenu || {}; 239 240(function ($) { 241 Drupal.TBMegaMenu.oldWindowWidth = 0; 242 Drupal.TBMegaMenu.displayedMenuMobile = false; 243 Drupal.TBMegaMenu.supportedScreens = [980]; 244 Drupal.TBMegaMenu.menuResponsive = function () { 245 var windowWidth = window.innerWidth ? window.innerWidth : $(window).width(); 246 var navCollapse = $('.tb-megamenu').children('.nav-collapse'); 247 if (windowWidth < Drupal.TBMegaMenu.supportedScreens[0]) { 248 navCollapse.addClass('collapse'); 249 if (Drupal.TBMegaMenu.displayedMenuMobile) { 250 navCollapse.css({height: 'auto', overflow: 'visible'}); 251 } else { 252 navCollapse.css({height: 0, overflow: 'hidden'}); 253 } 254 } else { 255 // If width of window is greater than 980 (supported screen). 256 navCollapse.removeClass('collapse'); 257 if (navCollapse.height() <= 0) { 258 navCollapse.css({height: 'auto', overflow: 'visible'}); 259 } 260 } 261 }; 262 263 Drupal.TBMegaMenu.focusNextPrevElement = function (direction) { 264 // Add all the elements we want to include in our selection 265 var focusableElements = 'a:not([disabled]), button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), details:not([disabled]), [tabindex]:not([disabled]):not([tabindex="-1"])'; 266 var $current = $(document.activeElement); 267 268 if ($current.length) { 269 var $focusable = $(focusableElements).filter(function() { 270 var $this = $(this); 271 return $this.closest('.tb-megamenu-subnav').length === 0 && $this.is(':visible'); 272 }) 273 274 var index = $focusable.index($current); 275 if (index > -1) { 276 if (direction === 'next') { 277 var nextElement = $focusable[index + 1] || $focusable[0]; 278 } 279 else { 280 var nextElement = $focusable[index - 1] || $focusable[0]; 281 } 282 283 nextElement.focus(); 284 } 285 } 286 } 287 288 289 Drupal.behaviors.tbMegaMenuAction = { 290 attach: function(context) { 291 292 /* Keyboard Control Setup */ 293 // Semi-Global Variables 294 $('.tb-megamenu').once('tb-megamenu', function() { 295 296 var navParent = document.querySelector('.tb-megamenu'), 297 linkArray = new Array(), 298 curPos = new Array(-1,-1,-1); 299 300 // Each Top-Level Link 301 $('.tb-megamenu').find('.level-1').children('a').not('.mobile-only').each(function(i,toplink) { 302 linkArray[i] = new Array(); 303 304 // Add Link to Array 305 linkArray[i][-1] = toplink; 306 307 // Determine Coordinates 308 $(toplink).data({ coordinate: [i, -1] }); 309 310 // Each Column 311 $(toplink).next().children().children().children('.mega-col-nav').each(function(j,column) { 312 linkArray[i][j] = new Array(); 313 314 // Each Link 315 $(column).find('a').each(function(k,sublink) { 316 317 // Add Link to Array 318 linkArray[i][j][k] = sublink; 319 320 // Determine Coordinates 321 $(sublink).data({ coordinate: [i, j, k] }); 322 }); // each link 323 324 }); // each column 325 326 }); // each top-level link 327 328 // Update Position on Focus 329 $('.tb-megamenu').find('a').focus(function() { 330 curPos = $(this).data('coordinate'); 331 }); 332 333 /* Event Listener */ 334 // On Keydown 335 if (navParent !== null) { 336 navParent.addEventListener('keydown',keydownEvent); 337 } 338 339 // Key Pressed 340 function keydownEvent(k) { 341 // Determine Key 342 switch(k.keyCode) { 343 344 // TAB 345 case 9: 346 k.preventDefault(); 347 nav_tab(k); 348 break; 349 350 // RETURN 351 case 13: 352 nav_open_link(); 353 break; 354 355 // ESC 356 case 27: 357 nav_esc(); 358 break; 359 360 // LEFT 361 case 37: 362 k.preventDefault(); 363 nav_left(); 364 break; 365 366 // UP 367 case 38: 368 k.preventDefault(); 369 nav_up(); 370 break; 371 372 // RIGHT 373 case 39: 374 k.preventDefault(); 375 nav_right(); 376 break; 377 378 // DOWN 379 case 40: 380 k.preventDefault(); 381 nav_down(); 382 break; 383 384 // HOME 385 case 36: 386 nav_home(); 387 break; 388 389 // END 390 case 35: 391 nav_end(); 392 break; 393 394 // Else 395 default:
396 // Do nothing 397 398 } // determine key 399 } // keydownEvent 400 401 /* Keypress Functions */ 402 // Tab 403 function nav_tab(k) { 404 if(nav_is_toplink()) { 405 if(k.shiftKey) { 406 nav_prev_toplink(); 407 } else { 408 nav_next_toplink(); 409 } 410 } else { 411 if(k.shiftKey) { 412 nav_up(); 413 } else { 414 nav_down(); 415 } 416 } 417 } 418 419 // Open Link 420 function nav_open_link() { 421 linkArray[curPos[0]][curPos[1]][curPos[2]].click(); 422 } 423 424 // Escape 425 function nav_esc() { 426 nav_close_megamenu(); 427 } 428 429 // Left 430 function nav_left() { 431 if(nav_is_toplink()) { 432 nav_prev_toplink(); 433 } else { 434 nav_prev_column(); 435 } 436 } 437 438 // Right 439 function nav_right() { 440 if(nav_is_toplink()) { 441 nav_next_toplink(); 442 } else { 443 nav_next_column(); 444 } 445 } 446 447 // Up 448 function nav_up() { 449 if(nav_is_toplink()) { 450 nav_prev_toplink(); 451 } else { 452 if(linkArray[curPos[0]][curPos[1]][curPos[2] - 1]) { 453 linkArray[curPos[0]][curPos[1]][curPos[2] - 1].focus(); 454 } else { 455 nav_prev_column(); 456 } 457 } 458 } 459 460 // Down 461 function nav_down() { 462 if(nav_is_toplink()) { 463 nav_next_column(); 464 } else { 465 if(linkArray[curPos[0]][curPos[1]][curPos[2] + 1]) { 466 linkArray[curPos[0]][curPos[1]][curPos[2] + 1].focus(); 467 } else { 468 nav_next_column(); 469 } 470 } 471 } 472 473 // Home Button 474 function nav_home() { 475 if(nav_is_toplink()) { 476 linkArray[0][-1].focus(); 477 } else { 478 linkArray[curPos[0]][0][0].focus(); 479 } 480 } 481 482 // End Button 483 function nav_end() { 484 if(nav_is_toplink()) { 485 linkArray.slice(-1)[0][-1].focus(); 486 } else { 487 linkArray[curPos[0]].slice(-1)[0].slice(-1)[0].focus(); 488 } 489 } 490 491 /* Helper Functions */ 492 // Determine Link Level 493 function nav_is_toplink() { 494 return (curPos[1] < 0); 495 } 496 497 // Close Mega Menu 498 function nav_close_megamenu() { 499 $('.tb-megamenu .open').removeClass('open'); 500 $('.tb-megamenu-item.dropdown-submenu.open').removeClass('open'); 501 ariaCheck(); 502 } 503 504 // Next Toplink 505 function nav_next_toplink() { 506 if(linkArray[curPos[0] + 1]) { 507 linkArray[curPos[0] + 1][-1].focus(); 508 } else { 509 nav_close_megamenu(); 510 511 // Focus on the next element. 512 Drupal.TBMegaMenu.focusNextPrevElement('next'); 513 } 514 } 515 516 // Previous Toplink 517 function nav_prev_toplink() { 518 if(linkArray[curPos[0] - 1]) { 519 linkArray[curPos[0] - 1][-1].focus(); 520 } else { 521 // Focus on the previous element. 522 Drupal.TBMegaMenu.focusNextPrevElement('prev'); 523 } 524 } 525 526 // Previous Column 527 function nav_prev_column() { 528 if(linkArray[curPos[0]][curPos[1] - 1][0]) { 529 linkArray[curPos[0]][curPos[1] - 1][0].focus(); 530 } else { 531 nav_parent_toplink(); 532 } 533 } 534 535 // Next Column 536 function nav_next_column() { 537 if(linkArray[curPos[0]][curPos[1] + 1]) { 538 linkArray[curPos[0]][curPos[1] + 1][0].focus(); 539 } else { 540 nav_parent_toplink(); 541 } 542 } 543 544 // Go to Parent Toplink 545 function nav_parent_toplink() { 546 linkArray[curPos[0]][-1].focus(); 547 } 548 549 var ariaCheck = function() { 550 $("li.tb-megamenu-item").each(function () { 551 if ($(this).is('.mega-group')) { 552 // Mega menu item has mega class (it's a true mega menu) 553 if(!$(this).parents().is('.open')) { 554 // Mega menu item has mega class and its ancestor is closed, so apply appropriate ARIA attributes 555 $(this).children().attr('aria-expanded', 'false'); 556 } 557 else if ($(this).parents().is('.open')) { 558 // Mega menu item has mega class and its ancestor is o
558pen, so apply appropriate ARIA attributes 559 $(this).children().attr('aria-expanded', 'true'); 560 } 561 } 562 else if ($(this).is('.dropdown') || $(this).is('.dropdown-submenu')) { 563 // Mega menu item has dropdown (it's a flyout menu) 564 if (!$(this).is('.open')) { 565 // Mega menu item has dropdown class and is closed, so apply appropriate ARIA attributes 566 $(this).children().attr('aria-expanded', 'false'); 567 } 568 else if ($(this).is('.open')) { 569 // Mega menu item has dropdown class and is open, so apply appropriate ARIA attributes 570 $(this).children().attr('aria-expanded', 'true'); 571 } 572 } 573 else { 574 // Mega menu item is neither a mega or dropdown class, so remove ARIA attributes (it doesn't have children) 575 $(this).children().removeAttr('aria-expanded'); 576 } 577 }); 578 }; 579 580 var showMenu = function ($subMenu, mm_timeout) { 581 // console.log("showMenu"); 582 if ($subMenu.hasClass('mega')) { 583 $subMenu.addClass('animating'); 584 clearTimeout($subMenu.data('animatingTimeout')); 585 $subMenu.data('animatingTimeout', setTimeout(function () { 586 $subMenu.removeClass('animating') 587 }, mm_timeout)); 588 clearTimeout($subMenu.data('hoverTimeout')); 589 $subMenu.data('hoverTimeout', setTimeout(function () { 590 $subMenu.addClass('open'); 591 ariaCheck(); 592 }, 100)); 593 } 594 else { 595 clearTimeout($subMenu.data('hoverTimeout')); 596 $subMenu.data('hoverTimeout', 597 setTimeout(function () { 598 $subMenu.addClass('open'); 599 ariaCheck(); 600 }, 100)); 601 } 602 }; 603 var hideMenu = function ($subMenu, mm_timeout) { 604 // console.log("hideMenu"); 605 $subMenu.children('.dropdown-toggle').attr('aria-expanded', 'false'); 606 if ($subMenu.hasClass('mega')) { 607 $subMenu.addClass('animating'); 608 clearTimeout($subMenu.data('animatingTimeout')); 609 $subMenu.data('animatingTimeout', setTimeout(function () { 610 $subMenu.removeClass('animating') 611 }, mm_timeout)); 612 clearTimeout($subMenu.data('hoverTimeout')); 613 $subMenu.data('hoverTimeout', setTimeout(function () { 614 $subMenu.removeClass('open'); 615 ariaCheck(); 616 }, 100)); 617 } 618 else { 619 clearTimeout($subMenu.data('hoverTimeout')); 620 $subMenu.data('hoverTimeout', setTimeout(function () { 621 $subMenu.removeClass('open'); 622 ariaCheck(); 623 }, 100)); 624 } 625 }; 626 627 $('.tb-megamenu-button', context).once('menuIstance', function () { 628 var This = this; 629 $(This).click(function() { 630 if(parseInt($(this).parent().children('.nav-collapse').height())) { 631 $(this).parent().children('.nav-collapse').css({height: 0, overflow: 'hidden'}); 632 Drupal.TBMegaMenu.displayedMenuMobile = false; 633 } 634 else { 635 $(this).parent().children('.nav-collapse').css({height: 'auto', overflow: 'visible'}); 636 Drupal.TBMegaMenu.displayedMenuMobile = true; 637 } 638 }); 639 }); 640 641 642 var isTouch = window.matchMedia('(pointer: coarse)').matches; 643 if (!isTouch) { 644 $(document).ready(function ($) { 645 var mm_duration = 0; 646 $('.tb-megamenu', context).each(function () { 647 if ($(this).data('duration')) { 648 mm_duration = $(this).data('duration'); 649 } 650 }); 651 652 var mm_timeout = mm_duration ? 100 + mm_duration : 500; 653 $('.nav > li, li.mega', context).bind('mouseenter', function (event) { 654 showMenu($(this), mm_timeout); 655 }); 656 $('.nav > li > .dropdown-toggle, li.mega > .dropdown-toggle', context).bind('focus', function (event) { 657 var $this = $(this); 658 var $subMenu = $this.closest('li'); 659 // console.log("showMenu call"); 660 showMenu($subMenu, mm_timeout); 661 // If the focus moves outside of the subMenu, close it. 662 $(document).bind('focusin', function (event) { 663 if ($subMenu.has(event.target).length) { 664 return; 665 } 666 $(document).unbind(event); 667 // console.log("hideMenu call"); 668 hideMenu($subMenu, mm_timeout); 669 }); 670 }); 671 $('.nav > li, li.mega', context).bind('mouseleave', function (event) { 672 hideMenu($(this), mm_timeout); 673 }); 674 }); 675 676 /** 677 * Allow tabbing by appending the open class. 678 * Works in tandem with CSS changes that utilize opacity rather than 679 * display none 680 */ 681 // If the selected anchor is not in the TB Megamenu, remove all "open" 682 // class occurrences 683 $('a').focus(function (event) { 684 if (!$(this).parent().hasClass('tb-megamenu-item') && !$(this).parents('.tb-megamenu-block').length) {
685 nav_close_megamenu(); 686 } 687 }); 688 689 $('.nav > li > a, li.mega > a').focus(function (event) { 690 // Remove all occurrences of "open" from other menu trees 691 var siblings = $(this).parents('.tb-megamenu-item').siblings(); 692 // var siblings = $(this).closest('.tb-megamenu-item.level-1').siblings(); 693 $.each(siblings, function (i, v) { 694 var cousins = $(v).find('.open'); 695 $.each(cousins, function (index, value) { 696 $(value).removeClass('open'); 697 ariaCheck($(this)); 698 }); 699 $(v).removeClass('open'); 700 ariaCheck(); 701 }); 702 // Open the submenu if the selected item has one 703 if ($(this).next(".tb-megamenu-submenu").length > 0) { 704 if (!$(this).parent().hasClass("open")) { 705 $(this).parent().addClass("open"); 706 } 707 } 708 // If the anchor's top-level parent is not open, open it 709 if (!$(this).closest('.tb-megamenu-item.dropdown').hasClass('open') && $(this).closest('.tb-megamenu-item.dropdown').find('.tb-megamenu-submenu').length > 0) { 710 $(this).closest('.tb-megamenu-item.dropdown').addClass('open'); 711 ariaCheck(); 712 } 713 // If anchor's parent submenus are not open, open them 714 var parents = $(this).parents('.tb-megamenu-item.dropdown-submenu'); 715 $.each(parents, function (i, v) { 716 if (!$(v).hasClass('open')) { 717 $(v).addClass('open'); 718 ariaCheck(); 719 } 720 }); 721 }); 722 } 723 724 $(window).resize(function() { 725 var windowWidth = window.innerWidth ? window.innerWidth : $(window).width(); 726 if(windowWidth != Drupal.TBMegaMenu.oldWindowWidth){ 727 Drupal.TBMegaMenu.oldWindowWidth = windowWidth; 728 Drupal.TBMegaMenu.menuResponsive(); 729 } 730 }); 731 732 }); 733 }, 734 } 735})(jQuery); 736; 737Drupal.TBMegaMenu = Drupal.TBMegaMenu || {}; 738 739(function ($) { 740 Drupal.TBMegaMenu.createTouchMenu = function(items) { 741 items.children('a, .tb_nolink').each( function() { 742 var $item = $(this); 743 var tbitem = $(this).parent(); 744 745 $item.click( function(event){ 746 if ($item.hasClass('tb-megamenu-clicked')) { 747 var $uri = $item.attr('href'); 748 if ($uri && $uri !== '#') { 749 window.location.href = $uri; 750 } 751 } 752 else { 753 event.preventDefault(); 754 $item.addClass('tb-megamenu-clicked'); 755 if(!tbitem.hasClass('open')){ 756 tbitem.addClass('open'); 757 } 758 759 // Find any parent siblings that are open and close them. 760 tbitem.siblings('.open').find('.tb-megamenu-clicked').removeClass('tb-megamenu-clicked'); 761 tbitem.siblings('.open').removeClass('open'); 762 763 $('body').addClass('tb-megamenu-open'); 764 } 765 }); 766 }); 767 } 768 769 Drupal.TBMegaMenu.eventStopPropagation = function(event) { 770 if (event.stopPropagation) { 771 event.stopPropagation(); 772 } 773 else if (window.event) { 774 window.event.cancelBubble = true; 775 } 776 } 777 778 Drupal.behaviors.tbMegaMenuTouchAction = { 779 attach: function(context) { 780 var isTouch = window.matchMedia('(pointer: coarse)').matches; 781 if(isTouch){ 782 $('html').addClass('touch'); 783 Drupal.TBMegaMenu.createTouchMenu($('.tb-megamenu ul.nav li.mega').has('.dropdown-menu')); 784 785 // When the user touches anywhere outside of the open menu item, close 786 // the open menu item. 787 $(document).on('touchstart', function(event) { 788 if ($('body').hasClass('tb-megamenu-open') && !$(event.target).closest('.mega.open').length) { 789 $('.tb-megamenu ul.nav li.mega a, .tb-megamenu ul.nav li.mega .tb_nolink').removeClass('tb-megamenu-clicked'); 790 $('.tb-megamenu ul.nav li.mega').removeClass('open'); 791 $('body').removeClass('tb-megamenu-open'); 792 } 793 }); 794 } 795 } 796 } 797})(jQuery); 798; 799(function ($) { 800 801Drupal.googleanalytics = {}; 802 803$(document).ready(function() { 804 805 // Attach mousedown, keyup, touchstart events to document only and catch 806 // clicks on all elements. 807 $(document.body).bind("mousedown keyup touchstart", function(event) { 808 809 // Catch the closest surrounding link of a clicked element. 810 $(event.target).closest("a,area").each(function() { 811 812 // Is the clicked URL internal? 813 if (Drupal.googleanalytics.isInternal(this.href)) { 814 // Skip 'click' tracking, if custom tracking events are bound. 815 if ($(this).is('.colorbox') && (Drupal.settings.googleanalytics.trackColorbox)) {
816 // Do nothing here. The custom event will handle all tracking. 817 //console.info("Click on .colorbox item has been detected."); 818 } 819 // Is download tracking activated and the file extension configured for download tracking? 820 else if (Drupal.settings.googleanalytics.trackDownload && Drupal.googleanalytics.isDownload(this.href)) { 821 // Download link clicked. 822 ga("send", { 823 "hitType": "event", 824 "eventCategory": "Downloads", 825 "eventAction": Drupal.googleanalytics.getDownloadExtension(this.href).toUpperCase(), 826 "eventLabel": Drupal.googleanalytics.getPageUrl(this.href), 827 "transport": "beacon" 828 }); 829 } 830 else if (Drupal.googleanalytics.isInternalSpecial(this.href)) { 831 // Keep the internal URL for Google Analytics website overlay intact. 832 ga("send", { 833 "hitType": "pageview", 834 "page": Drupal.googleanalytics.getPageUrl(this.href), 835 "transport": "beacon" 836 }); 837 } 838 } 839 else { 840 if (Drupal.settings.googleanalytics.trackMailto && $(this).is("a[href^='mailto:'],area[href^='mailto:']")) { 841 // Mailto link clicked. 842 ga("send", { 843 "hitType": "event", 844 "eventCategory": "Mails", 845 "eventAction": "Click", 846 "eventLabel": this.href.substring(7), 847 "transport": "beacon" 848 }); 849 } 850 else if (Drupal.settings.googleanalytics.trackOutbound && this.href.match(/^\w+:\/\//i)) { 851 if (Drupal.settings.googleanalytics.trackDomainMode !== 2 || (Drupal.settings.googleanalytics.trackDomainMode === 2 && !Drupal.googleanalytics.isCrossDomain(this.hostname, Drupal.settings.googleanalytics.trackCrossDomains))) { 852 // External link clicked / No top-level cross domain clicked. 853 ga("send", { 854 "hitType": "event", 855 "eventCategory": "Outbound links", 856 "eventAction": "Click", 857 "eventLabel": this.href, 858 "transport": "beacon" 859 }); 860 } 861 } 862 } 863 }); 864 }); 865 866 // Track hash changes as unique pageviews, if this option has been enabled. 867 if (Drupal.settings.googleanalytics.trackUrlFragments) { 868 window.onhashchange = function() { 869 ga("send", { 870 "hitType": "pageview", 871 "page": location.pathname + location.search + location.hash 872 }); 873 }; 874 } 875 876 // Colorbox: This event triggers when the transition has completed and the 877 // newly loaded content has been revealed. 878 if (Drupal.settings.googleanalytics.trackColorbox) { 879 $(document).bind("cbox_complete", function () { 880 var href = $.colorbox.element().attr("href"); 881 if (href) { 882 ga("send", { 883 "hitType": "pageview", 884 "page": Drupal.googleanalytics.getPageUrl(href) 885 }); 886 } 887 }); 888 } 889 890}); 891 892/** 893 * Check whether the hostname is part of the cross domains or not. 894 * 895 * @param string hostname 896 * The hostname of the clicked URL. 897 * @param array crossDomains 898 * All cross domain hostnames as JS array. 899 * 900 * @return boolean 901 */ 902Drupal.googleanalytics.isCrossDomain = function (hostname, crossDomains) { 903 /** 904 * jQuery < 1.6.3 bug: $.inArray crushes IE6 and Chrome if second argument is 905 * `null` or `undefined`, https://bugs.jquery.com/ticket/10076, 906 * https://github.com/jquery/jquery/commit/a839af034db2bd934e4d4fa6758a3fed8de74174 907 * 908 * @todo: Remove/Refactor in D8 909 */ 910 if (!crossDomains) { 911 return false; 912 } 913 else { 914 return $.inArray(hostname, crossDomains) > -1 ? true : false; 915 } 916}; 917 918/** 919 * Check whether this is a download URL or not. 920 * 921 * @param string url 922 * The web url to check. 923 * 924 * @return boolean 925 */ 926Drupal.googleanalytics.isDownload = function (url) { 927 var isDownload = new RegExp("\\.(" + Drupal.settings.googleanalytics.trackDownloadExtensions + ")([\?#].*)?$", "i"); 928 return isDownload.test(url); 929}; 930 931/** 932 * Check whether this is an absolute internal URL or not. 933 * 934 * @param string url 935 * The web url to check. 936 * 937 * @return boolean 938 */ 939Drupal.googleanalytics.isInternal = function (url) { 940 var isInternal = new RegExp("^(https?):\/\/" + window.location.host, "i"); 941 return isInternal.test(url); 942}; 943 944/** 945 * Check whether this is a special URL or not. 946 * 947 * URL types: 948 * - gotwo.module /go/* links. 949 * 950 * @param string url 951 * The web url to check. 952 * 953 * @return boolean 954 */ 955Drupal.googleanalytics.isInternalSpecial = function (url) { 956 var isInternalSpecial = new RegExp("(\/go\/.*)$", "i"); 957 return isInternalSpecial.test(url); 958}; 959 960/** 961 * Extract the relative internal URL from an absolute internal URL. 962 * 963 * Examples: 964 * - https://mydomain.com/node/1 -> /node/1 965 * - https://example.com/foo/bar -> https://example.com/foo/bar 966 * 967 * @param string url 968 * The web url to check. 969 * 970 * @return string 971 * Internal website URL 972 */ 973Drupal.googleanalytics.getPageUrl = function (url) { 974 var extractInternalUrl = new RegExp("^(https?):\/\/" + window.location.host, "i"); 975 return url.replace(extractInternalUrl, ''); 976}; 977 978/** 979 * Extract the download file extension from the URL. 980 * 981 * @param string url 982 * The web url to check. 983 * 984 * @return string 985 * The file extension of the passed url. e.g. "zip", "txt" 986 */ 987Drupal.googleanalytics.getDownloadExtension = function (url) { 988 var extractDownloadextension = new RegExp("\\.(" + Drupal.settings.googleanalytics.trackDownloadExtensions + ")([\?#].*)?$", "i"); 989 var extension = extractDownloadextension.exec(url); 990 return (extension === null) ? '' : extension[1]; 991}; 992 993})(jQuery); 994;
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.