3import { sqlite } from "https://esm.town/v/std/sqlite";
45export default async function validateCartaPorteData(req: Request): Promise<Response> {
6const AIRTABLE_API_KEY = Deno.env.get("AIRTABLE_API_KEY")!;
7const AIRTABLE_BASE_ID = Deno.env.get("AIRTABLE_BASE_ID")!;
thehost-mapboxscript.js16 matches
1let map;
2document.addEventListener("DOMContentLoaded", function() {
3mapboxgl.accessToken = "pk.eyJ1IjoidGhlaG9zdCIsImEiOiJjbWEybmh6aWYwYXY3MnFyM2h3ZXhydWp4In0.pkEiJs8EOR9t1ZFCzfWAtQ";
4map = new mapboxgl.Map({
18map.addControl(new mapboxgl.NavigationControl({ showCompass: false }), "top-right");
1920map.on("load", function() {
21// Ajout de l'icône custom PNG blanc (hébergée sur Webflow, doit être blanc pur sur fond transparent)
22map.loadImage(
58});
5960map.on("moveend", function() {
61if (window.filterListByMapView) window.filterListByMapView();
62});
63map.on("zoomend", function() {
64if (window.filterListByMapView) window.filterListByMapView();
65});
7677// Récupère les points dynamiques depuis le DOM (Webflow)
78function initializePoints() {
79const locationItems = document.querySelectorAll("[points-mapbox]");
80mapLocations.features = [];
127// Cette fonction remplace addMapPoints et addMapLayerEvents
128// =========================
129function updateMarkers(features) {
130// 1. Supprimer les marqueurs existants
131currentMarkers.forEach((marker) => marker.remove());
133134// Détection du mode tactile (tablette/mobile)
135function isTouchDevice() {
136return "ontouchstart" in window || navigator.maxTouchPoints > 0;
137}
239// addMapLayerEvents() - SUPPRIMÉ
240241function filterListByMap() {
242const bounds = map.getBounds();
243const sw = bounds.getSouthWest();
261}
262263function getUrlParams() {
264const params = {};
265window.location.search.substring(1).split("&").forEach(function(part) {
266if (!part) return;
267const item = part.split("=");
271}
272273window.updateMapPointsFromVisibleCards = function() {
274const visibleItems = Array.from(document.querySelectorAll("[points-mapbox]")).filter(item =>
275item.style.display !== "none"
336]);
337338window.filterListByMapView = function() {
339if (!map) return;
340const bounds = map.getBounds();
376// Ajout : Hover sur la liste synchronisé avec la carte (MODIFIÉ)
377// =========================
378function bindListHoverToMapbox() {
379document.querySelectorAll("[points-mapbox]").forEach((item) => {
380item.onmouseenter = null;
389if (!markerEl) return;
390391item.onmouseenter = function() {
392const path = markerEl.querySelector(".marker-path");
393if (path) path.style.fill = "#F7F3E6";
394};
395item.onmouseleave = function() {
396const path = markerEl.querySelector(".marker-path");
397if (path) path.style.fill = "black";
403// Appel initial après chargement de la carte et des points
404if (document.readyState === "loading") {
405document.addEventListener("DOMContentLoaded", function() {
406if (window.bindListHoverToMapbox) window.bindListHoverToMapbox();
407});
Louapi_scheduler_trigger.tsx4 matches
4import { LouLineupScheduler } from "./daily_lineup_scheduler.tsx";
56export default async function(req: Request): Promise<Response> {
7console.log("Manual scheduler trigger API called");
854}
5556async function handleGetRequest(url: URL): Promise<Response> {
57const path = url.pathname;
58160}
161162async function handlePostRequest(req: Request): Promise<Response> {
163const url = new URL(req.url);
164const path = url.pathname;
214}
215216function createErrorResponse(title: string, message: string, status: number): Response {
217return new Response(
218JSON.stringify({
1export default async function(req: Request): Promise<Response> {
2console.log(req.headers);
3return new Promise((resolve, reject) => {
8import { Hono } from "npm:hono";
910function html() {
11/*
12<!DOCTYPE html>
58}
5960function css() {
61/*
62body {
138}
139140function js() {
141/*
142document.addEventListener("DOMContentLoaded", () => {
OptimismTrackerindex.html9 matches
288const probabilityValue = document.getElementById('probabilityValue');
289
290probabilitySlider.addEventListener('input', function() {
291probabilityValue.textContent = this.value;
292});
299
300// Data storage
301function getPredictions() {
302return JSON.parse(localStorage.getItem('predictions') || '[]');
303}
304
305function savePredictions(predictions) {
306localStorage.setItem('predictions', JSON.stringify(predictions));
307}
308
309function addPrediction() {
310const question = document.getElementById('question').value.trim();
311const probability = parseInt(document.getElementById('probability').value);
339}
340
341function resolvePrediction(id, outcome) {
342const predictions = getPredictions();
343const prediction = predictions.find(p => p.id === id);
351}
352
353function updateDisplay() {
354const predictions = getPredictions();
355const active = predictions.filter(p => !p.resolved);
361}
362
363function displayActivePredictions(predictions) {
364const container = document.getElementById('activePredictions');
365
384}
385
386function displayResolvedPredictions(predictions) {
387const container = document.getElementById('resolvedPredictions');
388
406}
407
408function updateCalibration(resolvedPredictions) {
409if (resolvedPredictions.length < 3) {
410document.getElementById('calibrationSection').classList.add('hidden');
tuempresaValidationCatalogGrok.tsx2 matches
11};
1213async function fetchRecord(table: string, recordId: string) {
14const res = await fetch(`https://api.airtable.com/v0/${AIRTABLE_BASE_ID}/${table}/${recordId}`, {
15headers: airtableHeaders,
19}
2021export async function validateRecord(req: Request): Promise<Response> {
22try {
23const recordId = new URL(req.url).searchParams.get("recordId");
vt-testsemailAnalyzer.http.tsx2 matches
1import Anthropic from "https://esm.sh/@anthropic-ai/sdk@0.24.3";
23export default async function(req: Request): Promise<Response> {
4if (req.method !== "GET") {
5return new Response("Method not allowed", { status: 405 });
117}
118119function isValidEmail(email: string): boolean {
120const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
121return emailRegex.test(email);
mcp-servermain.ts13 matches
32};
3334function postFilter(post: Post) {
35return post.type == "post" || post.type == "page";
36}
3738function buildTagsIndex(tags: Array<Tag>) {
39return lunr(function() {
40this.ref("id");
41this.field("name");
50});
51}
52function search(input: string, index: lunr.Index, searchData: Record<string, Post>) {
53let results = index.search(input);
5455if ((results.length == 0) && (input.length > 2)) {
56let tokens = lunr.tokenizer(input).filter(function(token, i) {
57return token.str.length < 20;
58});
5960if (tokens.length > 0) {
61results = index.query(function(query) {
62query.term(tokens, {
63editDistance: Math.round(Math.sqrt(input.length / 2 - 1)),
90}
9192function searchTags(input: string, index: lunr.Index, tags: Array<Tag>) {
93let results = index.search(input);
9495if ((results.length == 0) && (input.length > 2)) {
96let tokens = lunr.tokenizer(input).filter(function(token, i) {
97return token.str.length < 20;
98});
99100if (tokens.length > 0) {
101results = index.query(function(query) {
102query.term(tokens, {
103editDistance: Math.round(Math.sqrt(input.length / 2 - 1)),
116});
117}
118function formatPage(page: Post) {
119return [
120`# [${page.title}](${SITE_URL + page.url})`,
135}
136137function extractPostCategory(post: Post) {
138if (post.type == "page") {
139return "page";
160* Uses a cached instance if available
161*/
162async function setupMcpServer(): Promise<McpServer> {
163// Return cached instance if available
164if (mcpServerInstance) {
498499/**
500* Val.town handler function for HTTP requests
501* This will be exposed as a Val.town HTTP endpoint
502*/