PageSourceSearch

https://traineeshipsoverzicht.nl/static/CACHE/js/output.6e23dce3f1cd.js

js traineeshipsoverzicht.nl collected 2026-09-26 02:21:48 UTC 11,760 bytes, 32 lines download raw bytes

1let bookmarkedVacancies=[];document.addEventListener("DOMContentLoaded",()=>{document.body.classList.remove("preload");document.body.style.opacity=1;bookmarkedVacancies=getBookmarkedVacanciesFromCookie();handleMboVacancyLinks();});function getCSRFToken(){return document.querySelector('meta[name="csrf-token"]').getAttribute("content");}
2function toggleBookmark(element){const bookmarkFill=element.querySelector(".bi-bookmark-check-fill");const bookmark=element.querySelector(".bi-bookmark");const saveSpan=element.querySelector(".save-span");const vacancy_id=element.getAttribute("data-id");const isNowBookmarked=bookmarkFill.classList.contains("-translate-y-12");const myVacanciesIndicator=document.getElementById("my-vacancies-indicator",);if(isNowBookmarked){bookmarkFill.classList.remove("-translate-y-12");bookmark.classList.add("translate-y-12");if(saveSpan){saveSpan.textContent="Bewaard";}
3myVacanciesIndicator.classList.remove("hidden");if(window._sqzl){window._sqzl.push({event:"AddToWishlist",products:[{id:vacancy_id.toString()}],});}}else{bookmarkFill.classList.add("-translate-y-12");bookmark.classList.remove("translate-y-12");if(saveSpan){saveSpan.textContent="Bewaar";}
4fetch("/bookmark-vacancy",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":getCSRFToken(),},body:JSON.stringify({id:vacancy_id,bookmarked:isNowBookmarked,}),}).then((response)=>response.json()).then((data)=>{if(data.show_indicator){myVacanciesIndicator.classList.remove("hidden");}else{myVacanciesIndicator.classList.add("hidden");}}).catch((error)=>{console.error("Error updating bookmark status:",error);});return;}
5fetch("/bookmark-vacancy",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":getCSRFToken(),},body:JSON.stringify({id:vacancy_id,bookmarked:isNowBookmarked,}),}).then((response)=>response.json()).then((data)=>{if(data.show_indicator){myVacanciesIndicator.classList.remove("hidden");}else{myVacanciesIndicator.classList.add("hidden");}}).catch((error)=>{console.error("Error updating bookmark status:",error);});}
6function getBookmarkedVacanciesFromCookie(){const cookieString=document.cookie.split("; ").find((row)=>row.startsWith("bookmarked_vacancies="));if(!cookieString)return[];try{const encodedValue=cookieString.split("=")[1];const decoded=decodeURIComponent(encodedValue);return JSON.parse(decoded);}catch(err){console.error("Error decoding bookmarked_vacancies cookie",err);return[];}}
7function removeVacancy(button,redirect=false){const vacancyId=button.getAttribute("data-id");const csrfToken=getCSRFToken();const url=`/cms-portal/vacancy/delete/${vacancyId}/`;if(!redirect){button.closest(".outer-vacancy-card-container").remove();}
8fetch(url,{method:"POST",headers:{"X-CSRFToken":csrfToken,"Content-Type":"application/json",},}).then((response)=>{if(response.ok){console.log("Vacancy removed successfully");if(redirect){window.history.back();}}else{console.error("Failed to remove vacancy");}}).catch((error)=>{console.error("Error:",error);});}
9function blacklistVacancy(button,redirect=false){const vacancyId=button.getAttribute("data-id");const csrfToken=getCSRFToken();const url=`/cms-portal/vacancy/blacklist/${vacancyId}/`;if(!redirect){button.closest(".outer-vacancy-card-container").remove();}
10fetch(url,{method:"POST",headers:{"X-CSRFToken":csrfToken,"Content-Type":"application/json",},}).then((response)=>{if(response.ok){console.log("Vacancy blacklisted successfully");if(redirect){window.history.back();}}else{console.error("Failed to blacklist vacancy");}}).catch((error)=>{console.error("Error:",error);});}
11function deactivateVacancy(button,redirect=false){const vacancyId=button.getAttribute("data-id");const csrfToken=getCSRFToken();const url=`/cms-portal/vacancy/deactivate/${vacancyId}/`;if(!redirect){button.closest(".outer-vacancy-card-container").remove();}
12fetch(url,{method:"POST",headers:{"X-CSRFToken":csrfToken,"Content-Type":"application/json",},}).then((response)=>{if(response.ok){console.log("Vacancy deactivated successfully");if(redirect){window.history.back();}}else{console.error("Failed to deactivate vacancy");}}).catch((error)=>{console.error("Error:",error);});}
13function rescrapeVacancy(button){const vacancyId=button.getAttribute("data-id");const csrfToken=getCSRFToken();const url=`/cms-portal/vacancy/rescrape/${vacancyId}/`;fetch(url,{method:"POST",headers:{"X-CSRFToken":csrfToken,"Content-Type":"application/json",},}).then((response)=>{if(response.ok){console.log("Vacancy is being rescraped");window.history.back();}else{console.error("Failed to rescrape vacancy");}}).catch((error)=>{console.error("Error:",error);});}
14function promoteVacancy(button){let currentRequestId=parseInt(button.getAttribute("data-request-id")||"0",10)+1;button.setAttribute("data-request-id",currentRequestId);let currentPromotion=parseInt(button.getAttribute("data-promotion")||"0",10,);let newPromotion=(currentPromotion+1)%5;let starIcon=button.querySelector(".bi-star");let promoText=button.querySelector(".promo-text");let promotedBadge=button.parentNode.querySelector(".promoted-badge");if(newPromotion>0){if(starIcon)starIcon.classList.add("hidden");if(promoText){promoText.textContent=`${newPromotion}w`;promoText.classList.remove("hidden");}
15if(promotedBadge&&!window.userIsAuthenticated){promotedBadge.classList.remove("hidden");}}else{if(starIcon)starIcon.classList.remove("hidden");if(promoText)promoText.classList.add("hidden");if(promotedBadge){promotedBadge.classList.add("hidden");}}
16button.setAttribute("data-promotion",newPromotion);const vacancyId=button.getAttribute("data-id");const csrfToken=getCSRFToken();const url=`/cms-portal/promote-vacancy/${vacancyId}/${newPromotion}/`;fetch(url,{method:"POST",headers:{"X-CSRFToken":csrfToken,"Content-Type":"application/json",},}).then((response)=>{if(!response.ok){return Promise.reject("Server error");}
17return response.json();}).then((data)=>
17{if(button.getAttribute("data-request-id")!=currentRequestId){console.log("Ignored outdated promotion response");return;}
18console.log("Vacancy promotion updated successfully with request id",currentRequestId,);}).catch((error)=>{if(button.getAttribute("data-request-id")!=currentRequestId){console.log("Ignored outdated promotion error");return;}
19console.error("Error promoting vacancy:",error);let revertPromotion=currentPromotion;button.setAttribute("data-promotion",revertPromotion);if(revertPromotion>0){if(starIcon)starIcon.classList.add("hidden");if(promoText){promoText.textContent=`${revertPromotion}w`;promoText.classList.remove("hidden");}
20if(promotedBadge&&!window.userIsAuthenticated){promotedBadge.classList.remove("hidden");}}else{if(starIcon)starIcon.classList.remove("hidden");if(promoText)promoText.classList.add("hidden");if(promotedBadge)promotedBadge.classList.add("hidden");}});}
21function handleMboVacancyLinks(){const referrer=document.referrer;const currentHost=window.location.hostname;if(referrer&&referrer.includes("traineeshipsoverzicht.nl")){sessionStorage.setItem("cameFromTraineeshipsoverzicht","true");}
22const cameFromTraineeshipsoverzicht=sessionStorage.getItem("cameFromTraineeshipsoverzicht")==="true";const mboLinks=document.querySelectorAll('a[data-mbo-link="true"]');mboLinks.forEach((link)=>{if(cameFromTraineeshipsoverzicht&&!currentHost.includes("techboosters.nl")){link.setAttribute("target","_blank");}});};document.addEventListener("DOMContentLoaded",()=>{const hboBtn=document.getElementById("hbo-wo-vacatures-button");const hboMenu=document.getElementById("hbo-wo-vacatures-dropdown");if(hboBtn&&hboMenu){handleDropdown(hboBtn,hboMenu);}
23const mboBtn=document.getElementById("mbo-vacatures-button");const mboMenu=document.getElementById("mbo-vacatures-dropdown");if(mboBtn&&mboMenu){handleDropdown(mboBtn,mboMenu);}
24const header=document.getElementById("site-header");const dynamicScrollSubstrings=["/bedrijven/","/voor-werkgevers",];const currentPath=window.location.pathname;const isHome=currentPath==="/";const isOtherDynamic=dynamicScrollSubstrings.some((sub)=>currentPath.includes(sub),);const isDynamicScrollPage=isHome||isOtherDynamic;if(isDynamicScrollPage){window.addEventListener("scroll",function(){if(window.scrollY>0){header.classList.add("scrolled");}else{header.classList.remove("scrolled");}});if(window.scrollY>0){header.classList.add("scrolled");}}else{header.classList.add("scrolled");}
25const menuButton=document.getElementById("mobile-menu-button");const menu=document.getElementById("mobile-menu");const hboWoVacanciesDropdownButton=document.getElementById("hbo-wo-vacancies-dropdown-button",);const hboWoVacanciesMenu=document.getElementById("disclosure-1");const mboVacanciesDropdownButton=document.getElementById("mbo-vacancies-dropdown-button",);const mboVacanciesMenu=document.getElementById("disclosure-2");const hboWoMenuChevron=document.getElementById("hbo-wo-mobile-menu-chevron",);const mboMenuChevron=document.getElementById("mbo-mobile-menu-chevron");function openMenu(){menu.classList.remove("hidden");requestAnimationFrame(()=>{menu.classList.remove("max-h-0");menu.classList.add("max-h-[calc(100vh-4rem)]");});}
26function closeMenu(){menu.classList.remove("max-h-[calc(100vh-4rem)]");menu.classList.add("max-h-0");menu.addEventListener("transitionend",function handler(e){if(e.propertyName==="max-height"){menu.classList.add("hidden");menu.removeEventListener("transitionend",handler);}});}
27menuButton.addEventListener("click",function(e){e.stopPropagation();if(menu.classList.contains("hidden")){openMenu();}else{closeMenu();}});function toggleVacancies(button,menu,chevron){const isOpen=button.getAttribute("aria-expanded")==="true";button.setAttribute("aria-expanded",!isOpen);if(!isOpen){chevron.style.transform="rotate(0deg)";menu.classList.remove("hidden");menu.style.maxHeight="0px";setTimeout(()=>{menu.style.transition="max-height 0.3s ease-in-out";menu.style.maxHeight=menu.scrollHeight+"px";},10);}else{chevron.style.transform="rotate(90deg)";menu.style.maxHeight="0px";setTimeout(()=>{menu.classList.add("hidden");},300);}}
28if(hboWoVacanciesDropdownButton){hboWoVacanciesDropdownButton.addEventListener("click",function(event){event.stopPropagation();toggleVacancies(hboWoVacanciesDropdownButton,hboWoVacanciesMenu,hboWoMenuChevron,);});}
29mboVacanciesDropdownButton.addEventListener("click",function(event){event.stopPropagation();toggleVacancies(mboVacanciesDropdownButton,mboVacanciesMenu,mboMenuChevron,);});});function handleDropdown(button,dropdown){button.addEventListener("click",()=>{const isHidden=dropdown.classList.contains("hidden");
29if(isHidden){dropdown.classList.remove("hidden");setTimeout(()=>{dropdown.classList.add("opacity-100","translate-y-0");dropdown.classList.remove("opacity-0","translate-y-1");},10);}else{dropdown.classList.add("opacity-0","translate-y-1");dropdown.classList.remove("opacity-100","translate-y-0");setTimeout(()=>{dropdown.classList.add("hidden");},150);}
30button.setAttribute("aria-expanded",isHidden?"true":"false");});document.addEventListener("click",(event)=>{if(!button.contains(event.target)&&!dropdown.contains(event.target)){dropdown.classList.add("opacity-0","translate-y-1");dropdown.classList.remove("opacity-100","translate-y-0");setTimeout(()=>{dropdown.classList.add("hidden");},150);button.setAttribute("aria-expanded","false");}});document.querySelectorAll(".category-link").forEach((anchor)=>{anchor.addEventListener("click",function(){const categoryId=extractCategoryId(this.href);if(categoryId){window._sqzl.push({event:"ViewCategory",category_id:categoryId,});}});});}
31function extractCategoryId(href){try{const url=new URL(href,window.location.origin);const parts=url.pathname.split("/").filter((part)=>part.length);if(parts.length>=2&&parts[0]==="vacatures"){return parts[1];}}catch(err){}
32return null;};

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.