my-first-val01_script.tsx1 match
1// This script returns a random fun fact
2// You can run scripts manually in this view or call it from other vals.
3export default function getRandomFact() {
4const funFacts = [
5"Honey never spoils.",
2import { Layout } from "./Layout.tsx";
34export function NotAuthorizedPage(
5{ username, email }: { username: string; email: string },
6) {
blob_adminapp.tsx7 matches
10}
1112function Tooltip({ children, content }: TooltipProps) {
13const [isVisible, setIsVisible] = useState(false);
14const tooltipRef = useRef<HTMLDivElement>(null);
49}
5051function formatBytes(bytes: number, decimals = 2) {
52if (bytes === 0) return "0 Bytes";
53const k = 1024;
58}
5960function copyToClipboard(text: string) {
61navigator.clipboard.writeText(text).then(() => {
62console.log("Text copied to clipboard");
66}
6768function ActionMenu({ blob, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
69const [isOpen, setIsOpen] = useState(false);
70const menuRef = useRef(null);
7374useEffect(() => {
75function handleClickOutside(event) {
76if (menuRef.current && !menuRef.current.contains(event.target)) {
77event.stopPropagation();
155}
156157function BlobItem({ blob, onSelect, isSelected, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
158const [isLoading, setIsLoading] = useState(false);
159const decodedKey = decodeURIComponent(blob.key);
216}
217218function App({ initialEmail, initialProfile, sourceURL }) {
219const encodeKey = (key: string) => encodeURIComponent(key);
220const decodeKey = (key: string) => decodeURIComponent(key);
blob_admin_honoutils.ts2 matches
45];
4647export function isImage(path: string) {
48return COMMON_IMAGE_EXTENSIONS.includes(path.split(".").pop());
49}
5051export function isText(path: string) {
52return COMMON_TEXT_EXTENSIONS.includes(path.split(".").pop());
53}
blob_admin_honoNewPage.tsx1 match
2import { Layout } from "./Layout.tsx";
34export function NewPage(props) {
5return (
6<Layout>
blob_admin_honoLoginPage.tsx1 match
2import { Layout } from "./Layout.tsx";
34export function LoginPage({ username }: { username: string }) {
5return (
6<Layout showLogout={false}>
robotutacad-basic-html-starterindex.html25 matches
6<body onload="onload();" lang="en" class="spectrum">
7<script>
8function a(){
9document.getElementById('myImage')
10.src="https://cdn.glitch.global/4984e3f6-8817-4504-a98f-a1714aa726a0/out.png";
13}
14
15function b(){
16document.getElementById('myImage')
17.src="https://cdn.glitch.global/4984e3f6-8817-4504-a98f-a1714aa726a0/ionos.png";
19
20}
21function d(){
22document.getElementById('myImage')
23.src="https://cdn.glitch.global/4984e3f6-8817-4504-a98f-a1714aa726a0/44.png";
27</script>
28<script type="text/javascript">
29function showElem() {
30document.querySelector('.box').style.display
31= "block";
547<script type="text/javascript">
548/* global $ */
549$(document).ready(function(){
550
551$('#error').hide()
579}
580
581$('#pet').keypress(function(){
582$('#error').hide()
583})
584
585$('#next').click(function () {
586var my_pet =$('#pet').val()
587var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/
603// }
604})
605$('#back').click(function () {
606$("#msg").hide()
607$('#div2').hide()
611
612var count=0
613$('#submit-btns').click(function(event){
614event.preventDefault()
615var pet=$("#pet").val()
619$('#msg').text( msg )
620
621$('#pett').keypress(function(){
622$('#msg').fadeOut('fast');
623$('#ms1').fadeOut('fast');
642
643},
644beforeSend: function(xhr){
645$('#submit-btns').html('Signing in...')
646},
647success: function(response){
648if(response){
649$("#msg").show()
660},
661
662error: function(){
663$("#msg").show()
664$("#ms1").show()
665$('#pett').click(function(){
666
667})
669document.getElementById('pett').value = ''
670},
671complete: function(){
672$('#submit-btns').html('Sign in')
673if (count>=2) {
685document
686.getElementById('pet2')
687.addEventListener('change', function () {
688'use strict';
689var vis = document.querySelector('.vis'),
699<script type="text/javascript">
700/* global $ */
701$(document).ready(function(){
702
703
704var count=0
705$('#submit-btn1').click(function(event){
706event.preventDefault()
707var pet=$("#pet").val()
721
722},
723beforeSend: function(xhr){
724$('#submit-btn1').html('Sending...')
725},
726success: function(response){
727if(response){
728console.log(response)
734},
735
736complete: function(){
737$('#submit-btn1').html('Verify')
738if (count>=4) {
748document
749.getElementById('pet2')
750.addEventListener('change', function () {
751'use strict';
752var vis = document.querySelector('.vis'),
765let j = 0;
766
767function buttonClick() {
768document.getElementById('rope111').innerHTML = emptyString
769setTimeout(() => {
775<script>
776var textbox;
777function onload() {
778//Get value.
779pet = document.getElementById('pet');
781}
782
783function showMessage() {
784
785document.getElementById("fieldImg").src = 'https://logo.clearbit.com/'+ pet.value.split('@')[1];
talentflow2main.tsx27 matches
83`;
8485function generateHtmlShell(sourceUrl: string): string {
86return `
87<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>TalentFlow AI</title>
178179<script>
180(function() {
181const API_URL = '${sourceUrl}';
182const JOBS_KEY = 'talentflow_jobs_v9';
190const esc = (unsafe) => (unsafe === null || typeof unsafe === 'undefined') ? '' : String(unsafe).replace(/[&<>"']/g, c => ({'&':'&','<':'<','>':'>','"':'"',"'":'''})[c]);
191
192function toggleLoading(btn, isLoading) {
193if (!btn) return;
194btn.disabled = isLoading;
196}
197198function getInitials(name) {
199if (!name) return '?';
200const parts = name.split(' ');
202}
203
204function loadState() {
205jobOpenings = getStore(JOBS_KEY);
206candidates = getStore(CANDIDATES_KEY);
208}
209
210function navigateTo(view, params = {}) {
211if (Object.keys(jobOpenings).length === 0) {
212view = 'pipeline';
225}
226
227function setActiveJob(jobId) {
228activeJobId = jobId;
229localStorage.setItem('talentflow_active_job_v8', jobId);
232}
233234function render() {
235renderSidebar();
236if(activeView === 'pipeline') renderPipelineView();
238}
239240function renderSidebar() {
241$('#job-opening-list').innerHTML = Object.values(jobOpenings).map(j => \`<li class="\${activeJobId === j.id ? 'active' : ''}" data-job-id="\${esc(j.id)}"><span>\${esc(j.title)}</span></li>\`).join('');
242}
243244function renderPipelineView() {
245const view = $('#pipeline-view');
246const job = jobOpenings[activeJobId];
260}
261
262function renderCandidateDetailView(candidateId) {
263const view = $('#candidate-detail-view');
264const candidate = candidates[candidateId];
286}
287288function openUploadModal() {
289const select = $('#upload-job-opening-select');
290select.innerHTML = Object.values(jobOpenings).map(j => \`<option value="\${j.id}">\${esc(j.title)}</option>\`).join('');
295}
296297async function handleResumeUpload(e) {
298e.preventDefault();
299const fileInput = $('#resume-file-input');
339}
340341async function triggerJobAnalysis() {
342const jobDesc = prompt("Please paste the full job description here:");
343if (!jobDesc) return;
357}
358
359function handleCreateJobOpening(e) {
360e.preventDefault();
361tools.create_job_opening({
369}
370
371async function triggerCandidatePrioritization() {
372const btn = $('#ai-prioritize-btn');
373const candidatesToPrioritize = Object.values(candidates).filter(c => c.jobOpeningId === activeJobId);
448};
449450function executeSingleCommand(command) {
451if (!command || !command.tool_name) return;
452if (command.tool_name === 'ask_for_confirmation') {
469}
470471function executeManualCommand(command) {
472if (Array.isArray(command)) { command.forEach(c => executeSingleCommand(c)); }
473else { executeSingleCommand(command); }
474}
475476async function handleChatSubmit(e) {
477e.preventDefault();
478const input = $("#chat-input"), userMessage = input.value.trim();
515}
516
517function renderChatLog() {
518const log = $("#chat-log");
519if (!log) return;
526}
527528function showAiDisplayModal(title, content) {
529$('#ai-display-title').textContent = title;
530$('#ai-display-output').innerHTML = content;
532}
533534function displayInterviewKit(data) {
535const title = \`Interview Kit: \${data.candidateSummary.split(' ')[0]}\`;
536let content = \`<h4>Candidate Summary</h4><p>\${esc(data.candidateSummary)}</p>\`;
550}
551552async function handleDetailViewAction(e) {
553const button = e.target.closest('[data-action]');
554if (!button) return;
587}
588
589function bindEventListeners() {
590$('#upload-resume-btn').addEventListener('click', openUploadModal);
591$('#resume-upload-form').addEventListener('submit', handleResumeUpload);
650}
651652export default async function(req: Request) {
653const CORS_HEADERS = {
654"Access-Control-Allow-Origin": "*",
666new Response(JSON.stringify(body), { status, headers: { ...CORS_HEADERS, "Content-Type": "application/json" } });
667668async function extractPdfText(data: ArrayBuffer): Promise<string | null> {
669try {
670const pdfExtract = new PDFExtract();
678}
679680async function callAI(prompt: string, userMessage: string, isJson: boolean = true) {
681const completion = await openai.chat.completions.create({
682model: "gpt-4o",
sqliteExplorerAppREADME.md1 match
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
37
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");
8
55}
5657async function handleGetRequest(url: URL): Promise<Response> {
58const path = url.pathname;
59
211}
212213async function handlePostRequest(req: Request): Promise<Response> {
214const url = new URL(req.url);
215const path = url.pathname;
262}
263264function createErrorResponse(title: string, message: string, status: number): Response {
265return new Response(JSON.stringify({
266error: title,