1'use strict'; 2/* cerrar formulario */ 3 4const deadLineDate = new Date(_GT_CONVOCATORIA); 5const currentDate = new Date(); 6if (currentDate > deadLineDate) { 7 $('html').removeClass("sta-enabledConvocatoria") 8}else{ 9 $('html').addClass("sta-enabledConvocatoria") 10} 11(function (o, $, h) { 12 if (o) { 13 const buttons = o.querySelectorAll('.sta-header2-pn_sendP, .sta-header2-pn_button'); 14 if (buttons.length) { 15 if (!document.documentElement.classList.contains('sta-enabledConvocatoria')) { 16 buttons.forEach(button => { 17 button.remove(); 18 }); 19 } 20 } 21 var clearUl = function() { 22 if (controlDesk) { 23 $ulDesk.empty(); 24 cargar(); 25 } else { 26 $ulDesk.empty(); 27 } 28 }; 29 30 var cargar = function() { 31 var _n1 = false; 32 $o.addClass("sta-complete"); 33 34 var i = 0; 35 do { 36 var _n2 = list[i] 37 .appendTo($ulDesk) 38 .offset() 39 .top; 40 41 if (!_n1) { 42 _n1 = _n2 43 } else { 44 if (_n2 > _n1) { 45 list[i].remove(); 46 $o.removeClass("sta-complete"); 47 48 for (var i2 = i - 1; i2 >= 1; i2--) { 49 if (list[i2].offset().top > _n1) list[i2].remove(); 50 }; 51 52 break; 53 } 54 } 55 i++; 56 } while (i < list.length); 57 } 58 59 60 61 var $o = $(o), 62 $contentNav = $(o.querySelector(".sta-header2-pn_contentNav")), 63 $ulDesk = $($contentNav[0].querySelector(".sta-header2-pn_navDesk")), 64 hrefLocal = location.origin + location.pathname, 65 list = function () { 66 var liArray = o.querySelectorAll(".sta-header2-pn_navMovil li"), 67 boo = true, 68 array = []; 69 70 for (var i = 0; i < liArray.length; i++) { 71 72 if (boo) { 73 var hrefLink = $(liArray[i].querySelector("a")); 74 if (hrefLink.attr("href") == hrefLocal) { 75 hrefLink.addClass("sta-actual") 76 boo = false; 77 } 78 } 79 80 array.push($(liArray[i]).clone()); 81 } 82 return array; 83 }(), 84 controlDesk = function () { 85 $(window).resize(function () { 86 controlDesk = !($contentNav.css('display') == "none"); 87 }); 88 89 return !($contentNav.css('display') == "none"); 90 }(); 91 92 93 clearUl(); 94 setTimeout(clearUl, 50); 95 $(window).resize(clearUl); 96 97 h.controlTop(o) 98 }; 99})(document.querySelector(".tpl-header2-pn"), jQuery, hotusa()); 100 101(function (o, $, h) { 102 if (!o || !$ || !h) return false; 103 104 var enviar = function() { 105 106 //reCAPTCHAv3 107 grecaptcha.ready(function() { 108 grecaptcha.execute('6LcwnKoUAAAAABCgcDXc4P5TsWfaO6k_jq_rOj7D', {action: 'sendForm'}).then(function(token) { 109 const f =$("#formUpload"); 110 const formD = f.serializeArray(); 111 const camposParaModificar = ["form_country", "form_residence_city",]; 112 formD.forEach((campo) => { 113 if (camposParaModificar.includes(campo.name)) { 114 campo.value = $(`#${campo.name} option:selected`).text(); 115 } 116 }); 117 const formData = new FormData(f[0]); 118 formData.forEach((value, key) => { 119 if (camposParaModificar.includes(key)) { 120 formData.set(key, $(`#${key} option:selected`).text()); 121 } 122 }); 123 $.ajax({ 124 url: '/api/cms/relatos/saveForm/'+token, 125 type: 'POST', 126 data: formData, 127 async: false, 128 cache: false, 129 contentType: false, 130 processData: false, 131 success: function (c) { 132 const er = c.split("-").slice(0, 2).join("-"); 133 switch (er) { 134 case 'OK': 135 location.href = obj.errors.url_redirect; 136 break; 137 case 'KO-FORMAT': 138 obj.errors.$p.addClass('sta-ko'); 139 obj.errors.$ul.append($('<li></li>').text(obj.errors.pdf_invalid_format)); 140 break; 141 case 'KO-SIZE': 142 obj.errors.$p.addClass('sta-ko') 143 obj.errors.$ul.append($('<li></li>').text(obj.errors.pdf_invalid_size)); 144 break; 145 case 'KO-LIMIT': 146 obj.errors.$p.addClass('sta-ko') 147 obj.errors.$ul.append($('<li></li>').text(obj.errors.error_limit_max)); 148 break; 149 case 'KO-DATE': 150 obj.errors.$p.addClass('sta-ko') 151 obj.errors.$ul.append($('<li></li>').text(obj.errors.error_out_of_date)); 152 break; 153 default: 154 console.log('ko-already-register') 155 obj.errors.$p.addClass('sta-ko'); 156 obj.errors.$ul.append($('<li></li>').text(obj.errors.copi_already_reg)); 157 }; 158 } 159 }); 160 }); 161 }); 162 } 163 164 $(document).ready(function () { 165 const countries = window.countries; 166 const countrySelect = $(".sta-form-pn_f_country"); 167 const citySelect = $(".sta-form-pn_f_residence_city");
168 countries.forEach((country) => { 169 const option = new Option(country.name, country.id, false, false); 170 countrySelect.append(option); 171 }); 172 countrySelect.select2({ 173 placeholder: "Selecciona un paÃs", 174 allowClear: true 175 }); 176 countrySelect.on("change", async function () { 177 const selectedCountryId = $(this).val(); 178 if (!selectedCountryId) { 179 citySelect.empty().trigger("change"); 180 return; 181 } 182 citySelect.empty().trigger("change"); 183 try { 184 const response = await fetch(`https://www.premioeurostarsnarrativa.com/api/cms/cities/${selectedCountryId}`); 185 if (!response.ok) throw new Error("Error al obtener datos"); 186 const cities = await response.json(); 187 cities.forEach((city) => { 188 const option = new Option(city.name, city.id, false, false); 189 citySelect.append(option); 190 }); 191 citySelect.trigger("change"); 192 } catch (error) { 193 console.error("Error al cargar ciudades:", error); 194 citySelect.empty().append(new Option("Error al cargar ciudades", "", false, false)).trigger("change"); 195 } 196 }); 197 citySelect.select2({ 198 placeholder: "Selecciona una ciudad", 199 allowClear: true 200 }); 201 }); 202 203 /* const destinos ={ 204 205 "H105": "Apartahotel Exe Campus San Mam\u00e9s", 206 "SYN2862": "Apartamentos El Cid", 207 "SYN1455": "Apartamentos La Toja", 208 "HTL00307": "Apartamentos Metr\u00f3polis", 209 "SYN256": "Apartamentos Prat de les Molleres", 210 "SYN2381": "Apartamentos Suite The Way", 211 "E064": "Claridge Hotel", 212 "H205": "Crisol Alisios Canteras", 213 "ABONIFAZ": "Crisol Almirante Bonifaz", 214 "SYN1334": "Crisol Conde Rodrigo", 215 "SYN93": "Crisol Fayc\u00e1n", 216 "SYN1283": "Crisol Guadalupe", 217 "SYN2562": "Crisol Jardines de C\u00f3rdoba", 218 "SYN999": "Crisol La Selva", 219 "SYN3097": "Crisol Legan\u00e9s", 220 "HTL00335": "Crisol Mes\u00f3n del Cid", 221 "H238": "Crisol Monasterio de San Miguel", 222 "H106": "Crisol Mundial", 223 "H161": "Crisol Puerta de Burgos", 224 "H016": "Crisol Quality Reus", 225 "SYN969": "Crisol Quind\u00f3s", 226 "HTL00225": "Crisol Regio", 227 "H167": "Crisol Riosol", 228 "H092": "Crisol Suites Catalinas", 229 "SYN2502": "Crisol Tres Pastorinhos", 230 "H173": "Crisol V\u00eda Castellana", 231 "H149": "Domus Plaza Zocodover", 232 "SYN1300": "Eurostars Acte\u00f3n", 233 "SYN1333": "Eurostars Aliados", 234 "SYN2038": "Eurostars Ambassador", 235 "H189": "Eurostars Andorra", 236 "E135": "Eurostars Araguaney", 237 "H124": "Eurostars Arenas de Pinto", 238 "SYN328": "Eurostars Asta Regia", 239 "E033": "Eurostars Astoria", 240 "SYN1076": "Eurostars Atl\u00e1ntico", 241 "SYN1082": "Eurostars Azahar", 242 "E116": "Eurostars Berlin", 243 "SYN1325": "Eurostars Blue Coru\u00f1a", 244 "E133": "Eurostars Book Hotel", 245 "SYN2992": "Eurostars Casa Anfa", 246 "H198": "Eurostars Casa de la L\u00edrica", 247 "H239": "Eurostars Cascais", 248 "H190": "Eurostars Central", 249 "H215": "Eurostars Centrale Palace", 250 "SYN1104": "Eurostars Centrum Alicante", 251 "E007": "Eurostars Ciudad de La Coru\u00f1a", 252 "H008": "Eurostars Conquistador", 253 "H236": "Eurostars Danube Budapest", 254 "E050": "Eurostars Das Artes", 255 "E095": "Eurostars Das Letras", 256 "E040": "Eurostars Diana Palace", 257 "SYN2865": "Eurostars Don C\u00e1ndido", 258 "H096": "Eurostars Embassy", 259 "E107": "Eurostars Executive", 260 "SYN1734": "Eurostars Florence Boutique", 261 "SYN273": "Eurostars Fuerte Ruavieja", 262 "H207": "Eurostars Gran Hotel La Toja", 263 "HTL00123": "Eurostars Gran Hotel Lugo", 264 "H233": "Eurostars Gran Hotel Santiago", 265 "E038": "Eurostars Gran Madrid", 266 "E042": "Eurostars Gran Valencia", 267 "H230": "Eurostars Gran V\u00eda", 268 "E105": "Eurostars Grand Central", 269 "E030": "Eurostars Grand Marina", 270 "SYN1528": "Eurostars Guadalquivir", 271 "H103": "Eurostars Hacienda Vista Real", 272 "H209": "Eurostars Heroismo", 273 "H199": "Eurostars Hotel Excelsior", 274 "E152": "Eurostars Hotel Real", 275 "H188": "Eurostars Hotel de la Reconquista", 276 "SYN989": "Eurostars Ibiza",
277 "H208": "Eurostars Isla de la Toja", 278 "SYN2410": "Eurostars La Pleta", 279 "SYN336": "Eurostars Langford", 280 "E139": "Eurostars Las Claras", 281 "H214": "Eurostars Las Salinas", 282 "SYN2324": "Eurostars Lisboa Baixa", 283 "E159": "Eurostars Lisboa Parque", 284 "SYN1324": "Eurostars Los Agustinos", 285 "E119": "Eurostars Lucentum", 286 "SYN1117": "Eurostars Madrid Congress", 287 "H240": "Eurostars Madrid Foro", 288 "H011": "Eurostars Madrid Gran V\u00eda", 289 "E092": "Eurostars Madrid Tower", 290 "SYN1207": "Eurostars Magnificent Mile", 291 "E013": "Eurostars Maim\u00f3nides", 292 "H168": "Eurostars Mar de Vigo", 293 "H108": "Eurostars Marivent", 294 "SYN1529": "Eurostars Marqu\u00e9s de Vallejo", 295 "SYN1221": "Eurostars Marqu\u00e9s de Villalta", 296 "SYN1270": "Eurostars Matosinhos", 297 "E020": "Eurostars Mediterranea Plaza", 298 "H212": "Eurostars Monte Real", 299 "SYN118": "Eurostars Monte Tauro", 300 "E058": "Eurostars Montgomery", 301 "E051": "Eurostars Monumental", 302 "E024": "Eurostars Monumento Monasterio de San Clodio Hotel", 303 "SYN1299": "Eurostars M\u00e1laga", 304 "SYN2505": "Eurostars Oasis Marbella", 305 "H181": "Eurostars Oasis Plaza", 306 "E120": "Eurostars Oporto", 307 "H172": "Eurostars Palace", 308 "H191": "Eurostars Palacio Buenavista", 309 "SYN67": "Eurostars Palacio Santa Marta", 310 "SYN1288": "Eurostars Palacio de Cristal", 311 "SYN2629": "Eurostars Palazzo Zichy", 312 "SYN2978": "Eurostars Pamplona", 313 "E035": "Eurostars Park Hotel Maximilian", 314 "E121": "Eurostars Patios de C\u00f3rdoba", 315 "E060": "Eurostars Plaza Acueducto", 316 "E153": "Eurostars Plaza Mayor", 317 "SYN88": "Eurostars Porto Centro", 318 "H227": "Eurostars Porto Douro", 319 "H015": "Eurostars Puerta Real", 320 "SYN2085": "Eurostars P\u00f3rtico Alicante", 321 "SYN2622": "Eurostars Queen of Montenegro", 322 "E014": "Eurostars Regina", 323 "H138": "Eurostars Reina Felicia", 324 "H097": "Eurostars Residenza Cannaregio", 325 "E137": "Eurostars Rey Fernando", 326 "E106": "Eurostars Roma Aeterna", 327 "SYN2855": "Eurostars Royal Tanau", 328 "E117": "Eurostars San L\u00e1zaro", 329 "SYN1505": "Eurostars Santa Luzia", 330 "H231": "Eurostars Sevilla Boutique", 331 "SYN2510": "Eurostars Sitges", 332 "SYN1896": "Eurostars Sofia City", 333 "H217": "Eurostars Suites Mirasierra", 334 "E066": "Eurostars Thalia", 335 "E045": "Eurostars Toledo", 336 "SYN60": "Eurostars Torre Sevilla", 337 "SYN1902": "Eurostars Universal Lisboa", 338 "SYN2380": "Eurostars V\u00eda de la Plata", 339 "H078": "Eurostars Wall Street", 340 "H213": "Eurostars Zaragoza", 341 "H050": "Eurostars Zona Rosa Suites", 342 "E111": "Eurostars i-Hotel", 343 "SYN2284": "Eurostars uHotel", 344 "SYN2455": "Exe Alameda Reforma", 345 "H169": "Exe Alfonso VIII", 346 "SYN87": "Exe Almada Porto", 347 "H067": "Exe Area Central", 348 "SYN2379": "Exe Astur Plaza", 349 "E005": "Exe Auriense", 350 "H165": "Exe Bacat\u00e1 95", 351 "E032": "Exe Barber\u00e0 Parc", 352 "SYN417": "Exe Barcelona Gate", 353 "H218": "Exe Boston", 354 "E104": "Exe Budapest Center", 355 "H232": "Exe Campus", 356 "H197": "Exe Casa de Los Linajes", 357 "H222": "Exe Cities Reforma", 358 "H237": "Exe City Park",
359 "E034": "Exe Ciudad de C\u00f3rdoba", 360 "SYN2996": "Exe Convention Plaza Madrid", 361 "SYN1319": "Exe Coru\u00f1a", 362 "E004": "Exe Cristal Palace", 363 "H162": "Exe Cuenca", 364 "SYN995": "Exe Cunit Suites & Spa", 365 "E026": "Exe Domus Aurea", 366 "SYN1349": "Exe Do\u00f1a Carlota", 367 "SYN1882": "Exe Essenzia Porto", 368 "SYN996": "Exe Estepona Thalasso & Spa - Adults only", 369 "H194": "Exe Getafe", 370 "H063": "Exe Gran Hotel Almenar", 371 "H003": "Exe Gran Hotel Sol\u00facar", 372 "H093": "Exe Guadalete", 373 "E074": "Exe Hotel Cataratas", 374 "H101": "Exe Hotel Col\u00f3n", 375 "H226": "Exe Hotel El Magistral", 376 "E041": "Exe International Palace", 377 "E067": "Exe Isla Cartuja", 378 "E025": "Exe Laietana Palace", 379 "E009": "Exe Las Adelfas", 380 "SYN997": "Exe Las Margas Golf", 381 "SYN1290": "Exe Las Palmas", 382 "SYN1220": "Exe Layos Golf", 383 "SYN2283": "Exe Lev", 384 "E047": "Exe Le\u00f3n", 385 "SYN1067": "Exe Liberdade", 386 "SYN126": "Exe Madrid Norte", 387 "H183": "Exe Majestic", 388 "E017": "Exe Mitre", 389 "H148": "Exe Moncloa", 390 "SYN403": "Exe M\u00e1laga Museos", 391 "SYN2419": "Exe Oriental Panam\u00e1", 392 "H196": "Exe Oviedo Centro", 393 "E094": "Exe Panorama", 394 "E012": "Exe Parc del Vall\u00e9s", 395 "H052": "Exe Paris Centre", 396 "SYN2183": "Exe Peregrino", 397 "H175": "Exe Plaza", 398 "SYN199": "Exe Plaza Catalunya", 399 "E059": "Exe Plaza Delicias", 400 "SYN2897": "Exe Portals Nous", 401 "SYN2970": "Exe Pozuelo", 402 "SYN2217": "Exe Praia Golfe", 403 "H193": "Exe Princep", 404 "H192": "Exe Prisma", 405 "H136": "Exe Puerta de San Pedro", 406 "SYN509": "Exe Puerto de Sagunto", 407 "E102": "Exe Ramblas Boquer\u00eda", 408 "SYN347": "Exe Reina Isabel", 409 "H211": "Exe Rey Don Jaime", 410 "H224": "Exe Salamanca", 411 "SYN1249": "Exe Saldanha", 412 "SYN83": "Exe Sevilla Macarena", 413 "H174": "Exe Sevilla Palmera", 414 "H069": "Exe Suites 33", 415 "E090": "Exe Suites Reforma", 416 "H086": "Exe Suites San Marino", 417 "SYN2640": "Exe S\u00e3o L\u00e1zaro", 418 "E006": "Exe Tartessos", 419 "E055": "Exe Toscana", 420 "SYN1112": "Exe Tres Cantos", 421 "H200": "Exe Triunfo Granada", 422 "SYN966": "Exe Victoria Palace", 423 "E028": "Exe Vienna", 424 "SYN1908": "Exe Vigo", 425 "SYN1770": "Exe V\u00eda Argentum", 426 "SYN1108": "Exe Wellington", 427 "H210": "Exe Zaragoza WTC", 428 "E043": "Exe Zarzuela Park", 429 "SYN2295": "Exe Zizur Pamplona", 430 "SYN767": "Exe \u00c1gora C\u00e1ceres", 431 "SYN2281": "Grand Hotel Union Eurostars", 432 "SYN2297": "Hotel Palacio Marqu\u00e9s de Ariz\u00f3n", 433 "SYN2456": "Hotel R\u00edo Badajoz", 434 "E056": "Ikonik Angl\u00ed", 435 "SYN2161": "Ikonik Gran V\u00eda", 436 "H235": "Ikonik Hotel Puebla", 437 "E103": "Ikonik Lex", 438 "SYN1903": "Ikonik Lisboa", 439 "SYN2377": "Ikonik Miraflores", 440 "SYN2630": "Ikonik Parlament", 441 "SYN1181": "Ikonik Plaza Mercado", 442 "E123": "Ikonik Ramblas", 443 "SYN1422": "Pazo Moreda", 444 "H201": "Pousada de A Lanzada", 445 "H202": "Pousada de Armenteira", 446 "SYN2118": "Pousada de Mea\u00f1o", 447 "SYN2119": "Pousada de Ribadumia", 448 "SYN249": "Tandem Ancha 34", 449 "SYN1262": "Tandem El Patio", 450 "SYN1224": "Tandem Palacio Alfama Suites", 451 "SYN1530": "Tandem Palacio Veedor de Galeras Suites", 452 "SYN1374": "Tandem Portal de Elche", 453 "SYN1343": "Tandem Puerto Chico", 454 "SYN1894": "Tandem P\u00f3pulo", 455 "SYN2094": "Tandem P\u00f3rtico Alicante Suites", 456 "SYN1083": "Tandem Soho Suites", 457 "SYN2901": "Tandem Solera", 458 "SYN2024": "Tandem Torre de la Calahorra", 459 "SYN1378": "Tandem Torres de C\u00e1diz Suites", 460 "SYN1309": "\u00c1urea Ana Palace Hotel", 461 "SYN2005": "\u00c1urea Casa Palacio Sagasta", 462 "SYN1058": "\u00c1urea Catedral", 463 "H182": "\u00c1urea Convento Capuchinos", 464 "SYN1271": "\u00c1urea Legends", 465 "SYN86": "\u00c1urea Museum", 466 "SYN1881": "\u00c1urea Palacio de Correos", 467 "SYN1180": "\u00c1urea Palacio de Sober", 468 "SYN2568": "\u00c1urea Toledo", 469 "H223": "\u00c1urea Washington Irving" 470 } 471 472 473const hotels = Object.values(destinos); 474
475hotels.forEach(destino => { 476 const destSelect = document.querySelector('.sta-form-pn_f_hotel') 477 const destOption = document.createElement('option') 478 destOption.value = destino 479 destOption.textContent = destino 480 destSelect.appendChild(destOption) 481 482})*/ 483 484$(document).ready(function() { 485 $('.js-example-basic-single').select2(); 486}); 487 488 var validar = function() { 489 var enviar = true, 490 empty = false, 491 email = false, 492 check = false, 493 check_edad = false, 494 file = false; 495 496 obj.errors.$ul.empty(); 497 obj.errors.$p.removeClass('sta-ko').removeClass('sta-ok'); 498 499 for (var i = 0; i < obj.obli.length; i++) { 500 if (obj.obli[i].value.trim()) { 501 $(obj.obli[i]).parents('label').removeClass('sta-error'); 502 } else { 503 $(obj.obli[i]).parents('label').addClass('sta-error'); 504 enviar = false; 505 empty = true; 506 }; 507 }; 508 509 if (h.mail(obj.email.value)) { 510 $(obj.email).parents('label').removeClass('sta-error'); 511 } else { 512 $(obj.email).parents('label').addClass('sta-error'); 513 enviar = false; 514 email = true; 515 }; 516 517 if (obj.check.checked) { 518 $(obj.check).parents('label').removeClass('sta-error'); 519 } else { 520 $(obj.check).parents('label').addClass('sta-error'); 521 enviar = false; 522 check = true; 523 }; 524 525 if (obj.check_edad.checked) { 526 $(obj.check_edad).parents('label').removeClass('sta-error'); 527 } else { 528 $(obj.check_edad).parents('label').addClass('sta-error'); 529 enviar = false; 530 check_edad = true; 531 }; 532 533 if (obj.file.value && obj.file.files.length == 1 && obj.file.files[0].type == 'application/pdf') { 534 $(obj.file).parents('label').removeClass('sta-error'); 535 } else { 536 $(obj.file).parents('label').addClass('sta-error'); 537 enviar = false; 538 file = true; 539 }; 540 541 if (empty) obj.errors.$ul.append($('<li></li>').text(obj.errors.copi_empty)); 542 if (email) obj.errors.$ul.append($('<li></li>').text(obj.errors.copi_email)); 543 if (check) obj.errors.$ul.append($('<li></li>').text(obj.errors.copi_check)); 544 if (check_edad) obj.errors.$ul.append($('<li></li>').text(obj.errors.copi_check_edad)); 545 if (file) obj.errors.$ul.append($('<li></li>').text(obj.errors.copi_file)); 546 547 if (!enviar) { 548 obj.errors.$p.addClass('sta-ko'); 549 } 550 551 return enviar; 552 }; 553 554 var obj = { 555 obli: [], 556 name: o.querySelector('.sta-form-pn_f_name'), 557 surname: o.querySelector('.sta-form-pn_f_surname'), 558 pseudonimo: o.querySelector('.sta-form-pn_f_pseudonimo'), 559 email: o.querySelector('.sta-form-pn_f_email'), 560 telefono: o.querySelector('.sta-form-pn_f_telefono'), 561 country: o.querySelector('.sta-form-pn_f_country'), 562 residence_city: o.querySelector('.sta-form-pn_f_residence_city'), 563 province: o.querySelector('.sta-form-pn_f_provincia'), 564 //hotel: o.querySelector('.sta-form-pn_f_hotel'), 565 ccaa: o.querySelector('.sta-form-pn_f_state'), 566 titulo: o.querySelector('.sta-form-pn_f_titulo'), 567 // relato: o.querySelector('.sta-form-relato'), 568 howtomeet: o.querySelector('.sta-form-pn_f_howto_meet'), 569 file: o.querySelector('.sta-form-pn_f_manuscrito'), 570 571 $fileName: $(o.querySelector('.sta-form-pn_file_span_noempty')), 572 check: o.querySelector('.sta-form-pn_f_check'), 573 check_edad: o.querySelector('.sta-form-pn_f_check_edad'), 574 errors: { 575 $p: $(o.querySelector('.sta-form-pn_errors')), 576 $ul: $(o.querySelector('.sta-form-pn_KO')), 577 copi_empty: o.querySelector('.sta-empty').value, 578 copi_email: o.querySelector('.sta-email').value, 579 copi_file: o.querySelector('.sta-file').value, 580 copi_check: o.querySelector('.sta-check').value, 581 copi_check_edad: o.querySelector('.sta-check_edad').value, 582 copi_server: o.querySelector('.sta-server').value, 583 copi_already_reg: o.querySelector('.sta-already-regist').value, 584 url_redirect : o.querySelector('.sta-form-pn_f_url_ok').value, 585 pdf_invalid_format : o.querySelector('.sta-pdf-invalid-format').value, 586 pdf_invalid_size : o.querySelector('.sta-pdf-invalid-size').value, 587 error_limit_max : o.querySelector('.sta-limit-max').value, 588 error_out_of_date : o.querySelector('.sta-out-of-date').value 589 } 590 }; 591 obj.obli.push(obj.name,obj.surname,obj.email,obj.country,obj.residence_city,obj.province,obj.titulo,obj.file); 592 593 $(o.querySelector('.sta-form-pn_formulario')).submit(function (e) { 594 e.preventDefault(); 595 console.log('prueba'); 596 597 if (validar()) {
598 enviar(); 599 console.log('prueba'); 600 } 601 602 }); 603 604 $(obj.file).change(function () { 605 if (obj.file.files.length && obj.file.files[0].type == 'application/pdf') { 606 obj.$fileName.text(obj.file.files[0].name) 607 $(obj.file).parents('label').addClass('sta-loading'); 608 } else { 609 obj.$fileName.text('') 610 $(obj.file).parents('label').removeClass('sta-loading'); 611 }; 612 }); 613 614 615})(document.querySelector('.tpl-form-pn'), jQuery, hotusa()); 616 617 618 619(function (o, json, $) { 620 if (o && json && json.all_noticias && json.all_noticias.length) { 621 var crearHtml = function(info) { 622 var $html = $backup.clone(); 623 $(".sta-noticia-pn_image", $html).css('background-image', "url('" + info.img + "')"); 624 $(".sta-noticia-pn_title", $html).text(info.title); 625 $(".sta-noticia-pn_enlace a", $html).attr('href', info.url); 626 627 return $html; 628 }; 629 var cargar = function() { 630 $loading.removeClass('sta-complete'); 631 for (var _count = 0; _count < maxCarga && c
631argas < json.all_noticias.length; cargas++ , _count++) { 632 $container.append(crearHtml(json.all_noticias[cargas])); 633 }; 634 $counterButton.removeClass('sta-disable'); 635 $loading.addClass('sta-complete'); 636 637 638 if (cargas >= json.all_noticias.length) { 639 $counterButton.addClass('sta-disable'); 640 } 641 642 643 }; 644 645 var $container = $(o.querySelector(".sta-noticia-pn_container")), 646 $backup = $(o.querySelector(".sta-noticia-pn_news")).clone(), 647 $counterButton = $(o.querySelector(".sta-noticia-pn_more")), 648 $loading = $(o.querySelector(".sta-noticia-pn_loading")), 649 maxCarga = 6, 650 cargas = 0; 651 652 $(o.querySelector(".sta-noticia-pn_news")).remove(); 653 654 cargar(); 655 656 $(".sta-noticia-pn_button", $counterButton).click(cargar); 657 658 }; 659})(document.querySelector(".tpl-noticia-pn"), window.json_noticias, jQuery); 660
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.