PageSourceSearch

https://www.donau.com/_assets/1798f66a72c0609b2ee5b404d10475ff/Dis…/Scripts/bookmarks.004c73437f3ea06a66a1.js

js donau.com collected 2026-10-02 10:05:44 UTC 4,892 bytes, 1 lines download raw bytes

1(()=>{class t{constructor(){this.storageKey="noew_bookmark_hash",this.apiBase="?type=1060",this.bookmarkHash=this.getBookmarkHash(),this.init()}init(){this.attachEventListeners(),this.updateBookmarkButtons()}getBookmarkHash(){return localStorage.getItem(this.storageKey)}setBookmarkHash(t){localStorage.setItem(this.storageKey,t),this.bookmarkHash=t}async createBookmarkList(){try{const t=await fetch(`${this.apiBase}&action=create&title=${encodeURIComponent(TYPO3.lang["js.bookmark.header"]||"Bookmarks")}`,{method:"GET"}),e=await t.json();e.success&&(this.setBookmarkHash(e.data.hash),this.updateBookmarkCount(0))}catch(t){console.error("Error creating bookmark list:",t)}}async addBookmark(t){try{const e=new URLSearchParams({action:"add",hash:this.bookmarkHash||"",itemType:t.type,title:t.title,itemUid:t.uid||0,itemImxId:t.imxId||"",itemContext:t.context||"",pageUid:t.pageUid||0}),o=await fetch(`${this.apiBase}&${e.toString()}`,{method:"GET"}),a=await o.json();if(a.success)return a.data.newHash&&this.setBookmarkHash(a.data.newHash),this.updateBookmarkCount(a.data.count),!0}catch(t){console.error("Error adding bookmark:",t)}return!1}async removeBookmark(t){if(!this.bookmarkHash)return!1;try{const e=new URLSearchParams({action:"remove",hash:this.bookmarkHash,itemType:t.type,itemUid:t.uid||0,itemImxId:t.imxId||"",pageUid:t.pageUid||0}),o=await fetch(`${this.apiBase}&${e.toString()}`,{method:"GET"}),a=await o.json();if(a.success)return this.updateBookmarkCount(a.data.count),!0}catch(t){console.error("Error removing bookmark:",t)}return!1}getBookmarkListUrl(){return this.bookmarkHash?`?id=${window.bookmarkPageId||1}&bookmark=${this.bookmarkHash}`:null}updateBookmarkCount(t){document.querySelectorAll(".js-bookmark-count").forEach((e=>{e.textContent=t,e.style.display=t>0?"inline":"none"}));const e=document.querySelectorAll(".js-bookmark-link"),o=this.getBookmarkListUrl();e.forEach((e=>{o&&(e.href=o,e.style.display=t>0?"inline-block":"none")})),this.updateBookmarkPageLinks(),this.updateHeaderBookmarkIcon(t)}updateHeaderBookmarkIcon(t){const e=document.querySelector("#pageHeader__buttons .iconify");if(!e)return;const o=e.closest(".link");o&&(t>0?(o.classList.add("has-bookmarks"),this.applyIconFill(e,"currentColor"),console.log("BOOKMARKS detected")):(o.classList.remove("has-bookmarks"),this.applyIconFill(e,"none")))}applyIconFill(t,e){let o=0;const a=()=>{const r=t.shadowRoot?.querySelector("svg");r?r.setAttribute("fill",e):++o<400&&setTimeout(a,50)};a()}updateBookmarkPageLinks(){this.bookmarkHash&&document.querySelectorAll("a[data-bookmark-page]").forEach((t=>{try{const e=new URL(t.href,window.location.origin);e.searchParams.set("bookmark",this.bookmarkHash),t.href=e.toString()}catch(t){console.error("Error updating bookmark page link:",t)}}))}attachEventListeners(){document.addEventListener("click",(async t=>{const e=t.target.closest("[data-bookmark]");if(t.target.closest(".bookmarksPrint"))return t.preventDefault(),void window.print();if(e){t.preventDefault();const o=e.querySelector(".text"),a=e.querySelector(".iconify"),r=e.dataset.labelAdd||"Zur Merkliste hinzufügen",s=e.dataset.labelDelete||"Von Merkliste entfernen",i=JSON.parse(e.dataset.bookmark);e.classList.contains("is-bookmarked")?await this.removeBookmark(i)&&(e.classList.remove("is-bookmarked"),e.setAttribute("aria-pressed","false"),e.setAttribute("title",r),e.setAttribute("aria-label",r),o&&(o.textContent=r),a&&a.setAttribute("icon","ion:bookmark-outline")):await this.addBookmark(i)&&(e.classList.add("is-bookmarked"),e.setAttribute("aria-pressed","true"),e.setAttribute("title",s),e.setAttribute("aria-label",s),o&&(o.textContent=s),a&&a.setAttribute("icon","ion:bookmark"))}}))}async updateBookmarkButtons(){if(this.bookmarkHash)try{const t=await fetch(`${this.apiBase}&action=info&hash=${this.bookmarkHash}`),e=await t.json();if(e.success){this.updateBookmarkCount(e.data.count);const t=e.data.items||[];document.querySelectorAll("[data-bookmark]").forEach((e=>{try{const o=JSON.parse(e.dataset.bookmark),a=t.some((t=>o.pageUid===t.page_uid)),r=e.querySelector(".text"),s=e.querySelector(".iconify"),i=e.dataset.labelAdd||"Zur Merkliste hinzufügen",n=e.dataset.labelDelete||"Von Merkliste entfernen";a?(e.classList.add("is-bookmarked"),e.setAttribute("aria-pressed","true"),e.setAttribute("title",n),e.setAttribute("aria-label",n),r&&(r.textContent=n),s&&s.setAttribute("icon","ion:bookmark")):(e.classList.remove("is-bookmarked"),e.setAttribute("aria-pressed","fal
1se"),e.setAttribute("title",i),e.setAttribute("aria-label",i),r&&(r.textContent=i),s&&s.setAttribute("icon","ion:bookmark-outline"))}catch(t){console.error("Error parsing bookmark button data:",t)}}))}}catch(t){console.error("Error fetching bookmark info:",t)}}}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(()=>{window.bookmarkManager=new t})):window.bookmarkManager=new t})();

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.