lokesh341 commited on
Commit
0a1b877
·
verified ·
1 Parent(s): 4e9c3dd

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +0 -74
templates/index.html CHANGED
@@ -271,11 +271,9 @@
271
  const name = document.getElementById('name').value;
272
  const email = document.getElementById('email').value;
273
  const phone = document.getElementById('mobile').value;
274
-
275
  document.getElementById('confirmName').textContent = name;
276
  document.getElementById('confirmEmail').textContent = email;
277
  document.getElementById('confirmPhone').textContent = phone;
278
-
279
  // Automatically submit the details after a delay
280
  setTimeout(submitRegistration, 6000); // 6 seconds delay
281
  }
@@ -284,7 +282,6 @@
284
  const name = document.getElementById('name').value;
285
  const email = document.getElementById('email').value;
286
  const phone = document.getElementById('mobile').value;
287
-
288
  // Simulate submission to Salesforce
289
  fetch('/submit', {
290
  method: 'POST',
@@ -296,7 +293,6 @@
296
  if (data.success) {
297
  document.getElementById('statusText').textContent = `Thank you for registering, ${name}!`;
298
  document.getElementById('statusMessage').style.display = 'block';
299
-
300
  // Show 'Submitted Successfully' after 6 seconds, then refresh the page after 5 seconds
301
  setTimeout(() => {
302
  document.getElementById('statusText').textContent = 'Submitted Successfully!';
@@ -315,76 +311,6 @@
315
  });
316
  }
317
 
318
- function captureLoginDetails() {
319
- speak("Please say your email for login.", function () {
320
- recognition.start();
321
- recognition.onresult = function (event) {
322
- let emailCaptured = event.results[0][0].transcript.trim().replace(/\bat\b/g, '@').replace(/\s+/g, '');
323
- document.getElementById('loginEmail').value = emailCaptured;
324
- recognition.stop();
325
- speak("You said " + emailCaptured + ". Is it correct?", function () {
326
- confirmLoginEmail(emailCaptured);
327
- });
328
- };
329
- });
330
- }
331
-
332
- function confirmLoginEmail(emailCaptured) {
333
- recognition.start();
334
- recognition.onresult = function (event) {
335
- let confirmation = event.results[0][0].transcript.trim().toLowerCase();
336
- recognition.stop();
337
- if (confirmation.includes("yes") || confirmation.includes("ok")) {
338
- captureLoginMobile();
339
- } else {
340
- captureLoginDetails();
341
- }
342
- };
343
- }
344
-
345
- function captureLoginMobile() {
346
- speak("Now, say your mobile number.", function () {
347
- recognition.start();
348
- recognition.onresult = function (event) {
349
- let mobileCaptured = event.results[0][0].transcript.trim().replace(/\s+/g, '');
350
- document.getElementById('loginMobile').value = mobileCaptured;
351
- recognition.stop();
352
- speak("You said " + mobileCaptured + ". Is it correct?", function () {
353
- confirmLoginMobile(mobileCaptured);
354
- });
355
- };
356
- });
357
- }
358
-
359
- function confirmLoginMobile(mobileCaptured) {
360
- recognition.start();
361
- recognition.onresult = function (event) {
362
- let confirmation = event.results[0][0].transcript.trim().toLowerCase();
363
- recognition.stop();
364
- if (confirmation.includes("yes") || confirmation.includes("ok")) {
365
- submitLogin();
366
- } else {
367
- captureLoginMobile();
368
- }
369
- };
370
- }
371
-
372
- function submitLogin() {
373
- const loginEmail = document.getElementById('loginEmail').value;
374
- const loginMobile = document.getElementById('loginMobile').value;
375
-
376
- // Simulate login check
377
- if (loginEmail && loginMobile) {
378
- document.getElementById('statusText').textContent = 'Login successful! Redirecting...';
379
- document.getElementById('statusMessage').style.display = 'block';
380
- setTimeout(() => {
381
- window.location.href = '/dashboard'; // Redirect to dashboard
382
- }, 3000);
383
- } else {
384
- speak("Please enter valid login details.");
385
- }
386
- }
387
-
388
  window.onload = function () {
389
  askLoginOrRegister();
390
  };
 
271
  const name = document.getElementById('name').value;
272
  const email = document.getElementById('email').value;
273
  const phone = document.getElementById('mobile').value;
 
274
  document.getElementById('confirmName').textContent = name;
275
  document.getElementById('confirmEmail').textContent = email;
276
  document.getElementById('confirmPhone').textContent = phone;
 
277
  // Automatically submit the details after a delay
278
  setTimeout(submitRegistration, 6000); // 6 seconds delay
279
  }
 
282
  const name = document.getElementById('name').value;
283
  const email = document.getElementById('email').value;
284
  const phone = document.getElementById('mobile').value;
 
285
  // Simulate submission to Salesforce
286
  fetch('/submit', {
287
  method: 'POST',
 
293
  if (data.success) {
294
  document.getElementById('statusText').textContent = `Thank you for registering, ${name}!`;
295
  document.getElementById('statusMessage').style.display = 'block';
 
296
  // Show 'Submitted Successfully' after 6 seconds, then refresh the page after 5 seconds
297
  setTimeout(() => {
298
  document.getElementById('statusText').textContent = 'Submitted Successfully!';
 
311
  });
312
  }
313
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
314
  window.onload = function () {
315
  askLoginOrRegister();
316
  };