1/*Slider*/ 2$(function () { 3 $('#orgulloUCA').carousel({ 4 interval:false, 5 pause: "true" 6 }); 7 8 $('#banner , #orgulloUCA').carousel({ 9 interval:6000, 10 pause: "false" 11 }); 12 13 $('.ant').click(function () { 14 $('#banner').carousel('prev'); 15 }); 16 $('.sig').click(function () { 17 $('#banner').carousel('next'); 18 }); 19 $('#banner').hover(function(){ 20 $('#banner').carousel('pause'); 21 }, function(){ 22 $('#banner').carousel('cycle'); 23 }); 24 25 $('.antt').click(function () { 26 $('#orgulloUCA').carousel('prev'); 27 }); 28 $('.sigt').click(function () { 29 $('#orgulloUCA').carousel('next'); 30 }); 31 $('#orgulloUCA').hover(function(){ 32 $('#orgulloUCA').carousel('pause'); 33 }, function(){ 34 $('#orgulloUCA').carousel('cycle'); 35 }); 36}); 37 38/*tabs*/ 39 40$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { 41 e.target // newly activated tab 42 e.relatedTarget // previous active tab 43}); 44var url = document.location.toString(); 45if (url.match('#msj')) { 46 $('.nav-tabs a[href="#' + url.split('#')[1] + '"]').tab('show'); 47} 48/* script importante 49$('.nav-tabs a').on('shown.bs.tab', function (e) { 50 window.location.hash = e.target.hash; 51})*/ 52 53function openNav() { 54 document.getElementById("mySidenav").style.width = "250px"; 55 document.getElementById("main").style.marginRight = "0"; // Dejar en 0/250 si para no mover contenido 56 /*document.body.style.backgroundColor = "rgba(0,0,0,0.4)";*/ 57} 58 59function closeNav() { 60 document.getElementById("mySidenav").style.width = "0"; 61 document.getElementById("main").style.marginRight= "0"; 62 /*document.body.style.backgroundColor = "white";*/ 63} 64 65/*$('.responsive-tabs').responsiveTabs({ 66 accordionOn: ['xs', 'sm'] // xs, sm, md, lg 67});*/ 68$(function () { 69 $('[data-toggle="tooltip"]').tooltip() 70}); 71 72 73$(document).ready(function () { 74 validator = $("#Form_NuevoIngresoAdmision").validate({ 75 ignore: ".ignore", 76 rules: { 77 "nombre": { 78 required: true, 79 minlength: 2 80 }, 81 "correo": { 82 required: true, 83 email: true 84 }, 85 "mensaje": { 86 required: true, 87 minlength: 10 88 }, 89 "hiddenRecaptcha": { 90 required: function() { 91 if(grecaptcha.getResponse() == '') { 92 return true; 93 } else { 94 return false; 95 } 96 } 97 } 98 }, 99 messages: { 100 "nombre": { 101 required: "Por favor, ingrese un nombre", 102 minlength: "Nombre demasiado corto, digite su nombre completo" 103 }, 104 "correo": { 105 required: "Por favor, ingrese un correo electrónico", 106 email: "El correo electrónico es invalido" 107 }, 108 "mensaje": { 109 required: "Por favor, ingrese su duda", 110 minlength: "Su mensaje es demasiado corto" 111 }, 112 "hiddenRecaptcha": { 113 required: "Por favor seleccione la casilla de verificación", 114 } 115 }, 116 submitHandler: function (form) { 117 var url = "/wp-content/themes/kubo/core/solicitud.php"; 118 $.ajax({
119 type: "POST", 120 url: url, 121 cache: false, 122 data: $(form).serialize(), 123 success: function(data){ 124 $('#Form_NuevoIngresoAdmision')[0].reset(); 125 validator.resetForm(); 126 grecaptcha.reset(); 127 $("#respuesta-msj").html(data).fadeIn(); 128 $("#respuesta-msj").html(data).fadeOut(10000); 129 } 130 }); 131 return false; 132 } 133 }); 134 135 136 137 $("#Form_OfertaAcademica").validate({ 138 rules: { 139 "asunto": { 140 required: true, 141 }, 142 "nombre": { 143 required: true, 144 minlength: 2 145 }, 146 "correo": { 147 required: true, 148 email: true 149 }, 150 "mensaje": { 151 required: true, 152 minlength: 10 153 } 154 }, 155 messages: { 156 "asunto": { 157 required: "Seleccione aquién dirigir su duda", 158 }, 159 "nombre": { 160 required: "Por favor, ingrese un nombre", 161 minlength: "Nombre demasiado corto, digite su nombre completo" 162 }, 163 "correo": { 164 required: "Por favor, ingrese un correo electrónico", 165 email: "El correo electrónico es invalido" 166 }, 167 "mensaje": { 168 required: "Por favor, ingrese su duda", 169 minlength: "Su mensaje es demasiado corto" 170 } 171 }, 172 submitHandler: function (form) { // for demo 173 //Enviando formulario 174 //var url = "/2017/uca/wp-content/themes/kubo/core/solicitud.php"; // El script a dónde se realizará la petición. 175 var url = "/wp-content/themes/kubo/core/solicitud.php"; // El script a dónde se realizará la petición. 176 $.ajax({
177 type: "POST", 178 url: url, 179 cache: false, 180 data: $(form).serialize(), // Adjuntar los campos del formulario enviado. 181 success: function(data) 182 { 183 $("#respuesta-msj").html(data).fadeIn(); // Mostrar la respuestas del script PHP. 184 $("#respuesta-msj").html(data).fadeOut(10000); 185 } 186 }); 187 188 return false; // Evitar ejecutar el submit del formulario. 189 190 191 } 192 }); 193 194 195 196 197}); 198 199 200$(document).ready(function() { 201 function menu_(){ 202 h = window.innerHeight ? window.innerHeight : $(window).height(); 203 w = window.innerWidth ? window.innerWidth : $(window).width(); 204 /*if(w<=1199){ 205 $( "#menu-menu-1" ).removeClass( "navbar-nav navbar-right" ).addClass( "nav-justified" ); 206 $( "#menu-uca" ).addClass( "no-margin" ); 207 }else{ 208 $( "#menu-menu-1" ).removeClass( "nav-justified" ).addClass( "navbar-nav navbar-right" ); 209 $( "#menu-uca" ).removeClass( "no-margin" ); 210 }*/ 211 212 if(w>=768 && w<=1199){ 213 $( "#menu-menu-1" ).removeClass( "navbar-right" ); 214 $( "#menu-uca" ).addClass( "no-margin" ); 215 $('#movil-menu-activo').removeClass( "container" ).addClass( "container-fluid" ); 216 $( "#menu-menu-1" ).addClass( "nav_m" ); 217 }else if(w>=200 && w<=767){ 218 $( "#menu-uca" ).removeClass( "no-padding" ); 219 $( "#collapse1" ).removeClass( "in"); 220 221 }else{ 222 $( "#menu-menu-1" ).addClass( "navbar-right" ); 223 $('#movil-menu-activo').removeClass( "container-fluid" ).addClass( "container" ); 224 $( "#menu-uca" ).removeClass( "no-margin" ); 225 $( "#menu-uca" ).addClass( "no-padding" ); 226 $( "#menu-menu-1" ).removeClass( "nav_m" ); 227 228 } 229 230 231 232 } 233 $(window).resize(function() { 234 menu_(); 235 }); 236 menu_(); 237 238 239//Menú 240 241// Add slideDown animation to Bootstrap dropdown when expanding. 242 $('.dropdown').on('show.bs.dropdown', function() { 243 $(this).find('.dropdown-menu').first().stop(true, true).slideDown(); 244 }); 245 246 // Add slideUp animation to Bootstrap dropdown when collapsing. 247 $('.dropdown').on('hide.bs.dropdown', function() { 248 $(this).find('.dropdown-menu').first().stop(true, true).slideUp(); 249 }); 250 251 252}); 253 254 255$(document).ready(function() { 256 257$("#menuGeneralUCA").click(function(){ 258 $(this).next(".menuGeneral").toggle(500); 259 $(this).toggleClass("active"); 260}); 261 262}) 263 264 265$(document).ready(function() { 266 $('.btn-suscribete').on('click',function(){ 267 $('#cpanel-suscribete').toggle(1000); 268 $(' .grecaptcha-badge').css({'display':'none'} ); 269 $('.btn-suscribete').css({'background-color':'#DE7C31','color':'#ffffff'} ); 270 if( $('#cpanel-suscribete').is(':visible') && $('#cpanel-suscribete').css("visibility") != "hidden" 271 && $('#cpanel-suscribete').css("opacity") > 0 ){ 272 $(".btn-suscribete").removeAttr("style"); 273 274 } 275 }); 276 277}); 278 279/*function onSubmit() { 280 //document.getElementById("form-suscripcion").submit(); 281 282 283//code prueba 284 $("#form-suscripcion").validate({ 285 rules: { 286 "correo": { 287 required: true, 288 email: true 289 } 290 }, 291 messages: { 292 "correo": { 293 required: "Por favor, ingrese un correo electrónico", 294 email: "El correo electrónico es invalido" 295 } 296 }, 297 submitHandler: function (form) { // for demo 298 //Enviando formulario 299 var url = "/2017/uca/wp-content/themes/kubo/core/solicitud.php"; // El script a dónde se realizará la petición. 300 $.ajax({
301 type: "POST", 302 url: url, 303 cache: false, 304 data: $(form).serialize(), // Adjuntar los campos del formulario enviado. 305 success: function(data) 306 { 307 //$("#respuesta-msj").html(data).fadeIn(); // Mostrar la respuestas del script PHP. 308 //$("#respuesta-msj").html(data).fadeOut(10000); 309 } 310 }); 311 312 return false; // Evitar ejecutar el submit del formulario. 313 } 314 }); 315 316}*/ 317 318function onSubmit(data){ 319 var correo = document.getElementById('correo').value; 320 emailRegex =/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/; /*/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;*/ 321 322 if(emailRegex.test(correo) == true){ 323 //$("#msjRespuesta").stop(true); 324 $.ajax({ 325 url:"/wp-content/themes/kubo/core/suscripcion-cartelera.php", 326 type:"post", 327 data: $("#form-suscripcion").serialize(), 328 /*beforeSend: function(){ 329 //$('#msjRespuesta').html('<div style="padding-top: 30px;"></div><div align="center" class="alert alert-success" id="alert">Espera un momento por favor</div>'); 330 $('#msjRespuesta').html('<div style="padding-top: 30px;"></div><div class="progress"><div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 75%"><span class="sr-only">Espere un momento, por favor.</span></div></div>') 331 },*/ 332 success: function(response){ 333 grecaptcha.reset(); 334 335 if(response==1){ 336 //grecaptcha.reset(); 337 $('#msjRespuesta').fadeIn(500); 338 $('#msjRespuesta').html('<div style="padding-top: 30px;"></div><div align="center" style="font-size:18px;" class="alert alert-warning" id="alert"><p>Por favor, ingrese su cuenta de correo electrónico e inténtelo de nuevo.</p></div>'); 339 } else if(response==2){ 340 $('#correo').val(''); 341 //grecaptcha.reset(); 342 $('#msjRespuesta').fadeIn(500); 343 $('#msjRespuesta').html('<div style="padding-top: 30px;"></div><div align="center" style="font-size:18px;" class="alert alert-danger" id="alert"><p>Nuestro sistema antispam lo ha detectado como un bot; por favor, inténtelo de nuevo. Si el problema persiste, puede escribir a [email protected]</p></div>'); 344 } else if(response==3){ 345 //grecaptcha.reset(); 346 $('#msjRespuesta').fadeIn(500); 347 $('#msjRespuesta').html('<div style="padding-top: 30px;"></div><div align="center" style="font-size:18px;" class="alert alert-danger" id="alert"><p>Su cuenta de correo electrónico no es válida; por favor, revise que la haya escrito correctamente.</p></div>'); 348 } else if(response==4){ 349 $('#correo').val(''); 350 //grecaptcha.reset(); 351 $('#msjRespuesta').fadeIn(500); 352 $('#msjRespuesta').html('<div style="padding-top: 30px;"></div><div align="center" style="font-size:18px;" class="alert alert-success" id="alert"><p>Como empleado o estudiante, usted ya recibe semanalmente la cartelera. Por favor, revise su correo UCA y asegúrese de que nuestros envÃos no están en la carpeta de spam. Si necesita ayuda, puede escribir a <a href="[email protected]">[email protected]</a></p></div>'); 353 } else if(response==5){ 354 $('#correo').val(''); 355 //grecaptcha.reset(); 356 $('#msjRespuesta').fadeIn(500); 357 $('#msjRespuesta').html('<div style="padding-top: 30px;"></div><div align="center" style="font-size:18px;" class="alert alert-success" id="alert"><p>Su dirección electrónica ya se encuentra suscrita. Por favor, revise su correo y asegúrese de que nuestros envÃos no están en la carpeta de spam. Si necesita ayuda, puede escribir a <a href="[email protected]">[email protected]</a></p></div>'); 358 } else if(response==6){ 359 $('#correo').val(''); 360 //grecaptcha.reset(); 361 $('#msjRespuesta').fadeIn(500); 362 $('#msjRespuesta').html('<div style="padding-top: 30px;"></div><div align="center" style="font-size:18px;" class="alert alert-warning" id="alert"><p>Su correo electrónico ya está registrado. Por favor, ingrese a su buzón, busque el mensaje de suscripción que le enviamos y finalice el proceso.</p></div>'); 363 } else if(response==7){ 364 //grecaptcha.reset(); 365 $('#msjRespuesta').fadeIn(500); 366 $('#msjRespuesta').html('<div style="padding-top: 30px;"></div><div align="center" style="font-size:18px;" class="alert alert-danger" id="alert"><p>No se logró procesar su solicitud. Por favor, inténtelo de nuevo. Si el problema persiste, puede escribir a [email protected].</p></div>'); 367 } else if(response==8){ 368 $('#correo').val(''); 369 //grecaptcha.reset(); 370 $('#msjRespuesta').fadeIn(500); 371 $('#msjRespuesta').html('<div style="padding-top: 30px;"></div><div align="center" style="font-size:18px;" class="alert alert-success" id="alert"><p>Se ha enviado un mensaje de confirmación a su correo electrónico. Por favor, ingrese a su cuenta y finalice el proceso de suscripción a la cartelera informativa de la UCA.</p></div>'); 372 } 373 $('#msjRespuesta').delay(20000).fadeOut(500); 374 }, 375 error: function(error){ 376 grecaptcha.reset(); 377 $('#msjRespuesta').fadeIn(500); 378 $('#msjRespuesta').html('<div style="padding-top: 30px;"></div><div align="center" style="font-size:18px;" class="alert alert-danger" id="alert"><p>No se logró procesar su solicitud. Por favor, inténtelo de nuevo. Si el problema persiste, puede escribir a <a href="[email protected]">[email protected]</a>.</p></div>'); 379 $('#msjRespuesta').delay(20000).fadeOut(500); 380 } 381 }); 382 }else{ 383 grecaptcha.reset(); 384 $('#msjRespuesta').fadeIn(500); 385 $('#msjRespuesta').html('<div style="padding-top: 30px;"></div><div align="center" class="alert alert-danger" id="alert"><p>Su cuenta de correo electrónico no es válida; por favor, revise que la haya escrito correctamente.</p></div>'); 386 $('#msjRespuesta').delay(20000).fadeOut(500); 387 } 388} 389 390 391/*Correo alertas*/ 392/** 393 * suscripcion.js â Cartelera UCA 394 * Requiere: jQuery, reCAPTCHA v2 (data-callback="onSubmitRecaptcha") 395 */ 396 397const Suscripcion = (() => { 398 399 // ââ Mensajes ââââââââââââââââââââââââââââââââââââââââââââââââââ 400 const MSGS = { 401 1: { tipo: 'danger', txt: 'Por favor, ingrese su correo electrónico e inténtelo de nuevo.' }, 402 2: { tipo: 'danger', txt: 'Nuestro sistema antispam lo detectó como un bot. Por favor, inténtelo de nuevo.' }, 403 3: { tipo: 'danger', txt: 'La dirección de correo no es válida; revise que la haya escrito correctamente.' }, 404 4: { tipo: 'info', txt: 'Como empleado o estudiante ya recibe la cartelera. Revise su correo UCA y verifique que nuestros envÃos no estén en spam. ¿Necesita ayuda? Escriba a <a href="mailto:[email protected]">[email protected]</a>.' }, 405 5: { tipo: 'success', txt: 'Su dirección ya está suscrita. Revise que nuestros envÃos no lleguen a spam. ¿Necesita ayuda? Escriba a <a href="mailto:[email protected]">[email protected]</a>.' }, 406 6: { tipo: 'warning', txt: 'Su correo ya está registrado. Revise su bandeja, busque el mensaje de confirmación que le enviamos y finalice el proceso.' }, 407 7: { tipo: 'danger', txt: 'No se pudo procesar su solicitud. Por favor, inténtelo de nuevo. Si el problema persiste escriba a <a href="mailto:[email protected]">[email protected]</a>.' }, 408 8: { tipo: 'success', txt: 'Le hemos enviado un mensaje de confirmación. Ingrese a su correo y finalice el proceso de suscripción.' }, 409 }; 410 411 const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/; 412 const FADE_MS = 500; 413 const HIDE_MS = 20000; 414 415 // ââ Helpers âââââââââââââââââââââââââââââââââââââââââââââââââââ 416 function mostrarMsj(codigo) { 417 const cfg = MSGS[codigo] || { tipo: 'danger', txt: 'Respuesta inesperada del servidor.' }; 418 const html = ` 419 <div class="alert alert-${cfg.tipo} suscripcion-alerta" role="alert"> 420 ${cfg.txt} 421 </div>`; 422 const $msj = $('#msjRespuesta'); 423 $msj.stop(true).html(html).hide().fadeIn(FADE_MS);
424 setTimeout(() => $msj.fadeOut(FADE_MS), HIDE_MS); 425 } 426 427 function resetForm() { 428 if (typeof grecaptcha !== 'undefined') { 429 grecaptcha.reset(); 430 } 431 } 432 433 // ââ Callback público para reCAPTCHA âââââââââââââââââââââââââââ 434 function onSubmitRecaptcha(token) { 435 const $correo = $('#correo'); 436 const correo = $correo.val().trim(); 437 438 if (!EMAIL_RE.test(correo)) { 439 resetForm(); 440 mostrarMsj(3); 441 return; 442 } 443 444 $.ajax({ 445 url : '/wp-content/themes/kubo/core/suscripcion.php', 446 type : 'POST', 447 data : $('#form-suscripcion').serialize(), 448 success(response) { 449 const codigo = parseInt(response, 10); 450 resetForm(); 451 // Limpiar campo en respuestas que implican acción exitosa o duplicado 452 if ([4, 5, 6, 8].includes(codigo)) { 453 $correo.val(''); 454 } 455 mostrarMsj(codigo); 456 }, 457 error() { 458 resetForm(); 459 mostrarMsj(7); 460 }, 461 }); 462 } 463 464 // ââ Exponer al scope global (necesario para data-callback) ââââ 465 return { onSubmitRecaptcha }; 466})(); 467 468// reCAPTCHA llama a esta función por nombre global 469function onSubmitRecaptcha(token) { 470 Suscripcion.onSubmitRecaptcha(token); 471}
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.