1jQuery(document).ready(function ($) { 2 let uid = null; 3 let connected = false; 4 5 if (typeof ttt_hashDatos != "undefined") { 6 if (typeof ttt_hashDatos.id != "undefined") { 7 if (typeof ttt_hashDatos.id.nick != "undefined" && ttt_hashDatos.id.uid != "undefined") { 8 uid = ttt_hashDatos.id.uid; 9 connected = true; 10 } 11 } else { 12 if (typeof ttt_hashDatos.nick != "undefined" && ttt_hashDatos.uid != "undefined") { 13 uid = ttt_hashDatos.uid; 14 connected = true; 15 } 16 } 17 } 18 19 jQuery(document).on('click', '.voto .usuario_vota', e => { 20 e.preventDefault(); 21 22 let options = { 23 theme: "sk-rect", 24 message: 'Cargando, espere un momento', 25 textColor: "white" 26 }; 27 28 HoldOn.open(options); 29 30 let enlace = jQuery(e.target); 31 32 enlace.hide(); 33 34 if (connected) { 35 let track_id = enlace.data("track_id"); 36 let cue_title = enlace.data("cue_title"); 37 let track_artist_name = enlace.data("track_artist_name"); 38 let fecha_list = enlace.data("fecha_list"); 39 40 jQuery.ajax({ 41 type: 'POST', 42 url: tttvotaciones_ajax_vars.ajax_url, 43 data: { 44 action: 'ranking_votacion', 45 uid: uid, 46 track_id: track_id, 47 cue_title: cue_title, 48 track_artist_name: track_artist_name, 49 fecha_list: fecha_list, 50 nonce: tttvotaciones_ajax_vars.nonce 51 }, 52 success: function (response) { 53 HoldOn.close(); 54 let data = null; 55 try { 56 data = JSON.parse(response); 57 } catch (e) {} 58 59 if (data != null && data.type == "success") { 60 if (data.nvotos > 9) { 61 $('.usuario_vota').hide(); 62 63 let mensaje = data.mensaje + "\n\nPOR HOY YA HAS VOTADO POR TUS 10 CANCIONES FAVORITAS DE ESTA LISTA.\n\nPUEDE SEGUIR VOTANDO HASTA LAS 23:59 HORAS DE CADA VIERNES\n\n¡GRACIAS!"; 64 65 swal("Gracias por votar", mensaje, "success"); 66 } else { 67 swal("Gracias por votar", data.mensaje, "success"); 68 } 69 } else { 70 if (data != null && data.type == "warning") { 71 usuarioNoLogado(data); 72 enlace.show(); 73 } else { 74 swal("Ha habido algún problema.", data.mensaje, data.type); 75 } 76 } 77 }, 78 error: function (response) { 79 HoldOn.close(); 80 }, 81 fail: function (response) { 82 HoldOn.close(); 83 } 84 }); 85 } else { 86 HoldOn.close(); 87 usuarioNoLogado({ 88 type: 'warning', 89 mensaje: 'No te has identificado.' 90 }); 91 enlace.show() 92 } 93 }); 94 95 function usuarioNoLogado(response) { 96 swal({ 97 title: "Para votar necesitas estar registrado", 98 text: response.mensaje, 99 type: response.type, 100 showCancelButton: true, 101 confirmButtonText: "RegÃstrate o identifÃcate", 102 cancelButtonText: "Cancelar", 103 closeOnConfirm: false, 104 }, function (isConfirm) { 105 if (isConfirm) { 106 swal({ 107 title: "Para votar necesitas estar registrado", 108 text: response.mensaje, 109 type: response.type, 110 showCancelButton: true, 111 confirmButtonText: "RegÃstrate", 112 cancelButtonText: "IdentifÃcate", 113 }, function (isConfirm) { 114 if (isConfirm) { 115 document.location.href = parametros.registro_url + '?backURL=' + parametros.back_url; 116 } else { 117 document.location.href = parametros.identificacion_url + '?backURL=' + parametros.back_url; 118 } 119 }); 120 } 121 }); 122 } 123 124});
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.