1(function($, Drupal){ 2 Drupal.behaviors.YourBehaviour = { 3 attach: function(context, settings) { 4 $(document).once('infinite-scroll').ajaxComplete(function (event, xhr, settings) { 5 if ($(".views-infinite-scroll-content-wrapper").length > 0) { 6 var href = $('.pager__item a').prop('href'); 7 var trackURL = href; 8 if (trackURL != 'undefined') { 9 try { 10 window.dataLayer = window.dataLayer || []; 11 dataLayer.push({ 12 "event": "load_more", 13 "page_location": trackURL 14 }) 15 } catch (e) { 16 console.log("failed to send a ping to GA"); 17 } 18 } 19 } 20 21 //console.log("count"); 22 const abookmark = document.getElementsByClassName("bookmark_user"); 23 if(abookmark.length>0){ 24 for (let i = 0; i < abookmark.length; i++) { 25 // window.renderMyReactApp($('.bookmark_user')[i]); 26 } 27 } 28 if ($(".modal-toggle").length > 0) { 29 var videoUrl = ""; 30 $('.modal-toggle').on('click', function (e) { 31 e.preventDefault(); 32 var $this = ""; 33 $this = $(this).data('id'); 34 $('.modal-wrap[data-modal="' + $this + '"]').toggleClass('is-visible'); 35 $('html').addClass("modal-open"); 36 }); 37 38 $(".modal-close, .touch-close").on('click', function (e) { 39 e.preventDefault(); 40 $(this).closest('.modal-wrap').toggleClass('is-visible'); 41 $('html').removeClass("modal-open"); 42 }); 43 } 44 // document.head.appendChild(scriptaudio); 45 // addthis.toolbox('.addthis_toolbox'); 46 //console.log("ziad"); 47 var instance = $('.lazy').Lazy({chainable: false}); 48 var lazyelements= $('.lazy'); 49 50 // // just add the images to the instance and force an update 51 instance.addItems(lazyelements); 52 instance.update(); 53 54 // if($('[data-interchange]').length) { 55 // import Foundation from 'foundation-sites'; 56 // Foundation.reInit('Interchange'); 57 // } 58 59 var contentArticles = $('#content-articles').cleverInfiniteScroll({ 60 contentsWrapperSelector: '#content-articles', 61 contentSelector: '.pageWrapper' 62 }); 63 contentArticles.cleverInfiniteScroll.update(); 64 opinionAudioPodcast(); 65 //$.getScript("https://aawsat.com/themes/custom/aawsatv3/assets/js/modules/audio-players.gn.js"); 66 //opinionPodcast.loadPodcast(); 67 $('.fntChange_js').each(function (e) { 68 69 $(".font-size").text($('.fntChange_js')[0].value); 70 71 $(this).on('input', function(e){ 72 $(this).closest('.entry-article').find("p").css('font-size', $(e.target).val() + 'px'); 73 var value = ($(this).val() - $(this).attr("min")) / ($(this).attr("max") - $(this).attr("min")) * 100; 74 //$(this).css('background', 'linear-gradient(to right, #0f1414 0%, #233231 ' + value + '%, #2C8A82 100%)' ); 75 $(this).css('background', 'linear-gradient(to '+direction_opposite+', #000000 ' + value + '%, #DCEBE9 0%)' ); 76 //console.log($(this), 'valueee'); 77 //$(this).css('background', 'linear-gradient(90deg, #DCEBE9 '+value+'%, black '+value+'%);' ); 78 $(this).closest(".font-control").find(".font-size").text($(e.target).val()); 79 80 81 }) 82 }); 83 if ($('.sticky-aside_js').length > 0) { 84 var stickySectionTitles = document.getElementsByClassName('sticky-aside_js'); 85 86 for (var i = 0; i < stickySectionTitles.length; i++) { 87 var asideSticky = new hcSticky(stickySectionTitles[i], { 88 //stickTo: '.entry-article-inner', 89 //stickyTo: '.sidebar-wrap', 90 stickTo: stickySectionTitles[i].parentNode.parentNode.parentNode, 91 top: 80 92 }); 93 94 } 95 } 96 97 98 // if ($('.sticky-block_js').length > 0) { 99 // var stickySectionTitles = document.getElementsByClassName('sticky-block_js'); 100 101 // for (var i = 0; i < stickySectionTitles.length; i++) { 102 // var stickyBlock = new hcSticky(stickySectionTitles[i], { 103 // stickTo: stickySectionTitles[i].parentNode, 104 // followScroll: false, 105 // top: 50 106 // }); 107 108 // } 109 // } 110 document.querySelectorAll('.entry-content figure').forEach(figure => { 111 let img = figure.querySelector('img');
112 let caption = figure.querySelector('figcaption'); 113 114 if (img && caption) { 115 let altText = img.getAttribute('alt') || ''; // Get current alt or empty string 116 let captionText = caption.textContent.trim(); 117 118 if (!altText && captionText) { // Only update if alt is empty 119 img.setAttribute('alt', captionText); 120 console.log(`Updated alt for: ${img.src} â "${captionText}"`); 121 } 122 } 123}); 124 }); 125 126 } 127 } 128 Drupal.behaviors.progressIndicator = { 129 attach: function (context, settings) { 130 Drupal.Ajax.prototype.setProgressIndicatorFullscreen = function () { 131 this.progress.element = $('<div class="ajax-progress"><lottie-player autoplay loop mode="normal" src="/themes/custom/aawsatv3/assets/img/json/loading.json" > </lottie-player> </div>'); 132 $('body .pager').before(this.progress.element); 133 }; 134 } 135 }; 136})(jQuery, Drupal); 137
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.