zone.js: updated code for zone options implementation changes and other minor features.

This commit is contained in:
Shreyas Zare
2024-09-21 12:57:28 +05:30
parent aa77004418
commit 5d9fc8a74d

View File

@@ -568,17 +568,17 @@ function refreshZones(checkDisplay, pageNumber) {
var nameTags; var nameTags;
if (zones[i].catalog != null) { if (zones[i].catalog != null) {
nameTags = "<div><span class=\"label label-default\">" + htmlEncode(zones[i].catalog) + "</span></div>"; nameTags = "<div><span id=\"tagZoneCatalogName" + id + "\" class=\"label label-default\">" + htmlEncode(zones[i].catalog) + "</span></div>";
} }
else { else {
switch (zones[i].type) { switch (zones[i].type) {
case "Catalog": case "Catalog":
case "SecondaryCatalog": case "SecondaryCatalog":
nameTags = "<div><span class=\"label label-info\">" + htmlEncode(name) + "</span></div>"; nameTags = "<div><span id=\"tagZoneCatalogName" + id + "\" class=\"label label-info\">" + htmlEncode(name) + "</span></div>";
break; break;
default: default:
nameTags = ""; nameTags = "<div><span id=\"tagZoneCatalogName" + id + "\" class=\"label label-default\" style=\"display: none;\"></span></div>";
break; break;
} }
} }
@@ -621,7 +621,7 @@ function refreshZones(checkDisplay, pageNumber) {
} }
if (!hideOptionsMenu) { if (!hideOptionsMenu) {
tableHtmlRows += "<li><a href=\"#\" onclick=\"showZoneOptionsModal('" + name + "'); return false;\">Zone Options</a></li>"; tableHtmlRows += "<li><a href=\"#\" onclick=\"$('#btnSaveZoneOptions').attr('data-zones-row-id', " + id + "); showZoneOptionsModal('" + name + "'); return false;\">Zone Options</a></li>";
} }
if (!zones[i].internal) { if (!zones[i].internal) {
@@ -1178,7 +1178,13 @@ function showZoneOptionsModal(zone) {
$("#optZoneOptionsCatalogZoneName").html("<option selected>" + htmlEncode(responseJSON.response.catalog) + "</option>"); $("#optZoneOptionsCatalogZoneName").html("<option selected>" + htmlEncode(responseJSON.response.catalog) + "</option>");
$("#optZoneOptionsCatalogZoneName").prop("disabled", true); $("#optZoneOptionsCatalogZoneName").prop("disabled", true);
$("#divZoneOptionsCatalogOverrideOptions").hide(); $("#chkZoneOptionsCatalogOverrideQueryAccess").prop("checked", responseJSON.response.overrideCatalogQueryAccess);
$("#chkZoneOptionsCatalogOverrideQueryAccess").prop("disabled", true);
$("#divZoneOptionsCatalogOverrideZoneTransfer").hide();
$("#divZoneOptionsCatalogOverrideNotify").hide();
$("#divZoneOptionsCatalogOverrideOptions").show();
$("#divZoneOptionsGeneralCatalogZone").show(); $("#divZoneOptionsGeneralCatalogZone").show();
$("#tabListZoneOptionsGeneral").show(); $("#tabListZoneOptionsGeneral").show();
} else { } else {
@@ -1203,12 +1209,39 @@ function showZoneOptionsModal(zone) {
break; break;
case "Secondary": case "Secondary":
if (responseJSON.response.catalog != null) {
$("#optZoneOptionsCatalogZoneName").html("<option selected>" + htmlEncode(responseJSON.response.catalog) + "</option>");
$("#optZoneOptionsCatalogZoneName").prop("disabled", true);
$("#chkZoneOptionsCatalogOverrideQueryAccess").prop("checked", responseJSON.response.overrideCatalogQueryAccess);
$("#chkZoneOptionsCatalogOverrideZoneTransfer").prop("checked", responseJSON.response.overrideCatalogZoneTransfer);
$("#chkZoneOptionsCatalogOverrideQueryAccess").prop("disabled", true);
$("#chkZoneOptionsCatalogOverrideZoneTransfer").prop("disabled", true);
$("#divZoneOptionsCatalogOverrideZoneTransfer").show();
$("#divZoneOptionsCatalogOverrideNotify").hide();
$("#divZoneOptionsCatalogOverrideOptions").show();
$("#divZoneOptionsGeneralCatalogZone").show();
$("#tabListZoneOptionsGeneral").show();
} else {
$("#divZoneOptionsGeneralCatalogZone").hide();
}
break;
case "SecondaryForwarder": case "SecondaryForwarder":
if (responseJSON.response.catalog != null) { if (responseJSON.response.catalog != null) {
$("#optZoneOptionsCatalogZoneName").html("<option selected>" + htmlEncode(responseJSON.response.catalog) + "</option>"); $("#optZoneOptionsCatalogZoneName").html("<option selected>" + htmlEncode(responseJSON.response.catalog) + "</option>");
$("#optZoneOptionsCatalogZoneName").prop("disabled", true); $("#optZoneOptionsCatalogZoneName").prop("disabled", true);
$("#divZoneOptionsCatalogOverrideOptions").hide(); $("#chkZoneOptionsCatalogOverrideQueryAccess").prop("checked", responseJSON.response.overrideCatalogQueryAccess);
$("#chkZoneOptionsCatalogOverrideQueryAccess").prop("disabled", true);
$("#divZoneOptionsCatalogOverrideZoneTransfer").hide();
$("#divZoneOptionsCatalogOverrideNotify").hide();
$("#divZoneOptionsCatalogOverrideOptions").show();
$("#divZoneOptionsGeneralCatalogZone").show(); $("#divZoneOptionsGeneralCatalogZone").show();
$("#tabListZoneOptionsGeneral").show(); $("#tabListZoneOptionsGeneral").show();
} else { } else {
@@ -1329,70 +1362,99 @@ function showZoneOptionsModal(zone) {
} }
//query access //query access
switch (responseJSON.response.type) { {
case "Primary": switch (responseJSON.response.queryAccess) {
case "Stub": case "Allow":
case "Forwarder": $("#rdQueryAccessAllow").prop("checked", true);
case "Secondary": break;
case "SecondaryForwarder":
case "Catalog":
switch (responseJSON.response.queryAccess) {
case "Allow":
$("#rdQueryAccessAllow").prop("checked", true);
break;
case "AllowOnlyPrivateNetworks": case "AllowOnlyPrivateNetworks":
$("#rdQueryAccessAllowOnlyPrivateNetworks").prop("checked", true); $("#rdQueryAccessAllowOnlyPrivateNetworks").prop("checked", true);
break; break;
case "AllowOnlyZoneNameServers": case "AllowOnlyZoneNameServers":
$("#rdQueryAccessAllowOnlyZoneNameServers").prop("checked", true); $("#rdQueryAccessAllowOnlyZoneNameServers").prop("checked", true);
break; break;
case "UseSpecifiedNetworkACL": case "UseSpecifiedNetworkACL":
$("#rdQueryAccessUseSpecifiedNetworkACL").prop("checked", true); $("#rdQueryAccessUseSpecifiedNetworkACL").prop("checked", true);
$("#txtQueryAccessNetworkACL").prop("disabled", false); $("#txtQueryAccessNetworkACL").prop("disabled", false);
break; break;
case "AllowZoneNameServersAndUseSpecifiedNetworkACL": case "AllowZoneNameServersAndUseSpecifiedNetworkACL":
$("#rdQueryAccessAllowZoneNameServersAndUseSpecifiedNetworkACL").prop("checked", true); $("#rdQueryAccessAllowZoneNameServersAndUseSpecifiedNetworkACL").prop("checked", true);
$("#txtQueryAccessNetworkACL").prop("disabled", false); $("#txtQueryAccessNetworkACL").prop("disabled", false);
break; break;
case "Deny": case "Deny":
default: default:
$("#rdQueryAccessDeny").prop("checked", true); $("#rdQueryAccessDeny").prop("checked", true);
break; break;
} }
switch (responseJSON.response.type) { switch (responseJSON.response.type) {
case "Stub": case "Stub":
case "Forwarder": case "Forwarder":
case "SecondaryForwarder": case "SecondaryForwarder":
case "Catalog": case "Catalog":
$("#divQueryAccessAllowOnlyZoneNameServers").hide(); case "SecondaryCatalog":
$("#divQueryAccessAllowZoneNameServersAndUseSpecifiedNetworkACL").hide(); $("#divQueryAccessAllowOnlyZoneNameServers").hide();
break; $("#divQueryAccessAllowZoneNameServersAndUseSpecifiedNetworkACL").hide();
break;
default: default:
$("#divQueryAccessAllowOnlyZoneNameServers").show(); $("#divQueryAccessAllowOnlyZoneNameServers").show();
$("#divQueryAccessAllowZoneNameServersAndUseSpecifiedNetworkACL").show(); $("#divQueryAccessAllowZoneNameServersAndUseSpecifiedNetworkACL").show();
break; break;
} }
{ {
var value = ""; var value = "";
for (var i = 0; i < responseJSON.response.queryAccessNetworkACL.length; i++) for (var i = 0; i < responseJSON.response.queryAccessNetworkACL.length; i++)
value += responseJSON.response.queryAccessNetworkACL[i] + "\r\n"; value += responseJSON.response.queryAccessNetworkACL[i] + "\r\n";
$("#txtQueryAccessNetworkACL").val(value); $("#txtQueryAccessNetworkACL").val(value);
} }
switch (responseJSON.response.type) { switch (responseJSON.response.type) {
case "Primary": case "Primary":
case "Forwarder": case "Forwarder":
case "Catalog": case "Catalog":
if ((responseJSON.response.catalog == null) || responseJSON.response.overrideCatalogQueryAccess) {
$("#rdQueryAccessDeny").prop("disabled", false);
$("#rdQueryAccessAllow").prop("disabled", false);
$("#rdQueryAccessAllowOnlyPrivateNetworks").prop("disabled", false);
$("#rdQueryAccessAllowOnlyZoneNameServers").prop("disabled", false);
$("#rdQueryAccessUseSpecifiedNetworkACL").prop("disabled", false);
$("#rdQueryAccessAllowZoneNameServersAndUseSpecifiedNetworkACL").prop("disabled", false);
$("#tabListZoneOptionsQueryAccess").show();
}
else {
$("#tabListZoneOptionsQueryAccess").hide();
}
break;
case "Stub":
if ((responseJSON.response.catalog != null) && responseJSON.response.isSecondaryCatalogMember) {
if (responseJSON.response.overrideCatalogQueryAccess) {
$("#rdQueryAccessDeny").prop("disabled", true);
$("#rdQueryAccessAllow").prop("disabled", true);
$("#rdQueryAccessAllowOnlyPrivateNetworks").prop("disabled", true);
$("#rdQueryAccessAllowOnlyZoneNameServers").prop("disabled", true);
$("#rdQueryAccessUseSpecifiedNetworkACL").prop("disabled", true);
$("#rdQueryAccessAllowZoneNameServersAndUseSpecifiedNetworkACL").prop("disabled", true);
$("#txtQueryAccessNetworkACL").prop("disabled", true);
$("#tabListZoneOptionsQueryAccess").show();
}
else {
$("#tabListZoneOptionsQueryAccess").hide();
}
}
else {
if ((responseJSON.response.catalog == null) || responseJSON.response.overrideCatalogQueryAccess) { if ((responseJSON.response.catalog == null) || responseJSON.response.overrideCatalogQueryAccess) {
$("#rdQueryAccessDeny").prop("disabled", false); $("#rdQueryAccessDeny").prop("disabled", false);
$("#rdQueryAccessAllow").prop("disabled", false); $("#rdQueryAccessAllow").prop("disabled", false);
@@ -1406,31 +1468,13 @@ function showZoneOptionsModal(zone) {
else { else {
$("#tabListZoneOptionsQueryAccess").hide(); $("#tabListZoneOptionsQueryAccess").hide();
} }
}
break; break;
case "Stub": case "Secondary":
if ((responseJSON.response.catalog == null) || responseJSON.response.isSecondaryCatalogMember || responseJSON.response.overrideCatalogQueryAccess) { case "SecondaryForwarder":
$("#rdQueryAccessDeny").prop("disabled", responseJSON.response.isSecondaryCatalogMember == true); if ((responseJSON.response.catalog == null) || responseJSON.response.overrideCatalogQueryAccess) {
$("#rdQueryAccessAllow").prop("disabled", responseJSON.response.isSecondaryCatalogMember == true);
$("#rdQueryAccessAllowOnlyPrivateNetworks").prop("disabled", responseJSON.response.isSecondaryCatalogMember == true);
$("#rdQueryAccessAllowOnlyZoneNameServers").prop("disabled", responseJSON.response.isSecondaryCatalogMember == true);
$("#rdQueryAccessUseSpecifiedNetworkACL").prop("disabled", responseJSON.response.isSecondaryCatalogMember == true);
$("#rdQueryAccessAllowZoneNameServersAndUseSpecifiedNetworkACL").prop("disabled", responseJSON.response.isSecondaryCatalogMember == true);
if (responseJSON.response.isSecondaryCatalogMember == true)
$("#txtQueryAccessNetworkACL").prop("disabled", true);
$("#tabListZoneOptionsQueryAccess").show();
}
else {
$("#tabListZoneOptionsQueryAccess").hide();
}
break;
case "Secondary":
case "SecondaryForwarder":
$("#rdQueryAccessDeny").prop("disabled", responseJSON.response.catalog != null); $("#rdQueryAccessDeny").prop("disabled", responseJSON.response.catalog != null);
$("#rdQueryAccessAllow").prop("disabled", responseJSON.response.catalog != null); $("#rdQueryAccessAllow").prop("disabled", responseJSON.response.catalog != null);
$("#rdQueryAccessAllowOnlyPrivateNetworks").prop("disabled", responseJSON.response.catalog != null); $("#rdQueryAccessAllowOnlyPrivateNetworks").prop("disabled", responseJSON.response.catalog != null);
@@ -1442,27 +1486,38 @@ function showZoneOptionsModal(zone) {
$("#txtQueryAccessNetworkACL").prop("disabled", true); $("#txtQueryAccessNetworkACL").prop("disabled", true);
$("#tabListZoneOptionsQueryAccess").show(); $("#tabListZoneOptionsQueryAccess").show();
break; }
else {
default:
$("#tabListZoneOptionsQueryAccess").hide(); $("#tabListZoneOptionsQueryAccess").hide();
break; }
}
break; break;
default: case "SecondaryCatalog":
$("#tabListZoneOptionsQueryAccess").hide(); $("#rdQueryAccessDeny").prop("disabled", true);
break; $("#rdQueryAccessAllow").prop("disabled", true);
$("#rdQueryAccessAllowOnlyPrivateNetworks").prop("disabled", true);
$("#rdQueryAccessAllowOnlyZoneNameServers").prop("disabled", true);
$("#rdQueryAccessUseSpecifiedNetworkACL").prop("disabled", true);
$("#rdQueryAccessAllowZoneNameServersAndUseSpecifiedNetworkACL").prop("disabled", true);
$("#txtQueryAccessNetworkACL").prop("disabled", true);
$("#tabListZoneOptionsQueryAccess").show();
break;
default:
$("#tabListZoneOptionsQueryAccess").hide();
break;
}
} }
//zone transfer & notify //zone transfer
switch (responseJSON.response.type) { switch (responseJSON.response.type) {
case "Primary": case "Primary":
case "Secondary": case "Secondary":
case "Forwarder": case "Forwarder":
case "Catalog": case "Catalog":
//zone transfer case "SecondaryCatalog":
switch (responseJSON.response.zoneTransfer) { switch (responseJSON.response.zoneTransfer) {
case "Allow": case "Allow":
$("#rdZoneTransferAllow").prop("checked", true); $("#rdZoneTransferAllow").prop("checked", true);
@@ -1524,6 +1579,7 @@ function showZoneOptionsModal(zone) {
switch (responseJSON.response.type) { switch (responseJSON.response.type) {
case "Forwarder": case "Forwarder":
case "Catalog": case "Catalog":
case "SecondaryCatalog":
$("#divZoneTransferAllowOnlyZoneNameServers").hide(); $("#divZoneTransferAllowOnlyZoneNameServers").hide();
$("#divZoneTransferAllowZoneNameServersAndUseSpecifiedNetworkACL").hide(); $("#divZoneTransferAllowZoneNameServersAndUseSpecifiedNetworkACL").hide();
break; break;
@@ -1534,7 +1590,87 @@ function showZoneOptionsModal(zone) {
break; break;
} }
//notify switch (responseJSON.response.type) {
case "Primary":
case "Forwarder":
if ((responseJSON.response.catalog == null) || responseJSON.response.overrideCatalogZoneTransfer) {
$("#rdZoneTransferDeny").prop("disabled", false);
$("#rdZoneTransferAllow").prop("disabled", false);
$("#rdZoneTransferAllowOnlyZoneNameServers").prop("disabled", false);
$("#rdZoneTransferUseSpecifiedNetworkACL").prop("disabled", false);
$("#rdZoneTransferAllowZoneNameServersAndUseSpecifiedNetworkACL").prop("disabled", false);
$("#txtZoneOptionsZoneTransferTsigKeyNames").prop("disabled", false);
$("#optZoneOptionsQuickTsigKeyNames").prop("disabled", false);
$("#tabListZoneOptionsZoneTranfer").show();
}
else {
$("#tabListZoneOptionsZoneTranfer").hide();
}
break;
case "Secondary":
if ((responseJSON.response.catalog == null) || responseJSON.response.overrideCatalogZoneTransfer) {
$("#rdZoneTransferDeny").prop("disabled", responseJSON.response.catalog != null);
$("#rdZoneTransferAllow").prop("disabled", responseJSON.response.catalog != null);
$("#rdZoneTransferAllowOnlyZoneNameServers").prop("disabled", responseJSON.response.catalog != null);
$("#rdZoneTransferUseSpecifiedNetworkACL").prop("disabled", responseJSON.response.catalog != null);
$("#rdZoneTransferAllowZoneNameServersAndUseSpecifiedNetworkACL").prop("disabled", responseJSON.response.catalog != null);
if (responseJSON.response.catalog != null)
$("#txtZoneTransferNetworkACL").prop("disabled", true);
$("#txtZoneOptionsZoneTransferTsigKeyNames").prop("disabled", responseJSON.response.catalog != null);
$("#optZoneOptionsQuickTsigKeyNames").prop("disabled", responseJSON.response.catalog != null);
$("#tabListZoneOptionsZoneTranfer").show();
}
else {
$("#tabListZoneOptionsZoneTranfer").hide();
}
break;
case "Catalog":
$("#rdZoneTransferDeny").prop("disabled", false);
$("#rdZoneTransferAllow").prop("disabled", false);
$("#rdZoneTransferAllowOnlyZoneNameServers").prop("disabled", false);
$("#rdZoneTransferUseSpecifiedNetworkACL").prop("disabled", false);
$("#rdZoneTransferAllowZoneNameServersAndUseSpecifiedNetworkACL").prop("disabled", false);
$("#txtZoneOptionsZoneTransferTsigKeyNames").prop("disabled", false);
$("#optZoneOptionsQuickTsigKeyNames").prop("disabled", false);
$("#tabListZoneOptionsZoneTranfer").show();
break;
case "SecondaryCatalog":
$("#rdZoneTransferDeny").prop("disabled", true);
$("#rdZoneTransferAllow").prop("disabled", true);
$("#rdZoneTransferAllowOnlyZoneNameServers").prop("disabled", true);
$("#rdZoneTransferUseSpecifiedNetworkACL").prop("disabled", true);
$("#rdZoneTransferAllowZoneNameServersAndUseSpecifiedNetworkACL").prop("disabled", true);
$("#txtZoneTransferNetworkACL").prop("disabled", true);
$("#txtZoneOptionsZoneTransferTsigKeyNames").prop("disabled", true);
$("#optZoneOptionsQuickTsigKeyNames").prop("disabled", true);
$("#tabListZoneOptionsZoneTranfer").show();
break;
}
break;
default:
$("#tabListZoneOptionsZoneTranfer").hide();
break;
}
//notify
switch (responseJSON.response.type) {
case "Primary":
case "Secondary":
case "Forwarder":
case "Catalog":
switch (responseJSON.response.notify) { switch (responseJSON.response.notify) {
case "ZoneNameServers": case "ZoneNameServers":
$("#rdZoneNotifyZoneNameServers").prop("checked", true); $("#rdZoneNotifyZoneNameServers").prop("checked", true);
@@ -1575,8 +1711,10 @@ function showZoneOptionsModal(zone) {
value += ", " + responseJSON.response.notifyFailedFor[i]; value += ", " + responseJSON.response.notifyFailedFor[i];
} }
$("#divZoneOptionsCatalogNotifyFailedNameServers").show(); if ((responseJSON.response.catalog != null) && !responseJSON.response.overrideCatalogNotify) {
$("#lblZoneOptionsCatalogNotifyFailedNameServers").text(value); $("#divZoneOptionsCatalogNotifyFailedNameServers").show();
$("#lblZoneOptionsCatalogNotifyFailedNameServers").text(value);
}
$("#divZoneNotifyFailedNameServers").show(); $("#divZoneNotifyFailedNameServers").show();
$("#lblZoneNotifyFailedNameServers").text(value); $("#lblZoneNotifyFailedNameServers").text(value);
@@ -1601,21 +1739,6 @@ function showZoneOptionsModal(zone) {
switch (responseJSON.response.type) { switch (responseJSON.response.type) {
case "Primary": case "Primary":
case "Forwarder": case "Forwarder":
if ((responseJSON.response.catalog == null) || responseJSON.response.overrideCatalogZoneTransfer) {
$("#rdZoneTransferDeny").prop("disabled", false);
$("#rdZoneTransferAllow").prop("disabled", false);
$("#rdZoneTransferAllowOnlyZoneNameServers").prop("disabled", false);
$("#rdZoneTransferUseSpecifiedNetworkACL").prop("disabled", false);
$("#rdZoneTransferAllowZoneNameServersAndUseSpecifiedNetworkACL").prop("disabled", false);
$("#txtZoneOptionsZoneTransferTsigKeyNames").prop("disabled", false);
$("#optZoneOptionsQuickTsigKeyNames").prop("disabled", false);
$("#tabListZoneOptionsZoneTranfer").show();
}
else {
$("#tabListZoneOptionsZoneTranfer").hide();
}
if ((responseJSON.response.catalog == null) || responseJSON.response.overrideCatalogNotify) if ((responseJSON.response.catalog == null) || responseJSON.response.overrideCatalogNotify)
$("#tabListZoneOptionsNotify").show(); $("#tabListZoneOptionsNotify").show();
else else
@@ -1624,40 +1747,13 @@ function showZoneOptionsModal(zone) {
break; break;
case "Secondary": case "Secondary":
$("#rdZoneTransferDeny").prop("disabled", responseJSON.response.catalog != null);
$("#rdZoneTransferAllow").prop("disabled", responseJSON.response.catalog != null);
$("#rdZoneTransferAllowOnlyZoneNameServers").prop("disabled", responseJSON.response.catalog != null);
$("#rdZoneTransferUseSpecifiedNetworkACL").prop("disabled", responseJSON.response.catalog != null);
$("#rdZoneTransferAllowZoneNameServersAndUseSpecifiedNetworkACL").prop("disabled", responseJSON.response.catalog != null);
if (responseJSON.response.catalog != null)
$("#txtZoneTransferNetworkACL").prop("disabled", true);
$("#txtZoneOptionsZoneTransferTsigKeyNames").prop("disabled", responseJSON.response.catalog != null);
$("#optZoneOptionsQuickTsigKeyNames").prop("disabled", responseJSON.response.catalog != null);
$("#tabListZoneOptionsZoneTranfer").show();
$("#tabListZoneOptionsNotify").show();
break;
case "Catalog": case "Catalog":
$("#rdZoneTransferDeny").prop("disabled", false);
$("#rdZoneTransferAllow").prop("disabled", false);
$("#rdZoneTransferAllowOnlyZoneNameServers").prop("disabled", false);
$("#rdZoneTransferUseSpecifiedNetworkACL").prop("disabled", false);
$("#rdZoneTransferAllowZoneNameServersAndUseSpecifiedNetworkACL").prop("disabled", false);
$("#txtZoneOptionsZoneTransferTsigKeyNames").prop("disabled", false);
$("#optZoneOptionsQuickTsigKeyNames").prop("disabled", false);
$("#tabListZoneOptionsZoneTranfer").show();
$("#tabListZoneOptionsNotify").show(); $("#tabListZoneOptionsNotify").show();
break; break;
} }
break; break;
default: default:
$("#tabListZoneOptionsZoneTranfer").hide();
$("#tabListZoneOptionsNotify").hide(); $("#tabListZoneOptionsNotify").hide();
break; break;
} }
@@ -1918,25 +2014,42 @@ function saveZoneOptions() {
btn.button("reset"); btn.button("reset");
$("#modalZoneOptions").modal("hide"); $("#modalZoneOptions").modal("hide");
switch (zoneType) { var zonesRowId = $("#btnSaveZoneOptions").attr("data-zones-row-id");
case "Catalog": if (zonesRowId == null) {
case "SecondaryCatalog": switch (zoneType) {
$("#titleEditZoneCatalog").attr("class", "label label-info"); case "Catalog":
$("#titleEditZoneCatalog").text(zone); case "SecondaryCatalog":
$("#titleEditZoneCatalog").show(); break;
break;
default: default:
if ((catalog == null) || (catalog == "")) { if ((catalog == null) || (catalog == "")) {
$("#titleEditZoneCatalog").hide(); $("#titleEditZoneCatalog").hide();
} }
else { else {
$("#titleEditZoneCatalog").attr("class", "label label-default"); $("#titleEditZoneCatalog").attr("class", "label label-default");
$("#titleEditZoneCatalog").text(catalog); $("#titleEditZoneCatalog").text(catalog);
$("#titleEditZoneCatalog").show(); $("#titleEditZoneCatalog").show();
} }
break; break;
}
}
else {
switch (zoneType) {
case "Catalog":
case "SecondaryCatalog":
break;
default:
if ((catalog == null) || (catalog == "")) {
$("#tagZoneCatalogName" + zonesRowId).hide();
}
else {
$("#tagZoneCatalogName" + zonesRowId).text(catalog);
$("#tagZoneCatalogName" + zonesRowId).show();
}
break;
}
} }
showAlert("success", "Options Saved!", "Zone options were saved successfully."); showAlert("success", "Options Saved!", "Zone options were saved successfully.");