From d6a68e49c9dec8c5fd573a4ac3ce15b0cce250db Mon Sep 17 00:00:00 2001 From: Gabriel Cerdio Date: Fri, 6 Dec 2024 23:02:34 -0600 Subject: [PATCH] Update RSVP form in index.html for improved user experience; change confirmation message to Spanish and adjust form submission handling in scripts.js and scripts.min.js to use an iframe for better response management. --- index.html | 37 +++++++--------------- js/scripts.js | 11 +------ js/scripts.min.js | 80 ++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 91 insertions(+), 37 deletions(-) diff --git a/index.html b/index.html index e9b1f80af..c4a315182 100755 --- a/index.html +++ b/index.html @@ -391,9 +391,8 @@
Mr. Amit Roy
-

Thank you!

-

We are glad to see you join us on our big day.

-
+

¡Gracias!

+

Hemos recibido tu confirmación correctamente.

@@ -405,47 +404,33 @@

Thank you!

¿Qué estás esperando?

Agradeceríamos mucho si pudieras confirmar tu asistencia antes del 1 de mayo de 2025

-
+
- + +
- + +
-
-
- -
-
-
+
- + +
- diff --git a/js/scripts.js b/js/scripts.js index df228763c..0426cd5c2 100755 --- a/js/scripts.js +++ b/js/scripts.js @@ -1,10 +1 @@ -function initDarkMode() { - // La función se eliminará por completo -} - -// Cambiar const por var para compatibilidad -var darkMapStyle = [ - // El array se eliminará -]; - -var lightMapStyle = []; // Estilo por defecto del mapa \ No newline at end of file +var lightMapStyle = []; // Mantener solo el estilo por defecto del mapa \ No newline at end of file diff --git a/js/scripts.min.js b/js/scripts.min.js index 1edc42607..797c74c5f 100755 --- a/js/scripts.min.js +++ b/js/scripts.min.js @@ -1 +1,79 @@ -function initDarkMode(){}var darkMapStyle=[],lightMapStyle=[];function startCountdown(){var i=new Date("May 30, 2025 10:00:00").getTime(),s=setInterval(function(){var e=(new Date).getTime(),t=i-e,a=Math.floor(t/864e5),n=Math.floor(t%864e5/36e5),o=Math.floor(t%36e5/6e4),r=Math.floor(t%6e4/1e3);document.getElementById("days").innerHTML=a,document.getElementById("hours").innerHTML=n,document.getElementById("minutes").innerHTML=o,document.getElementById("seconds").innerHTML=r,t<0&&(clearInterval(s),document.getElementById("countdown-timer").innerHTML="Happening Now!")},1e3)}function initMap(){var e={lat:18.979305555555555,lng:-98.23883333333333},t=new google.maps.Map(document.getElementById("map-canvas"),{zoom:15,center:e,scrollwheel:!1});new google.maps.Marker({position:e,map:t,title:"Salon Jardín Ex Hacienda San Bartolo"})}$(document).ready(function(){$(".wp1").waypoint(function(){$(".wp1").addClass("animated fadeInLeft")},{offset:"75%"}),$(".wp2").waypoint(function(){$(".wp2").addClass("animated fadeInRight")},{offset:"75%"}),$(".wp3").waypoint(function(){$(".wp3").addClass("animated fadeInLeft")},{offset:"75%"}),$(".wp4").waypoint(function(){$(".wp4").addClass("animated fadeInRight")},{offset:"75%"}),$(".wp5").waypoint(function(){$(".wp5").addClass("animated fadeInLeft")},{offset:"75%"}),$(".wp6").waypoint(function(){$(".wp6").addClass("animated fadeInRight")},{offset:"75%"}),$(".wp7").waypoint(function(){$(".wp7").addClass("animated fadeInUp")},{offset:"75%"}),$(".wp8").waypoint(function(){$(".wp8").addClass("animated fadeInLeft")},{offset:"75%"}),$(".wp9").waypoint(function(){$(".wp9").addClass("animated fadeInRight")},{offset:"75%"}),$(".flexslider").flexslider({animation:"slide"}),$(".single_image").fancybox({padding:4}),$(".fancybox").fancybox({padding:4,width:1e3,height:800}),$('[data-toggle="tooltip"]').tooltip(),$(".nav-toggle").click(function(){$(this).toggleClass("active"),$(".header-nav").toggleClass("open"),event.preventDefault()}),$(".header-nav li a").click(function(){$(".nav-toggle").toggleClass("active"),$(".header-nav").toggleClass("open")}),$(function(){$(window).scroll(function(){20<=$(window).scrollTop()?($("section.navigation").addClass("fixed"),$("header").css({"border-bottom":"none",padding:"35px 0"}),$("header .member-actions").css({top:"26px"}),$("header .navicon").css({top:"34px"})):($("section.navigation").removeClass("fixed"),$("header").css({"border-bottom":"solid 1px rgba(255, 255, 255, 0.2)",padding:"50px 0"}),$("header .member-actions").css({top:"41px"}),$("header .navicon").css({top:"48px"}))})}),$(function(){$("a[href*=#]:not([href=#])").click(function(){if(location.pathname.replace(/^\//,"")===this.pathname.replace(/^\//,"")&&location.hostname===this.hostname){var e=$(this.hash);if((e=e.length?e:$("[name="+this.hash.slice(1)+"]")).length)return $("html,body").animate({scrollTop:e.offset().top-90},2e3),!1}})});var e=document.getElementsByClassName("share-bar"),t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src="https://apis.google.com/js/platform.js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(t,a);for(var n=0;n
';e[n].innerHTML=o,e[n].style.display="inline-block"}$(".player").YTPlayer(),$("#btn-show-map").click(function(){$("#map-content").toggleClass("toggle-map-content"),$("#btn-show-content").toggleClass("toggle-map-content")}),$("#btn-show-content").click(function(){$("#map-content").toggleClass("toggle-map-content"),$("#btn-show-content").toggleClass("toggle-map-content")});var r=createCalendar({options:{class:"",id:""},data:{title:"Ram and Antara's Wedding",start:new Date("Nov 27, 2017 10:00"),end:new Date("Nov 29, 2017 00:00"),address:"ITC Fortune Park Hotel, Kolkata",description:"We can't wait to see you on our big day. For any queries or issues, please contact Mr. Amit Roy at +91 9876543210."}});$("#add-to-cal").html(r),$("#rsvp-form").on("submit",function(e){e.preventDefault();var t=$(this).serialize();$("#alert-wrapper").html(alert_markup("info","Just a sec! We are saving your details.")),"b0e53b10c1f55ede516b240036b88f40"!==MD5($("#invite_code").val())&&"2ac7f43695eb0479d5846bb38eec59cc"!==MD5($("#invite_code").val())?$("#alert-wrapper").html(alert_markup("danger","Sorry! Your invite code is incorrect.")):$.post("https://script.google.com/macros/s/AKfycby9o7iY3gqTvM98mIuDaeT391I1kcrtaMuhf_PSJl6Pwz5ilMfSw1wROnJChPoSVAzDJA/exec",t).done(function(e){console.log(e),"error"===e.result?$("#alert-wrapper").html(alert_markup("danger",e.message)):($("#alert-wrapper").html(""),$("#rsvp-modal").modal("show"))}).fail(function(e){console.log(e),$("#alert-wrapper").html(alert_markup("danger","Sorry! There is some issue with the server. "))})})}),window.onload=function(){startCountdown()};var marker=new google.maps.Marker({position:location,map:map});function initMap(){var e={lat:18.979305555555555,lng:-98.23883333333333},t=new google.maps.Map(document.getElementById("map-canvas"),{zoom:15,center:e,scrollwheel:!1});new google.maps.Marker({position:e,map:t,title:"Salon Jardín Ex Hacienda San Bartolo"})}function alert_markup(e,t){return''}var MD5=function(e){function l(e,t){return e<>>32-t}function c(e,t){var a,n,o,r,i;return o=2147483648&e,r=2147483648&t,i=(1073741823&e)+(1073741823&t),(a=1073741824&e)&(n=1073741824&t)?2147483648^i^o^r:a|n?1073741824&i?3221225472^i^o^r:1073741824^i^o^r:i^o^r}function t(e,t,a,n,o,r,i){var s;return e=c(e,c(c((s=t)&a|~s&n,o),i)),c(l(e,r),t)}function a(e,t,a,n,o,r,i){var s;return e=c(e,c(c(t&(s=n)|a&~s,o),i)),c(l(e,r),t)}function n(e,t,a,n,o,r,i){return e=c(e,c(c(t^a^n,o),i)),c(l(e,r),t)}function o(e,t,a,n,o,r,i){return e=c(e,c(c(a^(t|~n),o),i)),c(l(e,r),t)}function r(e){var t,a="",n="";for(t=0;t<=3;t++)a+=(n="0"+(e>>>8*t&255).toString(16)).substr(n.length-2,2);return a}var i,s,d,p,m,f,g,u,h,w=Array();for(w=function(e){for(var t,a=e.length,n=a+8,o=16*(1+(n-n%64)/64),r=Array(o-1),i=0,s=0;s>>29,r}(e=function(e){e=e.replace(/\r\n/g,"\n");for(var t="",a=0;a>6|192):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128)),t+=String.fromCharCode(63&n|128))}return t}(e)),f=1732584193,g=4023233417,u=2562383102,h=271733878,i=0;i
';e[n].innerHTML=o,e[n].style.display="inline-block"}$(".player").YTPlayer(),$("#btn-show-map").click(function(){$("#map-content").toggleClass("toggle-map-content"),$("#btn-show-content").toggleClass("toggle-map-content")}),$("#btn-show-content").click(function(){$("#map-content").toggleClass("toggle-map-content"),$("#btn-show-content").toggleClass("toggle-map-content")});var r=createCalendar({options:{class:"",id:""},data:{title:"Ram and Antara's Wedding",start:new Date("Nov 27, 2017 10:00"),end:new Date("Nov 29, 2017 00:00"),address:"ITC Fortune Park Hotel, Kolkata",description:"We can't wait to see you on our big day. For any queries or issues, please contact Mr. Amit Roy at +91 9876543210."}});$("#add-to-cal").html(r),$("#rsvp-form").on("submit", function(e) { + e.preventDefault(); + var form = $(this); + + // Mostrar mensaje de carga + $("#alert-wrapper").html(alert_markup("info", "Un momento! Estamos guardando tu confirmación.")); + + // Obtener los datos del formulario + var formData = new FormData(form[0]); + + // Crear un iframe temporal con un ID único + var iframeId = 'response-frame-' + Date.now(); + var iframe = document.createElement('iframe'); + iframe.style.display = 'none'; + iframe.id = iframeId; + iframe.name = iframeId; + document.body.appendChild(iframe); + + // Configurar el formulario + form.attr('target', iframeId); + form.attr('action', 'https://script.google.com/macros/s/AKfycby9o7iY3gqTvM98mIuDaeT391I1kcrtaMuhf_PSJl6Pwz5ilMfSw1wROnJChPoSVAzDJA/exec'); + + // Manejar la respuesta + setTimeout(function() { + // Mostrar modal de éxito + $("#alert-wrapper").html(""); + $("#rsvp-modal").modal("show"); + + // Limpiar el formulario + form[0].reset(); + + // Restaurar el formulario + form.removeAttr('target'); + form.removeAttr('action'); + + // Eliminar el iframe + if (document.getElementById(iframeId)) { + document.body.removeChild(iframe); + } + }, 2000); + + // Enviar el formulario + try { + form[0].submit(); + } catch (error) { + console.error('Error al enviar el formulario:', error); + $("#alert-wrapper").html(alert_markup("danger", "Error No se pudo enviar el formulario. Por favor, intenta de nuevo.")); + if (document.getElementById(iframeId)) { + document.body.removeChild(iframe); + } + } +}); + +function alert_markup(alert_type, msg) { + return ''; +} + +window.onload = function() { + startCountdown(); +}; + +let location = {lat: 18.979305555555555, lng: -98.23883333333333}; + +function initMap() { + const mapOptions = { + zoom: 15, + center: location, + scrollwheel: false + }; + + const map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); + + new google.maps.Marker({ + position: location, + map: map, + title: "Salón Jardín Ex Hacienda San Bartolo" + });