checking if I left anything out

This commit is contained in:
Brodin 2024-09-23 19:11:58 -04:00
parent d6d85f2ffe
commit 624b6e8385
5 changed files with 5 additions and 5 deletions

View File

@ -1 +1 @@
const adminUrl=window.location.href.replace("auth-frame/","")+"api/admin",siteOrigin="http://0.0.0.0:2372";window.addEventListener("message",(async function(t){if(t.origin!==siteOrigin)return void console.warn("Ignored message to admin auth iframe because of mismatch in origin","expected",siteOrigin,"got",t.origin,"with data",t.data);let i=null;try{i=JSON.parse(t.data)}catch(t){console.error(t)}function n(n,e){t.source.postMessage(JSON.stringify({uid:i.uid,error:n,result:e}),siteOrigin)}if("getUser"===i.action)try{const t=await fetch(adminUrl+"/users/me/");n(null,await t.json())}catch(t){n(t,null)}if("hideComment"===i.action)try{const t=await fetch(adminUrl+"/comments/"+i.id+"/",{method:"PUT",body:JSON.stringify({comments:[{id:i.id,status:"hidden"}]}),headers:{"Content-Type":"application/json"}});n(null,await t.json())}catch(t){n(t,null)}if("showComment"===i.action)try{const t=await fetch(adminUrl+"/comments/"+i.id+"/",{method:"PUT",body:JSON.stringify({comments:[{id:i.id,status:"published"}]}),headers:{"Content-Type":"application/json"}});n(null,await t.json())}catch(t){n(t,null)}})); const adminUrl=window.location.href.replace("auth-frame/","")+"api/admin",siteOrigin="https://rittenhop.brodin.rocks";window.addEventListener("message",(async function(t){if(t.origin!==siteOrigin)return void console.warn("Ignored message to admin auth iframe because of mismatch in origin","expected",siteOrigin,"got",t.origin,"with data",t.data);let i=null;try{i=JSON.parse(t.data)}catch(t){console.error(t)}function n(n,e){t.source.postMessage(JSON.stringify({uid:i.uid,error:n,result:e}),siteOrigin)}if("getUser"===i.action)try{const t=await fetch(adminUrl+"/users/me/");n(null,await t.json())}catch(t){n(t,null)}if("hideComment"===i.action)try{const t=await fetch(adminUrl+"/comments/"+i.id+"/",{method:"PUT",body:JSON.stringify({comments:[{id:i.id,status:"hidden"}]}),headers:{"Content-Type":"application/json"}});n(null,await t.json())}catch(t){n(t,null)}if("showComment"===i.action)try{const t=await fetch(adminUrl+"/comments/"+i.id+"/",{method:"PUT",body:JSON.stringify({comments:[{id:i.id,status:"published"}]}),headers:{"Content-Type":"application/json"}});n(null,await t.json())}catch(t){n(t,null)}}));

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
!async function(){const t={},e=new Set,o=document.querySelector("[data-ghost-comments-counts-api]").dataset.ghostCommentsCountsApi,n=function(o){(o.querySelectorAll?.("[data-ghost-comment-count]")||[]).forEach((o=>{t[o.dataset.ghostCommentCount]||e.add(o.dataset.ghostCommentCount)}))},a=async function(){const n=Array.from(e);if(e.clear(),!n.length)return;const a=await fetch(`${o}?ids=${n.join(",")}`,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(200!==a.status)return;const s=await a.json();for(const[e,o]of Object.entries(s))t[e]=o;!function(){for(const[e,o]of Object.entries(t))document.querySelectorAll(`[data-ghost-comment-count="${e}"]`).forEach((t=>{let e=t.dataset.ghostCommentCountEmpty;if(1===o&&(e=t.dataset.ghostCommentCountSingular?`${o} ${t.dataset.ghostCommentCountSingular}`:o),o>1&&(e=t.dataset.ghostCommentCountPlural?`${o} ${t.dataset.ghostCommentCountPlural}`:o),e)if("false"!==t.dataset.ghostCommentCountAutowrap){const o=document.createElement(t.dataset.ghostCommentCountTag);t.dataset.ghostCommentCountClassName&&o.classList.add(t.dataset.ghostCommentCountClassName),o.textContent=e,t.insertAdjacentElement("afterend",o)}else t.insertAdjacentText("afterend",e);t.remove()}))}()};new MutationObserver((t=>{t.forEach((t=>{t.addedNodes.forEach((t=>{n(t),function(){let t}()}))}))})).observe(document.body,{subtree:!0,childList:!0}),n(document.body),a()}(); !async function(){const t={},e=new Set,o=document.querySelector("[data-ghost-comments-counts-api]").dataset.ghostCommentsCountsApi,n=function(o){(o.querySelectorAll?.("[data-ghost-comment-count]")||[]).forEach((o=>{t[o.dataset.ghostCommentCount]||e.add(o.dataset.ghostCommentCount)}))},a=async function(){const n=Array.from(e);if(e.clear(),!n.length)return;const a=await fetch(`${o}?ids=${n.join(",")}`,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(200!==a.status)return;const s=await a.json();for(const[e,o]of Object.entries(s))t[e]=o;!function(){for(const[e,o]of Object.entries(t))document.querySelectorAll(`[data-ghost-comment-count="${e}"]`).forEach((t=>{let e=t.dataset.ghostCommentCountEmpty;if(1===o&&(e=t.dataset.ghostCommentCountSingular?`${o} ${t.dataset.ghostCommentCountSingular}`:o),o>1&&(e=t.dataset.ghostCommentCountPlural?`${o} ${t.dataset.ghostCommentCountPlural}`:o),e)if("false"!==t.dataset.ghostCommentCountAutowrap){const o=document.createElement(t.dataset.ghostCommentCountTag);t.dataset.ghostCommentCountClassName&&o.classList.add(t.dataset.ghostCommentCountClassName),o.textContent=e,t.insertAdjacentElement("afterend",o)}else t.insertAdjacentText("afterend",e);t.remove()}))}()};new MutationObserver((t=>{t.forEach((t=>{t.addedNodes.forEach((t=>{n(t),function(t,e=100){let o}()}))}))})).observe(document.body,{subtree:!0,childList:!0}),n(document.body),a()}();

View File

@ -1 +1 @@
/home/neurobomber/CodeProjects/local-rittenhop-ghost/current/content/themes/casper /var/lib/ghost/current/content/themes/casper

View File

@ -1 +1 @@
/home/neurobomber/CodeProjects/local-rittenhop-ghost/current/content/themes/source /var/lib/ghost/current/content/themes/source