1function exists(selector) { 2 if ($(selector).length > 0) { 3 return true; 4 } 5 return false; 6} 7function selecta_nav_pestanya(tag_name) { 8 $("#main_nav li").removeClass("selected"), 9 $("#main_nav li[data-page_news_tag='" + tag_name + "']").addClass( 10 "selected" 11 ); 12} 13function toggle_enable_submit(checkbox) { 14 var form = $(checkbox).parent().parent(), 15 submit_btn = $("input[type='submit']", form), 16 checked; 17 checkbox.prop("checked") 18 ? submit_btn.removeClass("disabled").prop("disabled", !1) 19 : submit_btn.addClass("disabled").prop("disabled", !0); 20} 21function contact_loading(formulari) { 22 var parent = $(formulari).parent(), 23 alerts; 24 $(".alert_group .alert", parent).hide(200), 25 $("input, textarea, select", formulari).prop("disabled", !0), 26 $("input[type='submit']", formulari) 27 .prop("disabled", !0) 28 .addClass("disabled loading"); 29} 30function contact_loaded(status, formulari) { 31 $("input[type='submit']", formulari).removeClass("loading"), 32 $("input:not([type='submit']), textarea, select", formulari) 33 .prop("disabled", !1) 34 .val(""), 35 $("input[type='checkbox']").prop("checked", !1), 36 "notok" === status && 37 $("input[type='submit']", formulari) 38 .prop("disabled", !1) 39 .removeClass("disabled loading"); 40} 41function highlightFields(fields, action) { 42 "add" === action 43 ? fields.each(function () { 44 $(this).parent().addClass("highlight"); 45 }) 46 : fields.each(function () { 47 $(this).parent().removeClass("highlight"); 48 }); 49} 50function valida_form_contacto(form) { 51 var emptyRequired = !1, 52 formulari = $(form), 53 parent = formulari.parent(), 54 required = $(".required", formulari), 55 alerts = $(".alert_group .alert", parent), 56 email = $(".email", formulari); 57 if ( 58 (required.each(function () { 59 "" === $(this).val() && (emptyRequired = !0); 60 }), 61 highlightFields(required, "remove"), 62 emptyRequired) 63 ) 64 alerts.hide(), 65 required.each(function () { 66 "" === $(this).val() && highlightFields($(this), "add"); 67 }), 68 $(".alert.rellenar", parent).fadeIn(300); 69 else if ( 70 (alerts.hide(), 71 highlightFields(required, "remove"), 72 /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email.val())) 73 ) { 74 var formSerialized = formulari.serialize(); 75 contact_loading(formulari), 76 $.post(arrail + "ajax/contact-send.php", { formData: formSerialized }) 77 .done(function (data) { 78 "ok" === data 79 ? ($(".alert.ok", parent).fadeIn(300), 80 contact_loaded("ok", formulari)) 81 : ($(".alert.catastrofe:not(.email)", parent).fadeIn(300), 82 contact_loaded("notok", parent)); 83 }) 84 .error(function (data) { 85 $(".alert.catastrofe:not(.email)", parent).fadeIn(300), 86 contact_loaded("notok", parent); 87 }); 88 } else $(".alert.email", parent).fadeIn(300), highlightFields(email, "add"); 89} 90function is_responsive() { 91 return "block" === $("#main_launcher").css("display"); 92} 93function check_scroll() { 94 var distance; 95 // console.log("scrollTop: ", $(window).scrollTop()); 96 if ($(window).scrollTop() >= 200) { 97 // console.log("Adding class minify to body"), 98 $("body").addClass("minify"); 99 100 if (!is_responsive()) { 101 // console.log("Moving search_area to #main_nav .wrap"), 102 $("#main_header .search_area").prependTo("#main_nav .wrap"); 103 $(".logo.main_logo").prependTo("#main_nav .wrap"); 104 } 105 106 // Lo comentamos porque no nos interesa con el menú actual 107 // if (is_responsive()) { 108 // $(".search_area").prependTo(".logo_search"); 109 // } 110 } else { 111 // console.log("Removing class minify from body"), 112 $("body").removeClass("minify"); 113 114 if (!is_responsive()) { 115 // console.log("Moving search_area to logo_search"), 116 $("#main_header.search_area").appendTo(".logo_search"); 117 $(".logo.main_logo").prependTo(".logo_area"); 118 } 119 } 120} 121function check_responsive() { 122 if (is_responsive()) { 123 if ( 124 ($("#wrapper").addClass("mobile"), 125 $(".subemu > ul, #main_nav, #main_launcher, .nav_group").removeAttr( 126 "style" 127 ), 128 $(".banner_logo").appendTo(".banner_cabecera"), 129 $(".latest_new").insertAfter("#main_nav"), 130 $("main .wrap .articles article").each(function (index) { 131 var commentsGroup = $(this).find(".comments_group"); 132 $(this).find(".share").insertBefore(commentsGroup); 133 }), 134 !exists(".nav_search_container")) 135 ) { 136 var new_li = $("<li>", { class: "nav_search_container" }); 137 $("#main_header .search_area").appendTo(new_li), 138 new_li.appendTo("#main_nav .wrap > ul"); 139 } 140 responsive_tables("set"); 141 } else 142 $("#wrapper").removeClass("mobile"), 143 $("#main_nav, #main_launcher, .nav_group").removeAttr("style"), 144 $(".banner_logo").appendTo(".logo_area .banner_area"), 145 $(".latest_new").insertBefore("#main_nav"), 146 $("main .wrap .articles article").each(function (index) { 147 var destacat = $(this).find(".destacado"); 148 $(this).find(".share").appendTo(destacat); 149 }), 150 exists(".nav_search_container") && 151 ($(".nav_search_container .search_area").appendTo(".logo_search"), 152 $(".nav_search_container").remove()), 153 responsive_tables("unset"); 154} 155function responsive_tables(action) { 156 var table_scroller = $("<div class='table_scroller'></div>"), 157 fake_scroller = $("<div class='fake_scroller'><div></div></div>"), 158 table_scroll_container = $( 159 "<div class='table_scroller_container'><span class='icon scroll left'></span><span class='icon scroll right active'></span></div>" 160 ); 161 switch (action) { 162 case "set": 163 exists(".table_scroller_container") || 164 $(".editor_content table").each(function () { 165 var tabla = $(this), 166 tablaW = tabla.width(), 167 new_container = table_scroller 168 .clone() 169 .insertAfter(tabla) 170 .append(tabla), 171 global_conainer = table_scroll_container 172 .clone() 173 .insertAfter(new_container) 174 .append(new_container); 175 fake_scroller 176 .clone() 177 .insertBefore(new_container) 178 .find("div") 179 .css({ width: tabla.width() }); 180 var scroll = $(".table_scroller", global_conainer), 181 fake_scroll = $(".fake_scroller", global_conainer);
182 scroll.scroll(function () { 183 var scrollLeft = scroll.scrollLeft(), 184 maxScroll = tablaW - scroll.width(); 185 fake_scroll.scrollLeft(scrollLeft), 186 update_scroll_arrow(scrollLeft, maxScroll, global_conainer); 187 }), 188 fake_scroll.scroll(function () { 189 var scrollLeft = fake_scroll.scrollLeft(), 190 maxScroll = tablaW - scroll.width(); 191 scroll.scrollLeft(scrollLeft), 192 update_scroll_arrow(scrollLeft, maxScroll, global_conainer); 193 }); 194 }); 195 } 196} 197function update_scroll_arrow(scrollLeft, maxScroll, container) { 198 // console.log(scrollLeft), 199 // console.log(maxScroll), 200 // console.log(container), 201 scrollLeft > 0 && 202 scrollLeft < maxScroll && 203 $(".icon.scroll", container).addClass("active"), 204 scrollLeft >= maxScroll && 205 ($(".scroll.right", container).removeClass("active"), 206 $(".scroll.left", container).addClass("active")), 207 0 === scrollLeft && 208 ($(".scroll.left", container).removeClass("active"), 209 $(".scroll.right", container).addClass("active")); 210} 211function createCookie(name, value, days) { 212 if (days) { 213 var date = new Date(); 214 date.setTime(date.getTime() + 24 * days * 60 * 60 * 1e3); 215 var expires = "; expires=" + date.toGMTString(); 216 } else var expires = ""; 217 document.cookie = name + "=" + value + expires + "; path=/"; 218} 219function readCookie(name) { 220 for ( 221 var nameEQ = name + "=", ca = document.cookie.split(";"), i = 0; 222 i < ca.length; 223 i++ 224 ) { 225 for (var c = ca[i]; " " == c.charAt(0); ) c = c.substring(1, c.length); 226 if (0 == c.indexOf(nameEQ)) return c.substring(nameEQ.length, c.length); 227 } 228 return null; 229} 230function setup_content_img_lightbox() { 231 $(".editor_content img").each(function () { 232 var img = $(this), 233 alt = img.attr("alt"), 234 figure = $("<figure>"), 235 figcaption = $("<figcaption>"); 236 if ( 237 (void 0 !== alt && 238 "" !== alt && 239 (figcaption.text(alt).appendTo(figure), 240 figure.insertAfter(img), 241 img.prependTo(figure)), 242 img.hasClass("zoom")) 243 ) { 244 var href = img.attr("src"), 245 link = $("<a>", { class: "swipebox", href: href }); 246 link.insertAfter(img), img.appendTo(link); 247 } 248 }); 249} 250 251function setup_cookie_modal() { 252 var consentCookieName = "ara_cookie_consent"; 253 var consentAllowWithoutCookies = "paid_reject"; 254 var rejectPersistCookieName = "ara_cookie_reject_persist"; 255 var rootSelector = ".m-cookieConsent"; 256 var subscriptionPath = "suscribirseCookies.php"; 257 var requiredCookies = 258 typeof cmpSettings !== "undefined" && 259 cmpSettings && 260 Array.isArray(cmpSettings.activeCookies) 261 ? cmpSettings.activeCookies 262 : []; 263 264 function isSubscriptionPage() { 265 return window.location.pathname.indexOf(subscriptionPath) !== -1; 266 } 267 268 function getSelectedCookies() { 269 var value = readCookie("cmSettings"); 270 if (!value) return []; 271 return value 272 .split(",") 273 .map(function (item) { 274 return item.trim(); 275 }) 276 .filter(Boolean); 277 } 278 279 function hasAcceptedAllCookies() { 280 var selected = getSelectedCookies(); 281 if (!requiredCookies.length) return selected.length > 0; 282 return requiredCookies.every(function (cookieType) { 283 return selected.indexOf(cookieType) !== -1; 284 }); 285 } 286 287 function closeModal() { 288 $(rootSelector).remove(); 289 $("body").removeClass("cookie-modal-open"); 290 } 291 292 function redirectToSubscription() { 293 if (!isSubscriptionPage()) { 294 window.location.href = cookieRejectUrl; 295 } 296 } 297 298 function initCookieManager(actionClass) { 299 if ( 300 typeof cookieManager === "undefined" || 301 !cookieManager || 302 typeof cookieManager.cmInit !== "function" 303 ) { 304 return; 305 } 306 cookieManager.cmInit(); 307 setTimeout(function () { 308 var actionBtn = document.querySelector(actionClass); 309 if (actionBtn) actionBtn.click(); 310 }, 50); 311 } 312 313 if (hasAcceptedAllCookies()) return; 314 315 if (readCookie(consentCookieName) === consentAllowWithoutCookies) { 316 return; 317 } 318 319 if (readCookie(rejectPersistCookieName) === "1") { 320 return; 321 } 322 323 if (readCookie(consentCookieName) === "rejected") { 324 redirectToSubscription(); 325 return; 326 } 327 328 if (readCookie("cmSettings") !== null && !hasAcceptedAllCookies()) { 329 createCookie(consentCookieName, "rejected", 365); 330 redirectToSubscription(); 331 return; 332 } 333 334 var modalHtml = 335 "<div class='m-cookieConsent m-cookieConsent--overlay'>" + 336 "<div class='m-cookieConsent__dialog' role='dialog' aria-modal='true' aria-label='" + 337 cookieModalTitle + 338 "'>" + 339 "<h2 class='m-cookieConsent__title'>" + 340 cookieModalTitle + 341 "</h2>" + 342 "<div class='m-cookieConsent__content'>" + 343 "<p class='m-cookieConsent__text'>" + 344 cookieModalContent + 345 "</p>" + 346 "<p class='m-cookieConsent__extra'>" + 347 cookieModalExtra + 348 "</p>" + 349 "</div>" + 350 "<div class='m-cookieConsent__actions'>" + 351 "<button type='button' class='m-cookieConsent__button m-cookieConsent__button--dark m-cookieConsent__button--reject'>" + 352 cookieModalBtnReject + 353 "</button>" + 354 "<button type='button' class='m-cookieConsent__button m-cookieConsent__button--dark m-cookieConsent__button--accept'>" + 355 cookieModalBtnAccept + 356 "</button>" + 357 "</div>" + 358 "</div>" + 359 "</div>"; 360 361 $("body").append(modalHtml).addClass("cookie-modal-open"); 362 363 $(document).on("click", ".m-cookieConsent__button--accept", function () { 364 closeModal();
365 initCookieManager(".cm-js-acceptDefault"); 366 }); 367 368 $(document).on("click", ".m-cookieConsent__button--reject", function () { 369 createCookie(consentCookieName, "rejected", 365); 370 redirectToSubscription(); 371 }); 372 373 $(document).on("click", ".cm-js-rejectAll, .cm-js-saveSettings", function () { 374 setTimeout(function () { 375 if (!hasAcceptedAllCookies()) { 376 createCookie(consentCookieName, "rejected", 365); 377 redirectToSubscription(); 378 } 379 }, 100); 380 }); 381} 382 383if ( 384 ($(document).ready(function () { 385 386 //console.log("Website completely loaded"); 387 388 setup_cookie_modal(); 389 390 if ( 391 ($("#goTop").on("click", function (event) { 392 event.preventDefault(), scrollPageTo("#wrapper"); 393 }), 394 $().blockAdBlock({ 395 lang: "ca", 396 logo: "https://www.aramultimedia.com/themes/aramultimedia/images/logo.png", 397 }), 398 exists(".share_group") && $(".share_group").fran6share({activeNetworks: ["facebook", "x", "bluesky", "whatsapp"]}), 399 $("#main_nav li.selected").parents("li").addClass("selected"), 400 $("#acepto_politica").on("click", function () { 401 toggle_enable_submit($(this)); 402 }), 403 $("#contact_form").submit(function (event) { 404 event.preventDefault(), valida_form_contacto($(this)); 405 }), 406 $("#slidexou:not(.secondary_gallery), #slidexou_pagina").fran6gallery({ 407 duracio: 4e3, 408 velocitat: 1e3, 409 paginacio: 0, 410 timer: !0, 411 bulletBackground: "#CCCCCC", 412 bulletBackground_selected: "#CC9900", 413 }), 414 $(".swipebox").swipebox(), 415 setup_content_img_lightbox(), 416 $("a.vimeo").click(function () { 417 return ( 418 $.fancybox({ 419 href: this.href.replace("vimeo.com", "player.vimeo.com/video"), 420 type: "iframe", 421 helpers: { overlay: { locked: !1 } }, 422 }), 423 !1 424 ); 425 }), 426 $("a.youtube").click(function () { 427 return ( 428 $.fancybox({ 429 href: this.href.replace(new RegExp("watch\\?v=", "i"), "v/"), 430 type: "swf", 431 swf: { wmode: "transparent", allowfullscreen: "true" }, 432 helpers: { overlay: { locked: !1 } }, 433 }), 434 !1 435 ); 436 }), 437 $(".toggler").on("click", function () { 438 $(this).next(".nav_group").slideToggle(200); 439 }), 440 $("#main_launcher").on("click", function () { 441 $(this).toggleClass("open"), $("#main_nav").toggleClass("open"); 442 }), 443 $(".category_list button").on("click", function (event) { 444 event.preventDefault(), $(" + ul", this).slideToggle(250); 445 }), 446 $(".banner_item a").on("click", function (event) { 447 var selectorBanner = $(this), 448 url = selectorBanner.attr("href"), 449 banner = selectorBanner.attr("data-id"); 450 $.post( 451 arrail + "ajax/saveClickBanner.php", 452 { banner: banner }, 453 function (response) {} 454 ); 455 }), 456 check_responsive(), 457 check_scroll(), 458 $("body").on("click", function (event) { 459 var video_cap = $(".videobanner_cap").attr("src"); 460 if (void 0 !== video_cap) 461 var video_cap_sound = video_cap.replace("&mute=1", ""); 462 }), 463 is_responsive()) 464 ) { 465 var video_cap = $(".videobanner_cap").attr("src"); 466 if (void 0 !== video_cap) { 467 var video_cap_sound = video_cap.replace("&mute=1", ""); 468 setTimeout(function () { 469 $(".videobanner_cap").attr("src", video_cap_sound); 470 }, 10); 471 } 472 } 473 }), 474 $(window).resize(function () { 475 check_responsive(); 476 }), 477 $(window).scroll(function () { 478 check_scroll(); 479 }), 480 (window.onbeforeunload = function () { 481 window.scrollTo(0, 0); 482 }), 483 exists(".noticias-item") && exists(".news_item_aside .related")) 484) { 485 var anterior = document.referrer, 486 esMobil = !1, 487 contNoticies = 0, 488 contBanners = 0, 489 actual = 0, 490 news = [], 491 titles = [], 492 descriptions = []; 493 494 let currentUrl = window.location.pathname.substring(1); 495 let urlToPushState = currentUrl; 496 let charsToSubstringUrl = 0; 497 // if(ACTIVE_LANGS > 1){ 498 charsToSubstringUrl = 3; // "ca/" 499 //} 500 501 // console.log("1->",currentUrl); 502 (titles[0] = 503 $(".header_group_content h1").text().trim() + " | ARA Multimèdia"), 504 (news[0] = currentUrl), 505 (descriptions[0] = $(".editor_content.resumen").text().trim()); 506 var oldItem = 0, 507 bannerLateral = $("aside#main_aside"), 508 bannerLateralHeight = bannerLateral.height(), 509 bannerLateralBottom = bannerLateral.offset().top + bannerLateralHeight, 510 pageTracker = ""; 511 void 0 !== $.cookie("_gat") && 512 (pageTracker = _gat._getTracker("UA-122990935-1")); 513 var commentFacebook = $(".noticias-item .main_content .fb-comments"); 514 if ($(window).width() < 641) { 515 esMobil = !0; 516 var banners = $(".noticias-item #main_aside"); 517 banners.insertBefore($(".news_item_aside")); 518 } 519 $(window).scroll(function () {
520 $(window).width() < 641 && (esMobil = !0); 521 var windowHeightTop = $(window).scrollTop(), 522 windowHeightBottom = $(window).scrollTop() + $(window).height(), 523 newsItems = $(".news_item_aside:eq(" + actual + ")").offset(); 524 if ( 525 (exists(newsItems) && (newsItems = newsItems.top), 526 windowHeightBottom > newsItems) 527 ) { 528 if ( 529 ++actual > contNoticies && 530 ((descriptions[actual] = relatedNews( 531 $(".news_item_aside:eq(" + contNoticies + ") .related li a").not( 532 ".tag" 533 ), 534 !1, 535 !0 536 )), 537 (titles[actual] = relatedNews( 538 $(".news_item_aside:eq(" + contNoticies + ") .related li a").not( 539 ".tag" 540 ), 541 !0 542 )), 543 (news[actual] = relatedNews( 544 $(".news_item_aside:eq(" + contNoticies + ") .related li a").not( 545 ".tag" 546 ) 547 )), 548 news[actual]) 549 ) { 550 var newUrl = news[actual]; 551 // console.log("POST", news[actual]); 552 $.ajax({ 553 type: "POST", 554 url: "/"+news[actual], 555 success: function (response) { 556 var add = $(response).find("main .wrap article.main_content"); 557 if ( 558 ((title = 559 $(response).find(".header_group_content h1").text().trim() + 560 " | ARA Multimèdia"), 561 exists(add.find(".share_group")) && 562 (add 563 .find(".share_group") 564 .fran6share({ urlToShare: SITE_URL+newUrl, activeNetworks: ["facebook", "x", "bluesky", "whatsapp"], titleToShare: title }), 565 esMobil)) 566 ) { 567 var whatsapp = add.find(".share_group .share_whatsapp"); 568 whatsapp.show(); 569 var hrefactual = whatsapp.attr("href"), 570 newHref = 571 "?text=" + encodeURIComponent(whatsapp.attr("data-text")); 572 (newHref += encodeURIComponent(" " + document.URL)), 573 whatsapp.attr("href", hrefactual + newHref); 574 } 575 if ( 576 ($("main .wrap .articles").append(add), 577 check_responsive(), 578 FB.XFBML.parse(), 579 void 0 !== $.cookie("_gat")) 580 ) 581 try { 582 pageTracker._trackPageview("/" + newUrl); 583 } catch (err) {} 584 }, 585 }); 586 var newCommentFacebook = commentFacebook.clone(); 587 contNoticies++; 588 } 589 oldItem = 590 (oldItem = $( 591 "main article.main_content:eq(" + (actual - 1) + ") .content" 592 )).offset().top + oldItem.outerHeight(!0); 593 } 594 if ( 595 (windowHeightTop < oldItem && 596 (actual--, 597 (oldItem = 598 0 == actual 599 ? 0 600 : (oldItem = $( 601 "main article.main_content:eq(" + (actual - 1) + ") .content" 602 )).offset().top + oldItem.outerHeight(!0))), 603 windowHeightBottom > bannerLateralBottom && !esMobil && news[actual]) 604 ) { 605 contBanners++; 606 var newBannerLateral = bannerLateral 607 .find(".banner_dreta") 608 .first() 609 .clone(); 610 $("main .wrap aside#main_aside").append(newBannerLateral), 611 $( 612 'main .banner_dreta iframe[id^="twitter"]:eq(' + contBanners + ")" 613 ).after("<span class='newTwitters'></span>"), 614 $( 615 'main .banner_dreta iframe[id^="twitter"]:eq(' + contBanners + ")" 616 ).remove(), 617 $(".newTwitters:eq(" + (contBanners - 1) + ")").load( 618 siteUrl + "themes/aramultimedia/template/includes/twitter.php" 619 ), 620 (bannerLateralBottom += bannerLateralHeight); 621 } 622 623 siteUrl + news[actual] != window.location.href && 624 news[actual] && 625 (history.pushState( 626 null, 627 titles[actual] + " | ARA Multimèdia", 628 news[actual].substring(charsToSubstringUrl) 629 ), 630 (document.title = titles[actual] + " | ARA Multimèdia"), 631 $("meta[property='og:title']").attr( 632 "content", 633 titles[actual] + " | ARA Multimèdia" 634 ), 635 $("meta[property='og:description']").attr( 636 "content", 637 descriptions[actual] 638 ), 639 $("meta[name='description']").attr("content", descriptions[actual])); 640 }); 641} 642function relatedNews(related, title = !1, desc = !1) { 643 var url, title_new, description; 644 return ( 645 $(related).each(function () { 646 var nextURL, 647 nextFriendlURL = $(this).attr("href").replace(SITE_URL, ""); 648 if ($.inArray(nextFriendlURL, news) < 0) 649 return ( 650 (url = nextFriendlURL), 651 (description = $(this).data("desc")), 652 (title_new = $(this).text()), 653 !1 654 ); 655 }), 656 title ? title_new : desc ? description : url 657 ); 658} 659window.onpopstate = function (event) { 660 anterior && (location.href = anterior); 661};
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.