2012-02-05 14:30:32 +01:00
|
|
|
|
|
|
|
|
2012-02-08 22:05:28 +01:00
|
|
|
$(window).unload(function(){
|
|
|
|
$(".progress").show()
|
|
|
|
});
|
|
|
|
|
|
|
|
function change_url(loc){
|
|
|
|
$(".progress").show(0, function(){
|
|
|
|
document.location = loc;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2012-02-05 14:30:32 +01:00
|
|
|
function reload(){
|
|
|
|
loc = "/" + request_type + "/" + hosts + "/" + proto;
|
|
|
|
if (request_type != "summary" ){
|
|
|
|
if( request_args != undefined && request_args != ""){
|
|
|
|
loc = loc + "?q=" + request_args;
|
2012-02-08 22:05:28 +01:00
|
|
|
change_url(loc)
|
2012-02-05 14:30:32 +01:00
|
|
|
}
|
|
|
|
} else {
|
2012-02-08 22:05:28 +01:00
|
|
|
change_url(loc)
|
2012-02-05 14:30:32 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
function update_view(){
|
|
|
|
if (request_type == "summary")
|
|
|
|
$(".navbar-search").hide();
|
|
|
|
else
|
|
|
|
$(".navbar-search").show();
|
|
|
|
|
|
|
|
$(".navbar li").removeClass('active');
|
|
|
|
|
|
|
|
$(".proto a#"+proto).parent().addClass('active');
|
|
|
|
$(".hosts a[id='"+hosts+"']").parent().addClass('active');
|
|
|
|
$(".request_type a#"+request_type).parent().addClass('active');
|
|
|
|
|
|
|
|
command = $(".request_type a#"+request_type).text().split("...");
|
|
|
|
$(".request_type a:first").html(command[0] + '<b class="caret"></b>');
|
|
|
|
if (command[1] != undefined ) {
|
|
|
|
$(".navbar li:last").html(" "+command[1]);
|
|
|
|
} else {
|
|
|
|
$(".navbar li:last").html("");
|
|
|
|
}
|
|
|
|
|
|
|
|
request_args = $(".request_args").val();
|
|
|
|
$(".request_args").focus();
|
|
|
|
$(".request_args").select();
|
|
|
|
}
|
|
|
|
$(function(){
|
2012-02-08 22:05:28 +01:00
|
|
|
$(".history a").click(function (event){
|
|
|
|
event.preventDefault();
|
|
|
|
change_url(this.href)
|
|
|
|
});
|
2012-02-05 14:30:32 +01:00
|
|
|
$(".modal .modal-footer .btn").click(function(){
|
|
|
|
$(".modal").modal('hide');
|
|
|
|
});
|
|
|
|
$("a.whois").click(function (event){
|
|
|
|
event.preventDefault();
|
|
|
|
link = $(this).attr('href');
|
|
|
|
$.getJSON(link, function(data) {
|
|
|
|
$(".modal h3").html(data.title);
|
|
|
|
$(".modal .modal-body > p").html(data.output);
|
|
|
|
$(".modal").modal('show');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
$(".history a").click(function (){
|
|
|
|
$(".history li").removeClass("active")
|
|
|
|
$(this).parent().addClass("active")
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$(".hosts a").click(function(){
|
|
|
|
hosts = $(this).attr('id');
|
|
|
|
update_view();
|
|
|
|
reload();
|
|
|
|
});
|
|
|
|
$(".proto a").click(function(){
|
|
|
|
proto = $(this).attr('id');
|
|
|
|
update_view();
|
|
|
|
reload();
|
|
|
|
});
|
|
|
|
$(".request_type ul a").click(function(){
|
2012-05-29 16:53:19 +02:00
|
|
|
if ( request_type.split("_")[0] != $(this).attr('id').split("_")[0] ){
|
2012-02-05 14:30:32 +01:00
|
|
|
request_args = ""
|
|
|
|
$(".request_args").val("");
|
|
|
|
}
|
|
|
|
request_type = $(this).attr('id');
|
|
|
|
update_view();
|
|
|
|
reload();
|
|
|
|
});
|
|
|
|
$("form").submit(function(){
|
|
|
|
update_view();
|
|
|
|
reload();
|
|
|
|
});
|
|
|
|
$('.request_args').val(request_args);
|
|
|
|
update_view();
|
|
|
|
});
|
|
|
|
|
|
|
|
|