Spaces:
Running
Running
Download script.js from ben12688/shipquote-pro: direct link, hf CLI and curl.
- Browser
- Download file 1.45 kB
-
https://huggingface.co/spaces/ben12688/shipquote-pro/resolve/main/script.js
- Command line
-
hf download hf://spaces/ben12688/shipquote-pro/script.js
-
curl -L -o script.js https://huggingface.co/spaces/ben12688/shipquote-pro/resolve/main/script.js
1.45 kB
| document.addEventListener('DOMContentLoaded', function() { | |
| // Initialize tooltips | |
| const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')); | |
| tooltipTriggerList.map(function (tooltipTriggerEl) { | |
| return new bootstrap.Tooltip(tooltipTriggerEl); | |
| }); | |
| // Sample function to fetch rates - would be replaced with actual API calls | |
| function fetchShippingRates() { | |
| console.log("Fetching shipping rates from carriers..."); | |
| // In a real app, this would make API calls to FedEx, UPS, DHL | |
| } | |
| // Event listeners | |
| document.querySelectorAll('.refresh-rates').forEach(button => { | |
| button.addEventListener('click', fetchShippingRates); | |
| }); | |
| // PDF generation handler | |
| document.querySelector('.generate-pdf').addEventListener('click', function() { | |
| console.log("Generating PDF quote..."); | |
| // Would integrate with a PDF generation service | |
| }); | |
| // Email quote handler | |
| document.querySelector('.email-quote').addEventListener('click', function() { | |
| console.log("Sending email quote..."); | |
| // Would integrate with SendGrid or similar | |
| }); | |
| // Discount request handler | |
| document.querySelector('.request-discount').addEventListener('click', function() { | |
| console.log("Initiating discount request workflow..."); | |
| // Would show modal for discount amount and route to approval workflow | |
| }); | |
| }); |