1import { 2 initializeSlots, 3 refreshSlots, 4 destroySlots, 5} from "./ulweb-publish-util.js?20260820_2"; 6import { initializeScroll, destroyScroll } from "./ulweb-scroll.js?20240131"; 7 8function modifyUrlAndTitle(menu_code, title) { 9 const url = `/category/${menu_code}`; 10 window.history.replaceState(null, null, url); 11 12 document.title = `${title} | U Lifestyle`; 13 14 $("link[rel='canonical']").attr('href', (window.location.origin) + url); 15} 16 17function changeMenuLayout(activeCode) { 18 $("#menu-bar .item").removeClass("active"); 19 $(`#menu-bar .item[data-value='${activeCode}']`).addClass("active"); 20} 21 22function changeContentLayout(html, theme) { 23 $(".site-content.container").html(html); 24 $("#content-wrapper").attr("data-name", theme); 25 window.scrollTo(0, 0); 26} 27 28function getListingTargetings($item) { 29 return { section: $item.data("title") }; 30} 31 32$(function () { 33 let current_page = $("#content-wrapper").data("page"); 34 let pageTargetings = null; 35 36 if (current_page === "listing") { 37 const $current_item = $("#menu-bar .owl-item > .item.active"); 38 pageTargetings = getListingTargetings($current_item); 39 } 40 41 initializeSlots(pageTargetings); 42 43 const theme_name = $("#content-wrapper").data("name"); 44 initializeScroll(theme_name); 45 46 $("#menu-bar .list-content").on("click", `.item:not(.external)`, function () { 47 const menu_code = $(this).data("value"); 48 const title = $(this).data("title"); 49 current_page = $("#content-wrapper").data("page"); 50 51 const listingTargetings = getListingTargetings($(this)); 52 53 $.ajax({
54 url: `/listing/${menu_code}`, 55 beforeSend: () => { 56 changeMenuLayout(menu_code); 57 58 destroyScroll(); 59 60 if (current_page === "overview") destroySlots(); 61 }, 62 success: (html) => { 63 modifyUrlAndTitle(menu_code, title); 64 65 changeContentLayout(html, title); 66 67 ga4Event( 68 "ulweb", 69 { 70 title: $(document).attr("title"), 71 category: title, 72 content_type: "ulweb", 73 }, 74 "ultriggerpageview" 75 ); 76 77 initializeScroll(title); 78 79 if (current_page === "overview") initializeSlots(listingTargetings); 80 else refreshSlots(listingTargetings); 81 }, 82 complete: () => { }, 83 }); 84 }); 85});
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.