1(function($, one) { 2 Drupal.behaviors.blockUpperHeader = { 3 attach: function attach() { 4 if ($('.block-upper-header').length && $('.topbar-isla').length) { 5 $('body').addClass('has-upper-header-block-island-2'); 6 }else if($('.topbar-isla').length){ 7 $('body').addClass('has-upper-header-block-island-1'); 8 } else if($('.block-upper-header').length){ 9 $('body').addClass('has-upper-header-block'); 10 } 11 } 12 }; 13 14 // (function ($, Drupal) { 15 // Drupal.behaviors.yourbehavior = { 16 // attach: function (context, settings) { 17 // var elementosLi = document.querySelectorAll('.menu--navigation-fuerteventura .menu-item, .menu--menu-navigation-el-hierro .menu-item, .menu--menu-navigation-la-gomera .menu-item, .menu--menu-navigation-la-palma .menu-item'); 18 // var eventoEjecutado = false; 19 // // Agrega un evento de clic a cada elemento <li> 20 // elementosLi.forEach(function (elementoLi) { 21 // elementoLi.addEventListener('click', function (evento) { 22 // if (!eventoEjecutado) { 23 // var primerLi = document.querySelector("#block-menunavigationfuerteventura .menu-item, #block-menunavigationlagomera .menu-item, #block-menunavigationelhierro .menu-item, #block-menunavigationlapalma .menu-item"); 24 // console.log(primerLi); 25 // var spanEnPrimerLi = primerLi.querySelector("span"); 26 // spanEnPrimerLi.textContent = this.querySelector('a').textContent; 27 // eventoEjecutado = true; 28 // } 29 // }); 30 // }); 31 // } 32 // }; 33 34 // })(jQuery, Drupal); 35 36 function _isDesktop() { 37 return $(window).innerWidth() >= 768; 38 } 39 40 function _isNotTablet() { 41 return $(window).innerWidth() >= 992; 42 } 43 44 function fixMenuFunction(toSticky) { 45 var surplus = 10; 46 47 // Get the offset position of the navbar 48 if (_isNotTablet()) { 49 surplus = 27; 50 if ($('.has-upper-header-block').length > 0) { 51 surplus = 64; 52 } 53 } else { 54 if ($('.has-upper-header-block').length > 0) { 55 surplus = 32; 56 } 57 } 58 59 if ($('.block-hic-header-island-tablet').length > 0) { 60 toSticky.addClass('island-env'); 61 62 } else { 63 toSticky.removeClass('island-env'); 64 } 65 66 var sticky = toSticky.offset().top + surplus; 67 68 if (typeof sticky !== "undefined") { 69 win = $(window); 70 if (win.scrollTop() >= sticky) { 71 if (!toSticky.hasClass('is-fixed-header')) { 72 toSticky.addClass("is-fixed-header"); 73 $('.region-link-home-island').addClass('is-fixed-pill'); 74 } 75 } 76 win.on("scroll", function() { 77 if (win.scrollTop() >= sticky) { 78 sticky = parseInt(sticky); 79 80 if (!toSticky.hasClass('is-fixed-header')) { 81 toSticky.addClass("is-fixed-header"); 82 $('.region-link-home-island').addClass('is-fixed-pill'); 83 } 84 } else { 85 toSticky.removeClass("is-fixed-header"); 86 $('.region-link-home-island').removeClass('is-fixed-pill'); 87 } 88 }); 89 } 90 } 91 92 Drupal.behaviors.fixMenu = { 93 attach: function() { 94 if ($('.user-logged-in').length <= 0) { 95 var header = $('.page-content').find('header[role="banner"]'); 96 fixMenuFunction(header); 97 } 98 } 99 } 100 101 if (typeof WOW !== "undefined") { 102 var wow = new WOW({ 103 boxClass: 'wow', // animated element css class (default is wow) 104 animateClass: 'animated', // animation css class (default is animated) 105 offset: 50, // distance to the element when triggering the animation (default is 0) 106 mobile: true, // trigger animations on mobile devices (default is true) 107 live: true, // act on asynchronously loaded content (default is true) 108 scrollContainer: null // optional scroll container selector, otherwise use window 109 }); 110 wow.init(); 111 } 112 window.addEventListener('wheel', function() { passive: false }); 113 if ($('.user-logged-in').length <= 0) { 114 $("html").easeScroll({ 115 frameRate: 60, 116 animationTime: 1000, 117 stepSize: 1, 118 pulseAlgorithm: 1, 119 pulseScale: 8, 120 pulseNormalize: 1, 121 accelerationDelta: 1, 122 accelerationMax: 1, 123 keyboardSupport: true, 124 arrowScroll: 9, 125 touchpadSupport: true,
126 fixedBackground: true 127 }); 128 } 129 // document.addEventListener('wheel', function(e) {ââ 130 // e.preventDefault(); 131 // $("html").easeScroll(); 132 // }ââ, {ââ passive: false }ââ); 133 // Not used for now, keep it because we maybe end up using it in the future, 134 // else remove 135 Drupal.behaviors.handleResize = { 136 attach: function (context) { 137 var currentIsDesktop = null; 138 const $element = $(once('handleResize', 'handle-resize', context)); 139 $element.resize(function () { 140 console.log('tamaño'); 141 if (_isDesktop() && !currentIsDesktop) { 142 $(window).trigger('hic_desktop_view'); 143 currentIsDesktop = true; 144 } else if (!_isDesktop() && currentIsDesktop) { 145 $(window).trigger('hic_mobile_view'); 146 currentIsDesktop = false; 147 } else if (currentIsDesktop === null) { 148 $(window).trigger(_isDesktop() ? 'hic_desktop_view' : 'hic_mobile_view'); 149 currentIsDesktop = _isDesktop(); 150 } 151 }); 152 $(window).resize(); 153 } 154 }; 155 156 Drupal.behaviors.handleLineClamp = { 157 attach: function(context) { 158 $(context).clamp(); 159 } 160 }; 161 162 //Esta funcion se usa para "limpiar" la url del combo de idiomas 163 Drupal.behaviors.fixQueryString = { 164 attach: function(context, settings) { 165 $(once('fixQueryString', '.menu-item--expanded .menu-item, .menu--main .menu-item, .language-link, .logo_image', context)).mouseup( 166 function (event) { 167 var element = $(event.target); 168 element = (element.hasClass('logo_front'))?element.parent().parent():element; 169 if (element.attr('href')) { 170 const hrefParts = $(element.attr('href').split('?')); 171 const domain = hrefParts.first().get(0); 172 if (hrefParts.length > 1 && domain.startsWith('https://')) { 173 element.attr('href', domain); 174 } 175 } 176 }); 177 } 178 }; 179 180 $.fn.extend({ 181 /** 182 * This function returns if the device is a not mobile. 183 */ 184 isDesktop: function isDesktop() { 185 return !!($(window).innerWidth() >= 768); 186 }, 187 dropdown: function(extraExclusions, context) { 188 this.each(function(_, parentDiv) { 189 var parentEl = $(parentDiv); 190 $(once('dropDownExtraExclusions', parentEl.find('.trigger-wrapper'), context)).on('click', function (e) { 191 e.preventDefault(); 192 var itemChanger = parentEl.find('.item-selector-wrapper'); 193 var $this = $(this); 194 itemChanger.toggleClass('collapsed expanded'); 195 $this.toggleClass('down up'); 196 }); 197 198 var onceSuffix = extraExclusions instanceof Array ? extraExclusions.join('-') : 'no-extra-' + new Date().getTime(); 199 $(document).click(function(e) { 200 var excludedClasses = ['items-selector', 'select-wrapper', 'trigger-wrapper', 'limit-trigger']; 201 // if (extraExclusions instanceof Array) { 202 // excludedClasses = excludedClasses.concat(extraExclusions); 203 // } 204 var classClicked = e.target.className.split(' '); 205 if (!excludedClasses.some(function(r) { return classClicked.indexOf(r) >= 0 })) { 206 parentEl.find('.limit-trigger').parent().removeClass('up').addClass('down'); 207 parentEl.find('.item-selector-wrapper').removeClass('expanded').addClass('collapsed'); 208 } 209 }); 210 }); 211 return this; 212 }, 213 clamp: function(rootEl) { 214 var selector = '.clamp-on' 215 var target = rootEl instanceof $ ? rootEl.find(selector) : $(selector) 216 return target 217 .one('handle-clamp') 218 .each( 219 function() { 220 var $this = this; 221 var originalText = this.innerHTML; 222 var currentTimeout = null; 223 var el = $this; 224 var $el = $(el); 225 var lines; 226 var errorHint = 'near element tag: ' + el.tagName + ' classes: ' + 227 el.className; 228 if ($el.data('clamp-always') && 229 ($el.data('clamp-desktop') || $el.data('clamp-mobile'))) { 230 throw new Error( 231 'You can NOT use clamp-always when combined with clamp-desktop or clamp-mobile, ' + 232 errorHint); 233 } else if ($el.data('clamp-always')) { 234 lines = $el.data('clamp-always'); 235 } else if (typeof $el.data('clamp-desktop') === 'undefined' || 236 typeof $el.data('clamp-mobile') === 'undefined') { 237 throw new Error( 238 'You MUST specify both properties clamp-desktop and clamp-mobile, or use only clamp-always, ', 239 errorHint); 240 } 241 242 function __changeClamp() { 243 244 el.innerHTML = originalText; 245 if (currentTimeout) { 246 clearTimeout(currentTimeout); 247 currentTimeout = null; 248 } 249 currentTimeout = setTimeout(function() { 250 if (!$el.data('clamp-always')) { 251 lines = _isDesktop() ? $el.attr('data-clamp-desktop') : $el 252 .attr('data-clamp-mobile'); 253 } 254 if (+lines) { 255 ellipsis(el, +lines, { 256 responsive: false, 257 delimiter: '' 258 }); 259 } else { 260 el.innerHTML = originalText; 261 } 262 currentTimeout = null; 263 }, 200); 264 } 265 __changeClamp(); 266 $(window).on('resize', function() { 267 __changeClamp(); 268 }); 269 $(this).on('recalculateClamp', function() { 270 __changeClamp(); 271 }); 272 } 273 ); 274 } 275 }); 276 277 /** 278 * Drupal Theme to create a Placeholder for taxonomy totalcount 279 * 280 * @param total 281 */ 282 Drupal.theme.taxonomyCounter = function taxonomyCounter(total) { 283 return Drupal.formatString('<span class="total-items">!total</span>', { 284 '!total': total 285 }); 286 } 287 288 /*var linkRewriter = function(a, b) { 289 $('a[href*="' + a + '"]').each(function() { 290 $(this).attr('href', $(this).attr('href').replace(a, b)); 291 }); 292 }; 293 294 if (window.location.hostname == 'editpro.holaislascanarias.com') { 295 linkRewriter('www.holaislascanarias.com', 'editpro.holaislascanarias.com'); 296 }*/ 297 298 Drupal.behaviors.customJsBehavior = { 299 attach: function (context, settings) { 300 // Crear el nuevo contenedor solo si no existe 301 if ($('.upload-message__wrapper').length === 0) {
302 var $wrapper = $('<div>', { class: 'upload-message__wrapper' }); 303 304 // Seleccionar los elementos a englobar 305 let webformDocumentFile = $(once('customJsBehavior', '.js-webform-document-file', context)); 306 let formItemErrorMessage = $(once('customJsBehavior', '.form-item--error-message', context)); 307 308 // Solo continuar si ambos elementos están presentes 309 if (webformDocumentFile.length && formItemErrorMessage.length) { 310 // Insertar el nuevo contenedor antes del primer elemento 311 webformDocumentFile.before($wrapper); 312 313 // Mover los elementos al nuevo contenedor 314 $wrapper.append(webformDocumentFile); 315 $wrapper.append(formItemErrorMessage); 316 } 317 } 318 } 319 }; 320 321})(jQuery, once); 322 323(function ($, Drupal) { 324 Drupal.behaviors.addCkResetClass = { 325 attach: function (context, settings) { 326 $("#drupal-off-canvas").each(function () { 327 $(this).addClass("ck-reset"); 328 }); 329 } 330 }; 331})(jQuery, Drupal); 332 333 334
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.