PageSourceSearch

https://oes.dk/dist/assets/feed-list-DE6xlIxZ.js

js oes.dk collected 2026-10-02 06:04:42 UTC 7,744 bytes, 13 lines download raw bytes

1import{a as C,E as _}from"./api-fetcher-D7q-2H74.js";import{r as D}from"./replace-text-between-brackets-CNjNGvuP.js";import{t as M}from"./try-parse-json-PNnY1j55.js";import{f as g,e as w,d as y}from"./da-96X4bRny.js";const N=()=>{const e=window.themeSettings.dateFormat,t=document.documentElement.lang??"da";switch(e){case"Short date (DA: 18.12.2024) (EN: 12/18/2024)":return t==="da"?"dd.MM.yyyy":"MM/dd/yyyy";case"Long date (onsdag den 18. december 2024)":return t==="da"?"eeee 'den' dd. MMMM yyyy":"eeee, dd. MMMM yyyy";case"Year month (DA: december 2024) (EN: December 2024)":return"MMMM yyyy";case"Short date [Month] (18. december 2024)":return"dd. MMMM yyyy";case"Short Name (ons. 18 dec. 2024)":return"eee dd MMM yyyy";default:return""}},T=(e,t)=>{e.innerHTML=`<p class="feed-list__loading">${t}</<p>`},k=(e,t)=>{e.innerHTML=`<p class="feed-list__error">${t}</<p>`},I=(e,t)=>{e.innerHTML=`<p class="feed-list__no-results">${t}</<p>`},f=(e,t=!1)=>{const n=N(),s=document.documentElement.lang??"da",l=s==="en"?w:y;if(n&&!t){const c=new Date(e);return g(c,n,{locale:l})}else{const c=new Date(e);return isNaN(c.getTime())?e:c.toLocaleDateString(s,{year:"numeric",day:"numeric",month:"long",...t&&{hour:"2-digit",minute:"2-digit"}})}},L=190,b=(e,t=200,n="...")=>e.length<=t?e:e.substring(0,t)+n,x=(e,t)=>{const n=document.createElement("li");n.className="feed-list__list-item results-list__item";const s=t.showLink&&e.link,l=t.showTitle&&e.title,c=t.showDescription&&e.description,u=t.showDate&&e.publishedDate,r=document.createElement("div");if(r.className="results-item",l||c||u){const o=document.createElement("div");if(o.className="results-item__text",l){const a=document.createElement("h2");if(a.className="results-item__title",a.textContent=e.title,s){r.classList.add("results-item--link");const i=document.createElement("a");i.className="results-item__inner-link",i.setAttribute("href",e.link),i.setAttribute("target","_blank"),a.appendChild(i)}o.appendChild(a)}if(u){const a=document.createElement("dl");a.className="results-item__info-list";let i="";e.publishedDate&&(i+=`
2				<dt>${t.translations.jobListCreatedLabel}</dt>
3				<dd>${f(e.publishedDate)}</dd>
4				`),e.organisation&&(i+=`
5				<dt>${t.translations.jobListOrganisationLabel}</dt>
6				<dd>${e.organisation}</dd>
7				`),e.positionLocation&&(i+=`
8				<dt>${t.translations.jobListPositionLocationLabel}</dt>
9				<dd>${e.positionLocation}</dd>
10				`),e.applicationDeadline&&new Date(e.applicationDeadline).getFullYear()!==1&&(i+=`
11				<dt>${t.translations.jobListDeadlineLabel}</dt>
12				<dd>${f(e.applicationDeadline)}</dd>
13				`),a.innerHTML=i,o.appendChild(a)}if(c){const a=document.createElement("p");a.className="results-item__description",a.textContent=b(e.description,L),o.appendChild(a)}r.appendChild(o)}return n.appendChild(r),n},S=(e,t)=>{const n=document.createElement("li");n.className="feed-list__list-item results-list__item";const s=t.showLink&&e.link,l=t.showImage&&e.imageUrl,c=t.showTitle&&e.title,u=t.showDescription&&e.description,r=t.showDate&&e.publishedDate,o=document.createElement("div");if(o.className="results-item",l){o.classList.add("results-item--has-image");const a=document.createElement("div");a.className="results-item__image",a.innerHTML=`<img src="${e.imageUrl}" alt="" loading="lazy"/>`,o.appendChild(a)}if(c||u||r){const a=document.createElement("div");if(a.className="results-item__text",c){const i=document.createElement("h2");if(i.className="results-item__title",i.textContent=e.title,s){o.classList.add("results-item--link");const d=document.createElement("a");d.className="results-item__inner-link",d.setAttribute("href",e.link),d.setAttribute("target","_blank"),i.appendChild(d)}a.appendChild(i)}if(r){const i=document.createElement("div");i.className="results-item__info",i.textContent=f(e.publishedDate),a.appendChild(i)}if(u){const i=document.createElement("p");i.className="results-item__description",i.textContent=b(e.description,L),a.appendChild(i)}o.appendChild(a)}return n.appendChild(o),n},A=(e,t)=>{const n=document.createElement("li");n.className="feed-list__list-item results-list__item";const s=t.showLink&&e.link,l=t.showImage&&t.listIcon,c=t.showTitle&&e.title,u=t.showDate&&e.publishedDate,r=document.createElement("div");if(r.className="results-item",l){r.classList.add("results-item--has-icon");const o=document.createElement("div");o.className="results-item__icon",o.innerHTML=t.listIcon,r.appendChild(o)}if(c||u){const o=document.createElement("div");if(o.className="results-item__text",c){const a=document.createElement("h2");if(a.className="results-item__title",a.textContent=e.title,s){r.classList.add("results-item--link");const i=document.createElement("a");i.className="results-item__inner-link",i.setAttribute("href",e.link),i.setAttribute("target","_blank"),a.appendChild(i)}o.appendChild(a)}if(u){const a=document.createElement("div");a.className="results-item__info",a.textContent=`${t.translations.mailingListSentLabel} ${f(e.publishedDate,!0)}`,o.appendChild(a)}r.appendChild(o)}return n.appendChild(r),n},$=(e,t)=>t.feedType==="job-list"||t.feedType==="job-list-rss"?x(e,t):t.feedType==="mailing-list"?A(e,t):S(e,t),E=(e,t,n,s,l)=>{t.items.slice(s,l).forEach(c=>{e.appendChild($(c,n))})},H=async(e,t)=>{T(e,t.translations.loading);const n=await v(t);if("items"in n){if(e.innerHTML="",n.totalResults===0)return I(e,t.noItemsText);const s=document.createElement("ul");if(s.className="feed-list__list results-list",e.appendChild(s),t.usePagination&&n.pageCount>1){const l=document.createElement("nav");l.ariaLabel=t.translations.pagination.paginationNavigationLabel,l.className="pagination-wrapper",e.appendChild(l),h(s,l,n,t)}else E(s,n,t,0,t.maxItemsShown)}else k(e,n.message)},h=(e,t,n,s,l=1)=>{t.innerHTML="",e.innerHTML="";const c=document.createElement("ol");c.className="pagination",t.appendChild(c);const u=10,r=Array.from({length:n.pageCount},(d,m)=>m+1),o=Math.max(0,l-Math.floor(u/2)),a=o+u,i=l===1?0:(l-1)*n.pageSize;if(l>1){const d=document.createElement("li");d.className="pagination__arrow";
13const m=document.createElement("button");m.ariaLabel=s.translations.pagination.previousPage,m.innerHTML='<span aria-hidden="true">«</span>',m.onclick=()=>{h(e,t,n,s,l-1)},d.appendChild(m),c.appendChild(d)}if(r.slice(o,a).forEach(d=>{const m=document.createElement("li");m.className="pagination__number";const p=document.createElement("button");p.textContent=d.toString(),d===l?(m.classList.add("active"),p.classList.add("active"),p.ariaCurrent="page",p.ariaLabel=s.translations.pagination.currentPage+`: ${d}`):p.ariaLabel=D(s.translations.pagination.goToPageX,d.toString()),p.onclick=()=>{h(e,t,n,s,d)},m.appendChild(p),c.appendChild(m)}),l<n.pageCount){const d=document.createElement("li");d.className="pagination__arrow";const m=document.createElement("button");m.ariaLabel=s.translations.pagination.nextPage,m.innerHTML='<span aria-hidden="true">»</span>',m.onclick=()=>{h(e,t,n,s,l+1)},d.appendChild(m),c.appendChild(d)}E(e,n,s,i,i+n.pageSize)},v=async e=>{const t=encodeURIComponent(e.feedUrl);let n=_.feedListRss;switch(e.feedType){case"job-list":n=_.feedListHr;break;case"mailing-list":n=_.feedListJson;break}try{const s=await C(n+t),l=s.length;let c=s;return e.feedType==="mailing-list"?c=s.reverse():(e.feedType==="job-list"||e.feedType==="job-list-rss")&&(c=s.sort((r,o)=>Number(new Date(r.applicationDeadline?r.applicationDeadline:864e13))-Number(new Date(o.applicationDeadline?o.applicationDeadline:864e13)))),{items:c,pageSize:e.maxItemsShown,pageCount:Math.ceil(l/e.maxItemsShown),totalResults:l}}catch(s){return{error:s,message:e.translations.error}}},U=e=>{const t=M(e.dataset.model);if(!t)return console.error("No feed list props found for",e);H(e,t)};export{U as FeedList};

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.