var HERRAMIENTAS = {};
HERRAMIENTAS.click_denuncia = 0;
HERRAMIENTAS.click_envia = 0;
HERRAMIENTAS.votarArticulo = function(num) {
var votaciones = location.hostname.replace('www', 'votaciones');
var id = 'http://' + location.hostname + location.pathname;
$.getJSON('http://' + votaciones + '/votaciones/votar.json.php?callback=?',
{
url: id,
puntos: num
},
function(data) {
if (data.msg == 'OK') {
HERRAMIENTAS.getEstrellasPuntos(id);
}
}
);
};
HERRAMIENTAS.getEstrellasPuntos = function(id) {
var votaciones = location.hostname.replace('www', 'votaciones');
$.getJSON('http://' + votaciones + '/votaciones/rd.estrellas.php?callback=?',
{
url : id
},
function(data) {
var estrellas = data.puntos;
for (var i = 1; i ');
};
$(document).ready(function() {
// HERRAMIENTAS.getEstrellasPuntos($('[name="url"]').val());
HERRAMIENTAS.getEstrellasPuntos("http://" +location.hostname + location.pathname);
$('#votacion').find('a').each(function(i) {
$(this).click(function(){
HERRAMIENTAS.votarArticulo(i + 1);
}
);
}
);
$('#votacion2').find('a').each(function(i) {
$(this).click(function(){
HERRAMIENTAS.votarArticulo(i + 1);
}
);
}
);
HERRAMIENTAS.imprimirArticulo();
}
);