Upload script.js with huggingface_hub
Browse files
script.js
CHANGED
|
@@ -45,57 +45,14 @@ class QRGenerator {
|
|
| 45 |
// Real-time input changes
|
| 46 |
this.bindInputEvents();
|
| 47 |
|
| 48 |
-
// Color changes
|
| 49 |
-
|
| 50 |
-
if (this.currentQRUrl) this.generateQRCode();
|
| 51 |
-
});
|
| 52 |
-
|
| 53 |
-
document.getElementById('bg-color').addEventListener('change', () => {
|
| 54 |
-
if (this.currentQRUrl) this.generateQRCode();
|
| 55 |
-
});
|
| 56 |
-
|
| 57 |
-
// Format and error correction changes
|
| 58 |
-
document.getElementById('error-correction').addEventListener('change', () => {
|
| 59 |
-
if (this.currentQRUrl) this.generateQRCode();
|
| 60 |
-
});
|
| 61 |
}
|
| 62 |
|
| 63 |
bindInputEvents() {
|
| 64 |
-
//
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
// Text input
|
| 69 |
-
document.getElementById('text-input').addEventListener('input',
|
| 70 |
-
this.debounce(() => this.autoGenerate(), 500));
|
| 71 |
-
|
| 72 |
-
// Email inputs
|
| 73 |
-
document.getElementById('email-input').addEventListener('input',
|
| 74 |
-
this.debounce(() => this.autoGenerate(), 500));
|
| 75 |
-
document.getElementById('email-subject').addEventListener('input',
|
| 76 |
-
this.debounce(() => this.autoGenerate(), 500));
|
| 77 |
-
document.getElementById('email-body').addEventListener('input',
|
| 78 |
-
this.debounce(() => this.autoGenerate(), 500));
|
| 79 |
-
|
| 80 |
-
// Phone input
|
| 81 |
-
document.getElementById('phone-input').addEventListener('input',
|
| 82 |
-
this.debounce(() => this.autoGenerate(), 500));
|
| 83 |
-
|
| 84 |
-
// WiFi inputs
|
| 85 |
-
document.getElementById('wifi-ssid').addEventListener('input',
|
| 86 |
-
this.debounce(() => this.autoGenerate(), 500));
|
| 87 |
-
document.getElementById('wifi-password').addEventListener('input',
|
| 88 |
-
this.debounce(() => this.autoGenerate(), 500));
|
| 89 |
-
document.getElementById('wifi-security').addEventListener('change',
|
| 90 |
-
() => this.autoGenerate());
|
| 91 |
-
document.getElementById('wifi-hidden').addEventListener('change',
|
| 92 |
-
() => this.autoGenerate());
|
| 93 |
-
|
| 94 |
-
// SMS inputs
|
| 95 |
-
document.getElementById('sms-number').addEventListener('input',
|
| 96 |
-
this.debounce(() => this.autoGenerate(), 500));
|
| 97 |
-
document.getElementById('sms-message').addEventListener('input',
|
| 98 |
-
this.debounce(() => this.autoGenerate(), 500));
|
| 99 |
}
|
| 100 |
|
| 101 |
setActiveTab(type) {
|
|
|
|
| 45 |
// Real-time input changes
|
| 46 |
this.bindInputEvents();
|
| 47 |
|
| 48 |
+
// Color changes - removed auto-generation
|
| 49 |
+
// Users need to click "Generate QR Code" to apply color changes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
}
|
| 51 |
|
| 52 |
bindInputEvents() {
|
| 53 |
+
// Removed auto-generation on input
|
| 54 |
+
// Users now need to click "Generate QR Code" button to create QR codes
|
| 55 |
+
// This prevents unnecessary API calls while typing and gives users more control
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
}
|
| 57 |
|
| 58 |
setActiveTab(type) {
|