PageSourceSearch

https://c1st.com/shop/wp-content/themes/hello-theme-child-master/js/custom.js?ver=6.8.10

js c1st.com collected 2026-10-03 20:10:52 UTC 8,132 bytes, 217 lines download raw bytes

1jQuery(document).ready(function($) {
2	//** Add wrapper element for Swiper section - Start **
3
4	$('.swiper-pagination, .elementor-swiper-button-prev, .elementor-swiper-button-next').wrapAll('<div id="button-wrapper" />');
5
6	//** Add wrapper element for Swiper section - End **
7
8
9	
10	//** Custom tabs, with list and prev/next button navigation - Start **
11
12	// List navigation
13	$(".elementor-custom-icon-list > .elementor-widget-container > .elementor-icon-list-items > .elementor-icon-list-item:first-child").remove();
14	var text = [];
15	$( ".elementor-custom-tab-section > .elementor-widget-container > .elementor-tabs > .elementor-tabs-wrapper > .elementor-tab-title" ).each(function() {
16		var tabIds = this.id;
17		var tabText = $(this).text();
18		$('<li class="elementor-icon-list-item elementor-custom-tab ' + tabIds + '"><span class="elementor-icon-list-text">' + tabText + '</span></li>').appendTo('.elementor-custom-icon-list > .elementor-widget-container > .elementor-icon-list-items');
19		$( ".elementor-custom-tab" ).eq(0).addClass('elementor-custom-tab-active');
20		// If custom tabs is clicked, trigger elementor-tab-title
21		var divClass = "."+tabIds;
22		var divId = "#"+tabIds;
23		$(divClass).click(function(){
24			$(divId).trigger("click");
25			$('li.elementor-custom-tab-active').removeClass('elementor-custom-tab-active');
26			$(this).addClass('elementor-custom-tab-active');
27		   return false;
28		});	
29	});
30	
31	// Prev/Next buttons
32	var list = $(".elementor-custom-tab-section > .elementor-widget-container > .elementor-tabs > .elementor-tabs-wrapper");
33	var li = list.children();
34	var lengthMinusOne = li.length - 1;
35	var index = 0;
36	var num = $(".elementor-custom-tab-section > .elementor-widget-container > .elementor-tabs > .elementor-tabs-wrapper > .elementor-tab-title").length;
37	var prevLi = $(li[0]);
38
39	$("#next").click(function(){
40		index++;
41		if (index > lengthMinusOne) index = 0;
42		prevLi = $(li[index]).trigger("click");;
43	});
44	$("#prev").click(function(){
45		index--;
46		if (index < 0) index = lengthMinusOne;
47		prevLi = $(li[index]).trigger("click");;
48	});
49	
50	var $first = $('li:first', '.elementor-custom-icon-list > .elementor-widget-container > ul'),
51    $last = $('li:last', '.elementor-custom-icon-list > .elementor-widget-container > ul');
52	$("#next").click(function () {
53		var $next, $selected = $(".elementor-custom-tab-active");
54
55
56		$next = $selected.next('li').length ? $selected.next('li') : $first;
57		$selected.removeClass("elementor-custom-tab-active");
58		$next.addClass('elementor-custom-tab-active');
59	});
60
61	$("#prev").click(function () {
62		var $prev, $selected = $(".elementor-custom-tab-active");
63
64		$prev = $selected.prev('li').length ? $selected.prev('li') : $last;
65		$selected.removeClass("elementor-custom-tab-active");
66		$prev.addClass('elementor-custom-tab-active');
67	});
68
69	//** Custom tabs, with list list and prev/next button navigation - End **
70	
71	
72	
73	//** Expand grid for App pages - Start **
74    $('.categories-expand').each(function(){
75        var $ul = $(this),
76            $lis = $ul.find('.category-element:gt(3)'),
77            isExpanded = $ul.hasClass('expanded');
78        $lis[isExpanded ? 'show' : 'hide']();
79        
80        if($lis.length > 0){
81            $ul
82                .append($('<div class="category-button-wrapper"><button class="showmore list-expand">' + (isExpanded ? ' Vis færre' : ' Vis alle funktioner') + '</button></div>')
83                .click(function(event){
84                    var isExpanded = $ul.hasClass('expanded');
85                    event.preventDefault();
86                    $(this).html(isExpanded ? ' <button class="showmore list-expand">Vis alle funktioner</button>' : ' <button class="showmore list-expand active">Vis færre</button>');
87					
88                    $ul.toggleClass('expanded');
89                    $lis.slideToggle(500);
90        	}));
91        }
92    });
93	//** Expand grid for App pages - End **
94  	
95	
96	
97	//** Add clipboard **
98	var $temp = $("<input>");
99	var $url = $(location).attr('href');
100
101	$('.clipboard').on('click', function() {
102		event.preventDefault();
103	  $("body").append($temp);
104	  $temp.val($url).select();
105	  document.execCommand("copy");
106	  $temp.remove();
107	  $(this).addClass("clipboard-clicked").removeClass("clipboard-unclicked");
108	  $(".clipboard-indication").addClass("clipboard-indication-clicked").removeClass("clipboard-indication-unclicked");
109	  setTimeout(function() {
110		$('.clipboard').removeClass("clipboard-clicked").addClass("clipboard-unclicked");
111        $(".clipboard-indication").removeClass("clipboard-indication-clicked").addClass("clipboard-indication-unclicked");
112      }, 1000) 
113	})
114	//** Add clipboard - End **
115
116	
117	
118	//** Job position counter **
119	var $jobposition_amount = $('.jobposition-container').length;
120	$(".jobposition-counter > .elementor-widget-container > .elementor-heading-title").html($jobposition_amount);
121   	//** End Job position counter **
122
123	//** Cart sidebar title **
124	$('.elementor-menu-cart__close-button').wrapAll('<div class="elementor-menu-cart__close-button-title-wrapper" />');
125	$( '.elementor-menu-cart__close-button' ).before( '<span class="elementor-menu-cart_title">Kurv</span>' );
126	$('.elementor-menu-cart__close-button').wrapAll('<div class="elementor-menu-cart__close-button-wrapper" />');
127	//** Cart sidebar title - End **
128
129
130
131	//** Mega menu - "Click to open" **//
132	// remove all .active classes when clicked anywhere
133	hide = true;
134	$('body').on("click", function () {
135		if (hide) $('.nav_item').removeClass('active');
136		hide = true;
137	});
138
139	// add and remove .active to .nav_item
140	$('body').on('click', '.nav_item', function () {
141
142		var self = $(this);
143
144		if (self.hasClass('active')) {
145			$('.nav_item').removeClass('active');
146			return false;
147		}
148
149		$('.nav_item').removeClass('active');
150
151		self.toggleClass('active');
152		hide = false;
153	});
154	//** Mega menu - "Click to open" - End **//
155	   
156})
157
158document.addEventListener("DOMContentLoaded", function () {
159    let currentPath = window.location.pathname;
160
161    // Define base paths (Danish to English)
162    let basePaths = {
163        "/": "/en/",
164        "/omnichannel/": "/en/omnichannel/",
165        "/integrationer/shopify/": "/en/shopify/"
166    };
167
168    // Generate reverse mappings (English to Danish) dynamically
169    let languageMap = {};
170    for (let danish in basePaths) {
171        let english = basePaths[danish];
172        languageMap[danish] = english;
173        languageMap[english] = danish;
174    }
175
176    let allowedPages = Object.keys(languageMap); // Get all valid paths
177
178    // Check if the current page is in the allowed pages list
179    if (!allowedPages.includes(currentPath)) {
180        return; // Stop execution if the page is not in the list
181    }
182
183    // Fetch GeoIP Country Once
184    fetch("/wp-admin/admin-ajax.php?action=get_geoip_country")
185        .then(response => response.json())
186        .then(data => {
187            let userCountry = data.country || "Unknown";
188
189            // REDIRECTION LOGIC
190            if (!localStorage.getItem("geoip_redirected") && userCountry !== "Denmark" && languageMap[currentPath]) {
191                localStorage.setItem("geoip_redirected", "true");
192                window.location.href = languageMap[currentPath]; // Redirect
193                return;
194            }
195
196            // LANGUAGE SWITCHER LOGIC
197            if (userCountry !== "Denmark") {
198                let switchTo = languageMap[currentPath];
199                let flag = currentPath.startsWith("/en/") ? "da" : "en";
200
201                let switcherDiv = document.createElement("div");
202                switcherDiv.className = "language-switcher";
203                switcherDiv.innerHTML = `
204                    <a href="${switchTo}" class="lang-flag">
205                        <img src="https://c1st.com/wp-content/uploads/2025/03/${flag}.png" alt="Switch Language">
206                    </a>
207                `;
208
209                let placeholder = document.getElementById("language-switch-placeholder");
210                if (placeholder) {
211                    placeholder.appendChild(switcherDiv);
212                }
213            }
214        })
215        .catch(error => console.error("GeoIP lookup failed:", error));
216});
217

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.