From 084dedcca16015f9362791e30b12900eb985ddf3 Mon Sep 17 00:00:00 2001 From: Daniel Wilkowski Date: Tue, 30 Jan 2024 23:41:09 +0100 Subject: [PATCH] Add example 4play.light preview --- public/4play.light.html | 21 +++++++++++++++++++++ public/main.js | 1 + 2 files changed, 22 insertions(+) create mode 100644 public/4play.light.html create mode 100644 public/main.js diff --git a/public/4play.light.html b/public/4play.light.html new file mode 100644 index 0000000000..ba81ca72b6 --- /dev/null +++ b/public/4play.light.html @@ -0,0 +1,21 @@ +4play.light - Editor for 4programmers.net

4play.light (wersja 0.0.0-alpha, by @Riddle)

Edytor treści na 4programmers.net, przeznaczony głównie do komentarzy pod postami.

diff --git a/public/main.js b/public/main.js new file mode 100644 index 0000000000..ba0d92e9ec --- /dev/null +++ b/public/main.js @@ -0,0 +1 @@ +(()=>{var e;function t(e,t){const o=document.querySelector("template#example").content.cloneNode(!0);return function(e,t,o){const[a,n]=e.querySelectorAll("#editor,#preview");a.textContent=t,n.innerHTML=o}(o,e,t),o}function o(e){document.getElementById("examples").appendChild(e)}o(t("Hello, **world**!","Hello, world!")),o(t("Hello, *world*!","Hello, world!")),o(t("Ale `*jak* to działa **dokładnie**`? Czytałem, że [fajnie](/link).",'Ale *jak* to działa **dokładnie**? Czytałem, że fajnie.')),o(("h-40",(e=t("Też tak myślałem.\n\n> ##### [macok napisał(a)](/Forum/1948013):\n> Ale *jak* to działa **dokładnie**? Czytałem, że [fajnie](/link).\n\nDokładnie tak robi to Google. Metoda triangulacji.",'Też tak myślałem.
Ale jak to działa dokładnie? Czytałem, że fajnie.
Dokładnie tak robi to Google. Metoda triangulacji.')).querySelector("textarea").classList.replace("h-12","h-40"),e)),document.querySelector("button").addEventListener("click",(()=>function(e){const t=document.getElementById("examples");t.insertBefore(e,t.firstChild)}(t("new example","new example")))),document.querySelector("#examples").addEventListener("click",(e=>{const t=e.target;"BUTTON"===t.nodeName&&t.closest("li").remove()}))})(); \ No newline at end of file