Skip to content

Commit f89fcb3

Browse files
Update MerlinAU.asp
1 parent e69bab9 commit f89fcb3

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

MerlinAU.asp

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
<script language="JavaScript" type="text/javascript">
3030
3131
/**----------------------------**/
32-
/** Last Modified: 2025-Apr-09 **/
33-
/** Intended for 1.4.x Release **/
32+
/** Last Modified: 2025-May-10 **/
3433
/**----------------------------**/
3534
3635
// Separate variables for shared and AJAX settings //
@@ -70,6 +69,7 @@ var defaultFWUpdateZIPdirPath = '/home/root';
7069
var isEMailConfigEnabledInAMTM = false;
7170
var scriptAutoUpdateCronSchedHR = 'TBD';
7271
var fwAutoUpdateCheckCronSchedHR = 'TBD';
72+
var isScriptUpdateAvailable = false;
7373
7474
const validationErrorMsg = 'Validation failed. Please correct invalid value and try again.';
7575
@@ -988,6 +988,7 @@ function GetExternalCheckResults()
988988
if (externalCheckOK)
989989
{
990990
fwUpdateDirPath.ResetExtCheckVars();
991+
showScriptUpdateBanner();
991992
return true;
992993
}
993994
let fwUpdateZIPdirectory = document.getElementById('fwUpdateZIPDirectory');
@@ -2032,6 +2033,25 @@ function UpdateScriptVersion()
20322033
$('#footerTitle').text ('MerlinAU v' + localVers + ' by ExtremeFiretop & Martinski W.');
20332034
}
20342035
2036+
function showScriptUpdateBanner () {
2037+
const localVers = GetScriptVersion('local');
2038+
if (typeof isScriptUpdateAvailable === 'undefined') return;
2039+
2040+
if (isScriptUpdateAvailable && isScriptUpdateAvailable !== localVers) {
2041+
const host = document.getElementById('ScriptUpdateNotice');
2042+
if (!host) return;
2043+
2044+
host.innerHTML =
2045+
InvREDct +
2046+
'Script&nbsp;Update&nbsp;Available&nbsp;&rarr;&nbsp;v' +
2047+
isScriptUpdateAvailable +
2048+
InvCLEAR;
2049+
2050+
host.style.cssText =
2051+
'float:right;margin-left:auto;font-weight:bold;white-space:nowrap;';
2052+
}
2053+
}
2054+
20352055
/**----------------------------------------**/
20362056
/** Modified by Martinski W. [2025-Jan-20] **/
20372057
/**----------------------------------------**/
@@ -2271,16 +2291,16 @@ function UpdateMerlinAUScript ()
22712291
22722292
let ok = confirm(
22732293
forceUpdateBox.checked
2274-
? "FORCED UPDATE: install immediately—even if current.\n\nContinue?"
2275-
: "Install only if a newer version exists.\n\nContinue?");
2294+
? "INSTALL UPDATE: install immediately—even if current.\n\nContinue?"
2295+
: "Prompt if a newer version exists. (Does NOT install!) \n\nContinue?");
22762296
if (!ok) return false; // <-- blocks submission
22772297
22782298
document.form.action_script.value = actionScriptName;
22792299
document.form.action_wait.value = 10;
22802300
showLoading();
22812301
document.form.submit();
22822302
2283-
return false; // prevent the button’s own default submit (avoids double‑post)
2303+
return false;
22842304
}
22852305
22862306
/**----------------------------------------**/
@@ -2532,6 +2552,7 @@ function initializeCollapsibleSections()
25322552
href="https://github.com/ExtremeFiretop/MerlinAutoUpdate-Router/wiki"
25332553
title="Go to MerlinAU Wiki page" target="_blank">Wiki</a> ]
25342554
</span>
2555+
<span id="ScriptUpdateNotice"></span>
25352556
</div>
25362557
<div style="line-height:10px;">&nbsp;</div>
25372558
@@ -2669,7 +2690,7 @@ function initializeCollapsibleSections()
26692690
<input type="submit"
26702691
id="ScriptUpdateButton"
26712692
onclick="return UpdateMerlinAUScript();"
2672-
value="Update Script"
2693+
value="Script Update Check"
26732694
class="button_gen savebutton"
26742695
title="Check for latest MerlinAU script updates"
26752696
name="button">
@@ -2680,7 +2701,7 @@ function initializeCollapsibleSections()
26802701
name="ForceScriptUpdateCheck"
26812702
style="padding:0; vertical-align:middle; position:relative;
26822703
margin-left:-5px; margin-top:5px; margin-bottom:8px"/>
2683-
Force script update
2704+
Install script update
26842705
</label>
26852706
</br>
26862707
</td>

0 commit comments

Comments
 (0)