Skip to content

Commit 393f9c0

Browse files
Update MerlinAU.asp
1 parent 8075b31 commit 393f9c0

File tree

1 file changed

+62
-4
lines changed

1 file changed

+62
-4
lines changed

MerlinAU.asp

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,7 @@ function InitializeFields()
12641264
12651265
// Call the visibility handler //
12661266
handleROGFWBuildTypeVisibility();
1267+
updateTUFROGAvailText();
12671268
console.log("Initializing was completed successfully.");
12681269
}
12691270
else
@@ -1902,6 +1903,55 @@ document.addEventListener("DOMContentLoaded", function()
19021903
FormatFirmwareVersion();
19031904
});
19041905
1906+
function updateTUFROGAvailText() {
1907+
// For ROG
1908+
let rogSelect = document.getElementById('rogFWBuildType');
1909+
let rogMsgSpan = document.getElementById('rogFWBuildTypeAvailMsg');
1910+
if (rogSelect && rogMsgSpan) {
1911+
if (rogSelect.value === 'ROG') {
1912+
rogMsgSpan.style.display = 'inline-block';
1913+
} else {
1914+
rogMsgSpan.style.display = 'none';
1915+
}
1916+
}
1917+
1918+
// For TUF
1919+
let tufSelect = document.getElementById('tuffFWBuildType');
1920+
let tufMsgSpan = document.getElementById('tuffFWBuildTypeAvailMsg');
1921+
if (tufSelect && tufMsgSpan) {
1922+
if (tufSelect.value === 'TUF') {
1923+
tufMsgSpan.style.display = 'inline-block';
1924+
} else {
1925+
tufMsgSpan.style.display = 'none';
1926+
}
1927+
}
1928+
}
1929+
1930+
function handleTUFROGChange(selectElem) {
1931+
// If user picks TUF or ROG, show the popup alert
1932+
if (selectElem.value === 'TUF' || selectElem.value === 'ROG') {
1933+
alert("The TUF/ROG Build will only apply if a compatible TUF firmware image is available. Otherwise, the Pure Build will be used.");
1934+
}
1935+
1936+
// Show or hide the "if available" text next to the relevant dropdown
1937+
if (selectElem.id === 'rogFWBuildType') {
1938+
let rogMsgSpan = document.getElementById('rogFWBuildTypeAvailMsg');
1939+
if (selectElem.value === 'ROG') {
1940+
rogMsgSpan.style.display = 'inline-block';
1941+
} else {
1942+
rogMsgSpan.style.display = 'none';
1943+
}
1944+
}
1945+
else if (selectElem.id === 'tuffFWBuildType') {
1946+
let tufMsgSpan = document.getElementById('tuffFWBuildTypeAvailMsg');
1947+
if (selectElem.value === 'TUF') {
1948+
tufMsgSpan.style.display = 'inline-block';
1949+
} else {
1950+
tufMsgSpan.style.display = 'none';
1951+
}
1952+
}
1953+
}
1954+
19051955
function initializeCollapsibleSections()
19061956
{
19071957
if (typeof jQuery !== 'undefined')
@@ -2303,20 +2353,28 @@ function initializeCollapsibleSections()
23032353
<tr id="rogFWBuildRow">
23042354
<td style="text-align: left;"><label for="rogFWBuildType">ROG F/W Build Type</label></td>
23052355
<td>
2306-
<select id="rogFWBuildType" name="rogFWBuildType" style="width: 20%;">
2356+
<select id="rogFWBuildType" name="rogFWBuildType" style="width: 20%;" onchange="handleTUFROGChange(this)">
23072357
<option value="ROG">ROG</option>
23082358
<option value="Pure">Pure</option>
23092359
</select>
2310-
</td>
2360+
<span id="rogFWBuildTypeAvailMsg"
2361+
style="margin-left:10px; display:none; font-size:12px; font-weight:bolder;">
2362+
Note: Only if available
2363+
</span>
2364+
</td>
23112365
</tr>
23122366
<tr id="tuffFWBuildRow">
23132367
<td style="text-align: left;"><label for="tuffFWBuildType">TUF F/W Build Type</label></td>
23142368
<td>
2315-
<select id="tuffFWBuildType" name="tuffFWBuildType" style="width: 20%;">
2369+
<select id="tuffFWBuildType" name="tuffFWBuildType" style="width: 20%;" onchange="handleTUFROGChange(this)">
23162370
<option value="TUF">TUF</option>
23172371
<option value="Pure">Pure</option>
23182372
</select>
2319-
</td>
2373+
<span id="tuffFWBuildTypeAvailMsg"
2374+
style="margin-left:10px; display:none; font-size:12px; font-weight:bolder;">
2375+
Note: Only if available
2376+
</span>
2377+
</td>
23202378
</tr>
23212379
<tr>
23222380
<td style="text-align: left;"><label for="emailNotificationsEnabled">Enable F/W Update Email Notifications</label></td>

0 commit comments

Comments
 (0)