PageSourceSearch

https://www.ruhrnachrichten.de/wp-content/plugins/cyan-favorite-posts/assets/js/script.min.js?ver=1788861417

js ruhrnachrichten.de collected 2026-09-24 08:41:35 UTC 3,342 bytes, 1 lines download raw bytes

1!function(){const t=[],e="cyan-favorite-watchlist-add-success-shown";function a(e){const a=e?e.getElementsByClassName("cyan-favorite-wrapper"):document.getElementsByClassName("cyan-favorite-wrapper");Array.from(a).forEach(e=>{if(e.hasAttribute("data-initialized"))return;e.setAttribute("data-initialized","true");const a=e.getAttribute("data-id");null!==a&&t.push(a),e.addEventListener("click",t=>{t.preventDefault(),e.classList.contains("cyan-favorite-loading")||(!1!==document.body.classList.contains("logged-in")?(e.classList.add("cyan-favorite-loading"),fetch(window.cyan_favorite_posts.apiUrl+"/toggle",{method:"POST",headers:{"X-WP-Nonce":window.cyan_favorite_posts.nonce,"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},body:new URLSearchParams({post_id:e.getAttribute("data-id")})}).then(t=>t.json().then(e=>({ok:t.ok,data:e}))).then(({ok:t,data:a})=>{t?(e.innerHTML=a.button,document.dispatchEvent(new CustomEvent("cyan-favorite",{detail:a.status}))):document.dispatchEvent(new CustomEvent("cyan-favorite",{detail:"failed"})),e.classList.remove("cyan-favorite-loading")}).catch(()=>{document.dispatchEvent(new CustomEvent("cyan-favorite",{detail:"failed"})),e.classList.remove("cyan-favorite-loading")})):document.dispatchEvent(new CustomEvent("cyan-favorite",{detail:"guest"})))})})}function n(){if(!0===document.body.classList.contains("logged-in")&&t.length>0){const e=t.filter((t,e,a)=>a.indexOf(t)===e);fetch(window.cyan_favorite_posts.apiUrl,{method:"POST",headers:{"X-WP-Nonce":window.cyan_favorite_posts.nonce,"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},body:new URLSearchParams({post_ids:e.join(",")})}).then(t=>t.json().then(e=>({ok:t.ok,data:e}))).then(({ok:t,data:e})=>{t?(e.favorite_posts.forEach(t=>{document.querySelectorAll(`.cyan-favorite-wrapper[data-id="${t}"]`).forEach(t=>{t.innerHTML=e.button})}),document.dispatchEvent(new CustomEvent("cyan-favorite",{detail:"checked"}))):document.dispatchEvent(new CustomEvent("cyan-favorite",{detail:"check-failed"}))}).catch(()=>{document.dispatchEvent(new CustomEvent("cyan-favorite",{detail:"check-failed"}))})}}a(),n(),document.addEventListener("teasers-appended",t=>{a(t.target),n()}),document.addEventListener("cyan-favorite",t=>{switch(t.detail){case"guest":document.getElementById("watchlist-login").showModal();break;case"failed":document.getElementById("watchlist-failed").showModal();break;case"added":if(!1===function(){try{return"1"===window.localStorage.getItem(e)}catch{return!1}}()){const t=document.querySelector('#user-navigation a[href*="/merkliste"]'),a=document.getElementById("watchlist-add-success");a&&(!function(){try{window.localStorage.setItem(e,"1")}catch{console.warn("Could not save success modal state to local storage.")}}(),a.showModal(),t&&a.addEventListener("close",()=>{const e=document.createElement("div");e.classList.add("tooltip"),e.style.position="absolute",e.style.marginTop="-92px",t.insertAdjacentElement("afterend",e),e.textContent="Zum Merkzettel gehen",document.body.classList.add("user-nav-open"),document.getElementById("user-menu-button").setAttribute("aria-expanded","true"),t.classList.add("attention-focus");const a=()=>{e.remove(),t.classList.remove("attention-focus"),document.removeEventListener("click",a)};setTimeout(()=>{document.addEventListener("click",a)},100)}))}}})}();

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.