PageSourceSearch

https://nupciasmagazine.com/wp-content/themes/np2020/js/modales.js?ver=1.0.0.410

js nupciasmagazine.com collected 2026-10-02 11:09:01 UTC 10,342 bytes, 267 lines download raw bytes

1//Functionality JS: Carrera, José Aurelio  [email protected]
2$(".modalme").hide();
3$(".backmodal").hide();
4$(".backload").hide();
5$(".backtoast").hide();
6$(".activepop").on("click",function(){
7  $(".modalme").fadeOut(300);
8  $("#mb-"+ $(this).attr("id")).show();
9  $(".backmodal").show();
10  $("body").css({ overflowY: "hidden" });
11  $(".alerta").css({ position: "fixed" });
12});
13
14$("#popgeneric").on("click",function(){
15  $(".youtube-video")[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
16  $(".youtube-video2")[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
17  $(".youtube-video3")[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
18  $(".youtube-video4")[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
19  $(".youtube-video5")[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
20
21  $(".carousel-destino1")[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
22  $(".carousel-destino2")[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
23  $(".carousel-destino3")[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
24  $(".carousel-destino4")[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
25  $(".carousel-destino5")[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
26
27
28});
29
30$("#videoestado").on("click",function(){
31  $(".youtube-video-edo")[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*')
32});
33
34$("#videoruta1").on("click",function(){
35  $(".youtube-video")[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
36});
37
38$("#videoruta2").on("click",function(){
39  $(".youtube-video2")[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
40});
41
42$("#videoruta3").on("click",function(){
43  $(".youtube-video3")[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
44});
45
46$("#videoruta4").on("click",function(){
47  $(".youtube-video4")[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
48});
49
50$("#videoruta5").on("click",function(){
51  $(".youtube-video5")[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
52});
53
54
55
56
57$("#videocarouseldestino1").on("click",function(){
58  $(".carousel-destino1")[06].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
59});
60
61$("#videocarouseldestino2").on("click",function(){
62  $(".carousel-destino2")[07].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
63});
64
65$("#videocarouseldestino3").on("click",function(){
66  $(".carousel-destino3")[08].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
67});
68
69$("#videocarouseldestino4").on("click",function(){
70  $(".carousel-destino4")[09].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
71});
72
73$("#videocarouseldestino5").on("click",function(){
74  $(".carousel-destino5")[00].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
75});
76
77
78
79
80
81
82
83
84
85$(".cerrar").on("click",function(){
86  $(".modalme").fadeOut(300);
87  $(".backmodal").fadeOut(300);
88  $("body").css({ overflowY: "auto" });
89  $(".carousel-destino1")[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');
90  $(".carousel-destino2")[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');
91  $(".carousel-destino3")[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');
92  $(".carousel-destino4")[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');
93  $(".carousel-destino5")[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');
94  $(".youtube-video")[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');
95  $(".youtube-video2")[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');
96  $(".youtube-video3")[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');
97  $(".youtube-video4")[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');
98  $(".youtube-video5")[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');
99  $(".youtube-video-edo")[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');
100  jQuery('.youtube_player').each(function( index ){
101    thisPlayer = jQuery('.youtube_player')[index];
102    thisPlayer.contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');
103});
104
105});
106
107
108var tag = document.createElement('script');
109tag.src = "https://www.youtube.com/iframe_api";
110var firstScriptTag = document.getElementsByTagName('script')[0];
111firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
112
113console.log(firstScriptTag);
114console.log(tag);
115
116
117// function onYouTubeIframeAPIReady() {
118//   player = new YT.Player('iframe-id', {
119//     videoId: 'video-id',
120//     events: {
121//       'onReady': onPlayerReady,
122//       'onStateChange': onPlayerStateChange
123//     }
124//   });
125// }
126
127
128
129
130// $( ".modalme" ).draggable({
131//   revert: 'invalid',
132//   cursor: 'move',
133//   axis: "y",
134//   scroll: false,
135//   start: function(event, ui) {
136//     initialPos = ui.position.top;
137//     $(this).addClass("Yaxis");
138//   	$(".modalme").data({'originalLeft': $(".modalme").css('left'),
139//     'origionalTop': $(".modalme").css('top'),
140//     });
141//   },
142//   drag: function(event, ui) {
143//       $(".modalme" ).draggable({axis: "y" });
144//       $(".modalme").css({"position": "fixed"});
145//       $("body").css({ overflowY: "auto" });
146//     var pos = ui.position;
147//         if (pos.top > initialPos + 100 && $(this).is(".Yaxis")) {
148//             $(this).removeClass("Yaxis");
149//             $(this).draggable('option', 'axis', false);
150//             $(".modalme").fadeOut(300);
151//             $(".backmodal").fadeOut(300);
152//             setTimeout(function(){
153//               $(".modalme").css({'left': $(".modalme").data('originalLeft'),
154//                'top': $(".modalme").data('origionalTop')
155//             });
156//             }, 301);  
157//         }
158//   },
159//   stop: function() {
160//     $(this).draggable('option', 'axis', "y");
161//     }
162// });
163// $("#botonload").on("click",function(){
164//   $(".loading").css({"display": "block"});
165//   $(".backload").show();
166//   $("body").css({ overflowY: "hidden" });
167// });
168// $(".loading").on("click",function(){
169//   $(".loading").css({"display": "none"});
170//   $(".backload").hide();
171//   $("body").css({ overflowY: "auto" });
172// });
173
174//Ripple botón
175// var addRippleEffect = function (e) {
176  
177//   var target = e.target.style = 'botonerasmodal';
178//     // var target = e.target;
179//     if (target.tagName !== 'div') return false;
180//     var rect = target.getBoundingClientRect();
181//     var ripple = target.querySelector('.ripple');
182//     if (!ripple) {
183//         ripple = document.createElement('span');
184//         ripple.className = 'ripple';
185//         ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + 'px';
186//         target.appendChild(ripple);
187//     }
188//     ripple.classList.remove('show');
189//     var top = e.pageY - rect.top - ripple.offsetHeight / 2 - document.body.scrollTop;
190//     var left = e.pageX - rect.left - ripple.offsetWidth / 2 - document.body.scrollLeft;
191//     ripple.style.top = top + 'px';
192//     ripple.style.left = left + 'px';
193//     ripple.classList.add('show');
194//     return false;
195// }
196
197
198// document.addEventListener('click', addRippleEffect, false);
199
200$(".activetoastsoundfp").on("click",function(){
201  // $('audio#pop')[0].play()
202  $(".toast").fadeOut(500);
203  $("#ts-"+ $(this).attr("id")).show();
204  $(".backmodal").show();
205  $("body").css({ overflowY: "hidden" });
206  $(".alerta").css({ position: "fixed" });
207
208  setTimeout(function() {
209  $(".toast").fadeOut(200);
210  $(".backmodal").fadeOut(300);
211  $("body").css({ overflowY: "auto" });
212  }, 1500);
213});
214
215
216// Verifica el parámetro en la URL
217  // Funciones de cookies
218  
219  function setCookie(name, value, days) {
220    let date = new Date();
221    date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
222    let expires = "expires=" + date.toUTCString();
223    document.cookie = name + "=" + value + ";" + expires + ";path=/";
224}
225
226function getCookie(name) {
227    let decodedCookies = decodeURIComponent(document.cookie);
228    let cookiesArray = decodedCookies.split(';');
229    for (let i = 0; i < cookiesArray.length; i++) {
230        let cookie = cookiesArray[i].trim();
231        if (cookie.indexOf(name + "=") === 0) {
232            return cookie.substring(name.length + 1);
233        }
234    }
235    return "";
236}
237
238// Función para abrir el modal de newsletter
239function openModal(){
240    $(".modalme").fadeOut(300);
241    $("#mb-newsletter").fadeIn(300);
242    $(".backmodal").show();
243    $("body").css({ overflowY: "hidden" });
244}
245
246// Al cargar la página
247window.addEventListener('load', () => {
248    const params = new URLSearchParams(window.location.search);
249    if (params.has('opennews')) {
250        // Si la URL tiene el parámetro, se abre siempre el modal, sin importar la cookie.
251        openModal();
252        // Opcional: puedes actualizar o establecer la cookie, 
253        // en caso de que la lógica para apertura automática en ausencia del parámetro la necesite.
254        setCookie("openNewsModal", "true", 5);
255    } else {
256        // Si no hay parámetro en la URL, se abre de forma automática solo si la cookie no existe.
257        if (!getCookie("openNewsModal")) { 
258            setTimeout(() => {
259                openModal();
260                setCookie("openNewsModal", "true", 5);
261            }, 500);
262        }
263    }
264});
265
266
267

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.