var add_dns_result = function(obj) {
if(obj) {
var title = obj.title;
var logo = '/img/fai/'+obj.logo;
var html = '
';
html+= '
'+title+'
';
if(!obj.servers.length) {
html+= '
Echec
';
}
else {
html+= '
';
$(obj.servers).each(function(i, v) {
html+= '';
html+= ''+v.dns+' | ';
if(!v.datas) {
html+= ' Aucun réponse | ';
}
else {
if(v.datas.indexOf('REFUSED') != -1) {
v.datas = ' '+v.datas;
}
html+= ''+v.datas+' | ';
}
html+= '
';
});
}
html+= '';
html+= '';
$('#results').append(html);
}
}
var add_whois_result = function(obj) {
if(obj) {
var title = obj.title;
var logo = '/img/fai/'+obj.logo;
var html = '';
html+= '
'+title+'
';
if(!obj.datas) {
html+= '
Echec
';
}
else {
html+= '
';
html+= '';
html+= ''+obj.datas+' | ';
html+= '
';
}
html+= '';
html+= '';
$('#results').append(html);
}
}
var init = function(loading2) {
if(!loading2) {
$('#results').html('');
$('#loading .bar').css('width', 0);
$('#loading').fadeIn();
}
else {
$('#results').html('');
$('#loading2 .bar').css('width', 0);
$('#loading2').fadeIn();
}
}
var dns_done = 0;
var results = null;
var end = function(loading2) {
if(!loading2) {
$('#loading').fadeOut();
}
else {
$('#loading2').fadeOut();
}
}
var update = function() {
dns_done++;
$('#loading .bar').css('width', (100*dns_done/dns_length)+'%');
if(dns_done == dns_length) {
window.setTimeout(function() {
end();
}, 1000);
}
}
var analyse = function() {
var type = $('#type').val();
var ipv = $('#type').val() == 1 ? '4' : '6';
var domain = $('#domain').val().replace(/\s*/, '');
if(!domain) {
$('#domain').addClass('input_error');
return false;
}
dns_done = 0;
init();
$('#domain').removeClass('input_error');
for(var u=0; u