Subbu1304 commited on
Commit
7216778
·
verified ·
1 Parent(s): 81cc16d

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +7 -1
templates/index.html CHANGED
@@ -139,6 +139,8 @@
139
 
140
  <script>
141
  let recognition;
 
 
142
  if ('webkitSpeechRecognition' in window) {
143
  recognition = new webkitSpeechRecognition();
144
  recognition.continuous = false;
@@ -194,13 +196,16 @@
194
  let loginEmail = event.results[0][0].transcript.trim();
195
  document.getElementById('loginEmail').value = loginEmail;
196
  recognition.stop();
 
 
 
197
  speak("You said " + loginEmail + ". Is it correct?", function() {
198
  recognition.start();
199
  recognition.onresult = function(event) {
200
  let confirmation = event.results[0][0].transcript.trim().toLowerCase();
201
  recognition.stop();
202
  if (confirmation.includes("ok") || confirmation.includes("yes")) {
203
- startListeningForMobileLogin();
204
  } else {
205
  speak("Let's try again. Please tell your email.", startListeningForLogin);
206
  }
@@ -335,3 +340,4 @@
335
  </script>
336
  </body>
337
  </html>
 
 
139
 
140
  <script>
141
  let recognition;
142
+ let emailCaptured = "";
143
+ let mobileCaptured = "";
144
  if ('webkitSpeechRecognition' in window) {
145
  recognition = new webkitSpeechRecognition();
146
  recognition.continuous = false;
 
196
  let loginEmail = event.results[0][0].transcript.trim();
197
  document.getElementById('loginEmail').value = loginEmail;
198
  recognition.stop();
199
+ loginEmail = loginEmail.replace(/\bat\b/g, "@").replace(/\s+/g, ''); // Fix "at" to "@"
200
+ document.getElementById('loginEmail').value = loginEmail;
201
+
202
  speak("You said " + loginEmail + ". Is it correct?", function() {
203
  recognition.start();
204
  recognition.onresult = function(event) {
205
  let confirmation = event.results[0][0].transcript.trim().toLowerCase();
206
  recognition.stop();
207
  if (confirmation.includes("ok") || confirmation.includes("yes")) {
208
+ startListeningForMobileLogin(); // Move to mobile number
209
  } else {
210
  speak("Let's try again. Please tell your email.", startListeningForLogin);
211
  }
 
340
  </script>
341
  </body>
342
  </html>
343
+