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';
7069var isEMailConfigEnabledInAMTM = false ;
7170var scriptAutoUpdateCronSchedHR = ' TBD' ;
7271var fwAutoUpdateCheckCronSchedHR = ' TBD' ;
72+ var isScriptUpdateAvailable = ' TBD' ;
7373
7474const 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' );
@@ -1569,6 +1570,7 @@ function InitializeFields()
15691570 // fallback to 'DISABLED' if custom_settings.FW_Update_Check is missing //
15701571
15711572 $ (' #KeepConfigFile' ).prop (' checked' ,false );
1573+ $ (' #ForceScriptUpdateCheck' ).prop (' checked' ,false );
15721574 $ (' #BypassPostponedDays' ).prop (' checked' ,false );
15731575 $ (' #RunLoginTestOnSave' ).prop (' checked' ,false );
15741576
@@ -2032,6 +2034,28 @@ function UpdateScriptVersion()
20322034 $ (' #footerTitle' ).text (' MerlinAU v' + localVers + ' by ExtremeFiretop & Martinski W.' );
20332035}
20342036
2037+ /* *---------------------------------------**/
2038+ /* * Added by ExtremeFiretop [2025-May-10] **/
2039+ /* *---------------------------------------**/
2040+ function showScriptUpdateBanner () {
2041+ const localVers = GetScriptVersion (' local' );
2042+ if (typeof isScriptUpdateAvailable === ' undefined' ) return ;
2043+
2044+ if (isScriptUpdateAvailable && isScriptUpdateAvailable !== localVers) {
2045+ const host = document .getElementById (' ScriptUpdateNotice' );
2046+ if (! host) return ;
2047+
2048+ host .innerHTML =
2049+ InvREDct +
2050+ ' Script Update Available → v' +
2051+ isScriptUpdateAvailable +
2052+ InvCLEAR;
2053+
2054+ host .style .cssText =
2055+ ' float:right;margin-left:auto;font-weight:bold;white-space:nowrap;' ;
2056+ }
2057+ }
2058+
20352059/* *----------------------------------------**/
20362060/* * Modified by Martinski W. [2025-Jan-20] **/
20372061/* *----------------------------------------**/
@@ -2260,6 +2284,32 @@ function Uninstall()
22602284 document .form .submit ();
22612285}
22622286
2287+ /* *---------------------------------------**/
2288+ /* * Added by ExtremeFiretop [2025-May-10] **/
2289+ /* *---------------------------------------**/
2290+ function UpdateMerlinAUScript ()
2291+ {
2292+ console .log (" Initiating MerlinAU script update…" );
2293+
2294+ let actionScriptValue;
2295+ let ForceScriptUpdateCheck = document .getElementById (' ForceScriptUpdateCheck' );
2296+ let ok = confirm (
2297+ ForceScriptUpdateCheck .checked
2298+ ? " INSTALL UPDATE: Install MerlinAU script update immediately. Even if current.\n\n Continue?"
2299+ : " VERIFY AND PROMPT: Check for a newer version of MerlinAU and prompt if found. Does NOT install! \n\n Continue?" );
2300+ if (! ok) return ;
2301+
2302+ if (! ForceScriptUpdateCheck .checked )
2303+ { actionScriptValue = ' start_MerlinAUupdate' ; }
2304+ else
2305+ { actionScriptValue = ' start_MerlinAUupdate_forceupdate' ; }
2306+
2307+ document .form .action_script .value = actionScriptValue;
2308+ document .form .action_wait .value = 10 ;
2309+ showLoading ();
2310+ document .form .submit ();
2311+ }
2312+
22632313/* *----------------------------------------**/
22642314/* * Modified by Martinski W. [2025-Jan-22] **/
22652315/* *----------------------------------------**/
@@ -2509,6 +2559,7 @@ function initializeCollapsibleSections()
25092559 href=" https: //github.com /ExtremeFiretop /MerlinAutoUpdate-Router /wiki "
25102560 title=" Go to MerlinAU Wiki page " target=" _blank " >Wiki</a> ]
25112561</span>
2562+ <span id=" ScriptUpdateNotice " ></span>
25122563</div>
25132564<div style=" line-height:10px; " >  ; </div>
25142565
@@ -2618,9 +2669,10 @@ function initializeCollapsibleSections()
26182669<div style=" text-align: center; margin-top: 3px; " >
26192670<table width=" 100% " border=" 0 " cellpadding=" 10 " cellspacing=" 0 " style=" table-layout: fixed; border-collapse: collapse; background-color: transparent; " >
26202671<colgroup>
2621- <col style=" width: 33%; " />
2622- <col style=" width: 33%; " />
2623- <col style=" width: 33%; " />
2672+ <col style=" width: 25%; " />
2673+ <col style=" width: 25%; " />
2674+ <col style=" width: 25%; " />
2675+ <col style=" width: 25%; " />
26242676</colgroup>
26252677<tr>
26262678<td style=" text-align: right; border: none; " >
@@ -2638,9 +2690,28 @@ function initializeCollapsibleSections()
26382690 <br>
26392691 <label style=" color:#FFCC00; margin-top: 5px; margin-bottom:8x " >
26402692 <input type=" checkbox " id=" approveChangelogCheck " name=" approveChangelogCheck " onclick=" ToggleChangelogApproval(this); "
2641- style=" padding:0; vertical-align:middle; position:relative; margin-left:-5px; margin-top:5px; margin-bottom:8px " />Approve Changelog </label>
2693+ style=" padding:0; vertical-align:middle; position:relative; margin-left:-5px; margin-top:5px; margin-bottom:8px " />Approve changelog </label>
26422694 </br>
26432695</td>
2696+ <td style=" text-align: center; border: none; " id=" scriptUpdateCell " >
2697+ <input type=" submit "
2698+ id=" ScriptUpdateButton "
2699+ onclick=" UpdateMerlinAUScript(); return false; "
2700+ value=" Script Update Check "
2701+ class=" button_gen savebutton "
2702+ title=" Check for latest MerlinAU script updates "
2703+ name=" button " >
2704+ <br>
2705+ <label style=" color:#FFCC00; margin-top: 5px; margin-bottom:8px " >
2706+ <input type=" checkbox "
2707+ id=" ForceScriptUpdateCheck "
2708+ name=" ForceScriptUpdateCheck "
2709+ style=" padding:0; vertical-align:middle; position:relative;
2710+ margin-left:-5px; margin-top:5px; margin-bottom:8px " />
2711+ Install script update
2712+ </label>
2713+ </br>
2714+ </td>
26442715<td style=" text-align: left; border: none; " >
26452716 <input type=" submit " id=" UninstallButton " onclick=" Uninstall(); return false; "
26462717 value=" Uninstall " class=" button_gen savebutton " name=" button " >
0 commit comments