Spaces:
Running
Running
Download script.js from ben12688/shipshape-quote-master: direct link, hf CLI and curl.
- Browser
- Download file 886 Bytes
-
https://huggingface.co/spaces/ben12688/shipshape-quote-master/resolve/main/script.js
- Command line
-
hf download hf://spaces/ben12688/shipshape-quote-master/script.js
-
curl -L -o script.js https://huggingface.co/spaces/ben12688/shipshape-quote-master/resolve/main/script.js
886 Bytes
| // Global utility functions | |
| function formatCurrency(amount) { | |
| return new Intl.NumberFormat('en-US', { | |
| style: 'currency', | |
| currency: 'USD' | |
| }).format(amount); | |
| } | |
| // Initialize tooltips | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Initialize any tooltips or popovers | |
| feather.replace(); | |
| // Add any global event listeners here | |
| }); | |
| // API helper functions | |
| async function getShippingRates(data) { | |
| // This would be replaced with actual API calls to backend | |
| try { | |
| const response = await fetch('/api/rates', { | |
| method: 'POST', | |
| headers: { | |
| 'Content-Type': 'application/json', | |
| }, | |
| body: JSON.stringify(data) | |
| }); | |
| return await response.json(); | |
| } catch (error) { | |
| console.error('Error fetching rates:', error); | |
| return null; | |
| } | |
| } |