53
54 var formBody = "userGroup=&email=" + encodeURIComponent(formInput.value);
55 fetch(event.target.action, {
56 method: "POST",
57 body: formBody,
80 .catch(error => {
81 // check for cloudflare error
82 if (error.message === "Failed to fetch") {
83 rateLimit();
84 return;
169app.get("/", (c) => c.html(html));
170
171export default (typeof Deno !== "undefined" && Deno.env.get("valtown")) ? app.fetch : app;
146 try {
147 const url = '${url}';
148 const response = await fetch(url, {
149 method: 'POST',
150 headers: {
156 if (!response.ok) {
157 let errorJson = await response.json();
158 console.error('Fetch Error:', errorJson);
159 showError('Error fetching data: ' + (errorJson.message || 'Unknown error'));
160 return;
161 }
359app.get("/", (c) => c.html(html));
360
361export default (typeof Deno !== "undefined" && Deno.env.get("valtown")) ? app.fetch : app;
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
137});
138
139export default modifyFetchHandler(passwordAuth(app.fetch));
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));
314
315 async function loadCalendars() {
316 const response = await fetch('/calendars');
317 const calendars = await response.json();
318 const calendarList = document.getElementById('calendarList');
346 return;
347 }
348 await fetch('/calendars', {
349 method: 'POST',
350 headers: { 'Content-Type': 'application/json' },
356
357 async function deleteCalendar(id) {
358 await fetch('/calendars', {
359 method: 'DELETE',
360 headers: { 'Content-Type': 'application/json' },
370 async function viewCalendar(id) {
371 currentCalendarId = id;
372 const response = await fetch('/calendars');
373 const calendars = await response.json();
374 const calendar = calendars.find(c => c.id === id);
440 userAvailability.clear();
441 overallAvailability = {};
442 const response = await fetch(\`/availability?calendarId=\${currentCalendarId}\`);
443
444 const data = await response.json();
476 const available = !userAvailability.has(key);
477
478 const response = await fetch('/availability', {
479 method: 'POST',
480 headers: { 'Content-Type': 'application/json' },
118 function calculateHotdogs() {
119 const playerName = document.getElementById('playerSelect').value;
120 fetch('/calculate?player=' + encodeURIComponent(playerName))
121 .then(response => response.json())
122 .then(data => {
175
176export default async function handler(request: Request): Promise<Response> {
177 return app.fetch(request)
178}
179
149 const generatedName = `excali${generateRandomName(selectedOptions)}`;
150
151 const response = await fetch("/create-val", {
152 method: "POST",
153 headers: {
245
246 // Create a new val using the Val Town API
247 const response = await fetch("https://api.val.town/v1/vals", {
248 method: "POST",
249 headers: {
149 const generatedName = `excali${generateRandomName(selectedOptions)}`;
150
151 const response = await fetch("/create-val", {
152 method: "POST",
153 headers: {
245
246 // Create a new val using the Val Town API
247 const response = await fetch("https://api.val.town/v1/vals", {
248 method: "POST",
249 headers: {
1/** @jsxImportSource npm:hono@3/jsx */
2import { modifyFetchHandler as codeOnValTownBanner } from "https://esm.town/v/andreterron/codeOnValTown";
3import { passwordAuth } from "https://esm.town/v/pomdtr/password_auth";
4import { Hono } from "npm:hono@3";
125
126export default codeOnValTownBanner(
127 passwordAuth(app.fetch, { verifyPassword: verifyToken }),
128);