mirror of
https://github.com/sileht/bird-lg.git
synced 2024-12-21 20:14:43 +01:00
Generalize requests without arguments in JS
This commit adds a list of request types that do not have parameters. These reqeusts are handled different by the JS code, and the list makes it easier to add new custom commands that do not have arguments.
This commit is contained in:
parent
30add2e41b
commit
c83e4842e9
|
@ -1,4 +1,4 @@
|
|||
|
||||
const noArgReqs = ["summary"];
|
||||
|
||||
$(window).unload(function(){
|
||||
$(".progress").show()
|
||||
|
@ -12,7 +12,7 @@ function change_url(loc){
|
|||
|
||||
function reload(){
|
||||
loc = "/" + request_type + "/" + hosts + "/" + proto;
|
||||
if (request_type != "summary" ){
|
||||
if (!noArgReqs.includes(request_type)){
|
||||
if( request_args != undefined && request_args != ""){
|
||||
loc = loc + "?q=" + encodeURIComponent(request_args);
|
||||
change_url(loc)
|
||||
|
@ -22,7 +22,7 @@ function reload(){
|
|||
}
|
||||
}
|
||||
function update_view(){
|
||||
if (request_type == "summary")
|
||||
if (noArgReqs.includes(request_type))
|
||||
$(".navbar-search").hide();
|
||||
else
|
||||
$(".navbar-search").show();
|
||||
|
|
Loading…
Reference in a new issue