mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-06-03 10:50:20 +00:00
moved reconfiguration of dropdown display directly to the onchange function of the dropdown box as the code is not used elsewhere
This commit is contained in:
parent
dfe35c9c97
commit
66a4083891
@ -78,7 +78,26 @@
|
||||
});
|
||||
|
||||
$('#id_dynamicdns-service_type').change(function() {
|
||||
configure_dropdown();
|
||||
if ($("#id_dynamicdns-service_type option:selected").text() == "GnuDIP") {
|
||||
set_gnudip_mode()
|
||||
}else{
|
||||
set_update_url_mode();
|
||||
if ($("#id_dynamicdns-service_type option:selected").text() == "noip.com") {
|
||||
$('#id_dynamicdns-dynamicdns_update_url').val(NOIP);
|
||||
$('#id_dynamicdns-use_http_basic_auth').prop('checked', true);
|
||||
}else{
|
||||
$('#id_dynamicdns-use_http_basic_auth').prop('checked', false);
|
||||
}
|
||||
if ($("#id_dynamicdns-service_type option:selected").text() == "selfhost.bz") {
|
||||
$('#id_dynamicdns-dynamicdns_update_url').val(SELFHOST);
|
||||
}
|
||||
if ($("#id_dynamicdns-service_type option:selected").text() == "freedns.afraid.org") {
|
||||
$('#id_dynamicdns-dynamicdns_update_url').val(FREEDNS);
|
||||
}
|
||||
if ($("#id_dynamicdns-service_type option:selected").text() == "other update URL") {
|
||||
$('#id_dynamicdns-dynamicdns_update_url').val('');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#id_dynamicdns-showpw').change(function() {
|
||||
@ -114,30 +133,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
function configure_dropdown()
|
||||
{
|
||||
if ($("#id_dynamicdns-service_type option:selected").text() == "GnuDIP") {
|
||||
set_gnudip_mode()
|
||||
}else{
|
||||
set_update_url_mode();
|
||||
if ($("#id_dynamicdns-service_type option:selected").text() == "noip.com") {
|
||||
$('#id_dynamicdns-dynamicdns_update_url').val(NOIP);
|
||||
$('#id_dynamicdns-use_http_basic_auth').prop('checked', true);
|
||||
}else{
|
||||
$('#id_dynamicdns-use_http_basic_auth').prop('checked', false);
|
||||
}
|
||||
if ($("#id_dynamicdns-service_type option:selected").text() == "selfhost.bz") {
|
||||
$('#id_dynamicdns-dynamicdns_update_url').val(SELFHOST);
|
||||
}
|
||||
if ($("#id_dynamicdns-service_type option:selected").text() == "freedns.afraid.org") {
|
||||
$('#id_dynamicdns-dynamicdns_update_url').val(FREEDNS);
|
||||
}
|
||||
if ($("#id_dynamicdns-service_type option:selected").text() == "other update URL") {
|
||||
$('#id_dynamicdns-dynamicdns_update_url').val('');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function set_gnudip_mode()
|
||||
{
|
||||
$('#id_dynamicdns-dynamicdns_update_url').closest('.form-group').hide();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user