From 1b14996290f228a329d83c164e50c27364cc0a22 Mon Sep 17 00:00:00 2001 From: altaf-creator Date: Sat, 13 Jun 2026 19:06:09 +0800 Subject: blog in progress, NOT READY FOR PROD --- www/scripts/blog.js | 5 +++-- www/scripts/constants.js | 4 ++-- www/scripts/iframe.js | 11 +++++++++++ 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 www/scripts/iframe.js (limited to 'www/scripts') diff --git a/www/scripts/blog.js b/www/scripts/blog.js index c7c64f2..b5ad89c 100644 --- a/www/scripts/blog.js +++ b/www/scripts/blog.js @@ -29,7 +29,7 @@ function postCard(post, id) { var title = post.title; var date = post.date; - var author = post.author; + var description = post.description; var tags = post.tags; var thumbnail = post.thumbnail; @@ -45,7 +45,8 @@ function postCard(post, id) { ${evaluatedTags}

${title}

-

${date}

+

${date}

+

${description}

` diff --git a/www/scripts/constants.js b/www/scripts/constants.js index 1c2812e..b2b7894 100644 --- a/www/scripts/constants.js +++ b/www/scripts/constants.js @@ -1,2 +1,2 @@ -const API_URL = "https://altafcreator.com/api" -//const API_URL = "http://localhost:9091/api" +//const API_URL = "https://altafcreator.com/api" +const API_URL = "http://localhost:9091/api" diff --git a/www/scripts/iframe.js b/www/scripts/iframe.js new file mode 100644 index 0000000..68eff8d --- /dev/null +++ b/www/scripts/iframe.js @@ -0,0 +1,11 @@ +function iframeLoad(id) { + const iframeContainer = document.getElementById(id); + const iframes = iframeContainer.querySelectorAll(":scope > iframe"); // this a NodeList + const warning = iframeContainer.querySelector(".iframe-manual-warning"); + + warning.remove(); + + iframes.forEach((frame, _) => { + frame.setAttribute("src", frame.getAttribute("data-src")); + }); +} -- cgit v1.2.3