From cb89950f92baf63500a9f71c0a4b17209bfb9898 Mon Sep 17 00:00:00 2001 From: Keep Creating Online <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Sun, 2 Feb 2025 15:32:01 -0500 Subject: [PATCH] updated form --- .../iframe-content-appeals-form.html | 37 ++++++++++++------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/src/components/iframe_forms/iframe-content-appeals-form.html b/src/components/iframe_forms/iframe-content-appeals-form.html index 5b854ae..0569a91 100644 --- a/src/components/iframe_forms/iframe-content-appeals-form.html +++ b/src/components/iframe_forms/iframe-content-appeals-form.html @@ -3,17 +3,19 @@ Content Appeals Form - @@ -139,11 +148,13 @@

5. Declaration

- By submitting this appeal, you confirm that: -
- You are the original creator or authorized representative of the - content in question.
- Your appeal is submitted in good faith and - aligns with bitvid’s policies.
- You understand that final - decisions are at the discretion of bitvid’s moderation process. + By submitting this appeal, you confirm that:
+ - You are the original creator or authorized representative of the + content in question.
+ - Your appeal is submitted in good faith and aligns with bitvid’s + policies.
+ - You understand that final decisions are at the discretion of bitvid’s + moderation process.

@@ -175,7 +186,7 @@ signEvent, nip04, relayInit, - } from "https://cdn.jsdelivr.net/npm/nostr-tools/+esm"; + } from "https://cdn.jsdelivr.net/npm/nostr-tools@1.14.1/+esm"; // ---- Configure target npubs and relays here ---- const targetNpubs = [ @@ -209,13 +220,10 @@ const ephemeralPrivKey = generatePrivateKey(); const ephemeralPubKeyHex = getPublicKey(ephemeralPrivKey); - // Convert form data to a text block (or JSON string if you prefer) + // Convert form data to JSON const formText = JSON.stringify(dataObject, null, 2); - // For each target npub: - // 1) Convert to hex - // 2) Encrypt the form data with ephemeral key - // 3) Create and publish an event to each relay + // Send to each target for (const npub of targetNpubs) { try { const decoded = nip19.decode(npub); @@ -249,6 +257,7 @@ // Publish to configured relays for (const relayUrl of Object.keys(relays)) { const relay = relayInit(relayUrl); + relay.on("connect", () => { console.log(`Connected to ${relayUrl}`); }); @@ -266,7 +275,7 @@ console.error(`Failed to publish to ${relayUrl}:`, reason); }); - // Close the relay after a short delay or after publish + // Close the relay after a short delay setTimeout(() => { relay.close(); }, 3000); @@ -276,7 +285,7 @@ } } - // (Optional) Clear or reset the form + // Optional: reset the form form.reset(); alert("Your appeal has been submitted via Nostr DMs."); });