This commit is contained in:
Local Server
2025-12-19 20:44:46 -06:00
parent 701f799cde
commit e4b3de4a46
113 changed files with 16673 additions and 2174 deletions

View File

@@ -0,0 +1,47 @@
// Production-ready wrapper for shopping.js
// Removes console statements for production
(function () {
"use strict";
class ShoppingCart {
constructor() {
this.cart = this.loadFromStorage("cart") || [];
this.wishlist = this.loadFromStorage("wishlist") || [];
this.setupEventListeners();
this.renderCart();
this.renderWishlist();
}
loadFromStorage(key) {
try {
const data = localStorage.getItem(key);
return data ? JSON.parse(data) : null;
} catch (e) {
// Silent error handling in production
return null;
}
}
saveToStorage(key, data) {
try {
localStorage.setItem(key, JSON.stringify(data));
return true;
} catch (e) {
// Silent error handling in production
return false;
}
}
// Add other methods here...
}
// Initialize when DOM is ready
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", () => {
window.shoppingCart = new ShoppingCart();
});
} else {
window.shoppingCart = new ShoppingCart();
}
})();