2929<script language =" JavaScript" type =" text/javascript" >
3030
3131/* *----------------------------**/
32- /* * Last Modified: 2025-Mar-07 **/
32+ /* * Last Modified: 2025-Mar-10 **/
3333/* * Intended for 1.4.x Release **/
3434/* *----------------------------**/
3535
@@ -796,14 +796,16 @@ const fwUpdateDirPath =
796796 }
797797};
798798
799- function ShowLatestChangelog () {
799+ function ShowLatestChangelog ()
800+ {
800801 document .form .action_script .value = ' start_MerlinAUdownloadchangelog' ;
801802 document .form .action_wait .value = 10 ;
802803
803- // Open popup **before** form submission to avoid browser popup blocking
804+ // Open popup **before** form submission to avoid browser popup blocking //
804805 var changelogWindow = window .open (" " , " ChangelogPopup" , " width=800,height=600,scrollbars=1,resizable=1" );
805806
806- if (! changelogWindow) {
807+ if (! changelogWindow)
808+ {
807809 alert (" Popup blocked! Please allow popups for this site to view the changelog." );
808810 return ;
809811 }
@@ -815,19 +817,21 @@ function ShowLatestChangelog() {
815817 changelogWindow .document .write (" </body></html>" );
816818 changelogWindow .document .close ();
817819
818- // Now submit the form (which might trigger a page refresh)
820+ // Now submit the form (which might trigger a page refresh) //
819821 showLoading ();
820822 document .form .submit ();
821823
822- // Delay the AJAX request slightly (but make sure it runs before page refresh)
824+ // Delay the AJAX request slightly (but make sure it runs before page refresh) //
823825 setTimeout (function () {
824826 $ .ajax ({
825827 url: ' /ext/MerlinAU/changelog.htm' ,
826828 dataType: ' text' ,
827829 timeout: 9000 ,
828- success : function (data ) {
829- // Ensure the popup is still open before modifying it
830- if (changelogWindow && ! changelogWindow .closed ) {
830+ success : function (data )
831+ {
832+ // Ensure the popup is still open before modifying it //
833+ if (changelogWindow && ! changelogWindow .closed )
834+ {
831835 changelogWindow .document .open ();
832836 changelogWindow .document .write (" <html><head><title>Latest Changelog</title></head>" );
833837 changelogWindow .document .write (" <body style='font-family:monospace; white-space:pre-wrap;'>" );
@@ -836,8 +840,10 @@ function ShowLatestChangelog() {
836840 changelogWindow .document .close ();
837841 }
838842 },
839- error : function () {
840- if (changelogWindow && ! changelogWindow .closed ) {
843+ error : function ()
844+ {
845+ if (changelogWindow && ! changelogWindow .closed )
846+ {
841847 changelogWindow .document .open ();
842848 changelogWindow .document .write (" <html><head><title>Changelog Error</title></head>" );
843849 changelogWindow .document .write (" <body style='font-family:monospace; white-space:pre-wrap;'>" );
@@ -847,24 +853,25 @@ function ShowLatestChangelog() {
847853 }
848854 }
849855 });
850- }, 8000 ); // Delay slightly to allow form processing, but not too much
856+ }, 8000 ); // Delay slightly to allow form processing, but not too much //
851857}
852858
853859// **Control "Approve/Block Changelog" Checkbox State** //
854- function ToggleChangelogApproval (checkboxElem ) {
855- if (checkboxElem .checked ) {
856- // They are approving
857- if (! confirm (approveChangelogMsge)) {
858- // If user cancels at the confirm prompt, revert checkbox
860+ function ToggleChangelogApproval (checkboxElem )
861+ {
862+ if (checkboxElem .checked )
863+ { // Approving //
864+ if (! confirm (approveChangelogMsge))
865+ {
859866 checkboxElem .checked = false ;
860867 return ;
861868 }
862869 ApproveChangelog ();
863870 }
864- else {
865- // They are blocking
866- if (! confirm (blockChangelogMsge)) {
867- // If user cancels at the confirm prompt, revert checkbox
871+ else
872+ { // Blocking //
873+ if (! confirm (blockChangelogMsge))
874+ {
868875 checkboxElem .checked = true ;
869876 return ;
870877 }
@@ -1650,8 +1657,7 @@ function InitializeFields()
16501657 { fwUpdateEstimatedRunDateElement .innerHTML = InvYLWct + " TBD" + InvCLEAR; }
16511658 }
16521659
1653- // **Handle Changelog Approval Display** //
1654- // Now we handle the new Approve Changelog checkbox
1660+ // Handle Changelog Approval //
16551661 var changelogApprovalElement = document .getElementById (' changelogApproval' );
16561662 if (changelogApprovalElement)
16571663 { // Default to "Disabled" if missing //
@@ -1660,26 +1666,24 @@ function InitializeFields()
16601666 }
16611667
16621668 var approveChangelogCheck = document .getElementById (' approveChangelogCheck' );
1663- if (approveChangelogCheck) {
1669+ if (approveChangelogCheck)
1670+ { // "APPROVED" or "BLOCKED" //
16641671 var isChangelogCheckEnabled = (custom_settings .CheckChangeLog === ' ENABLED' );
1665- var approvalValue = custom_settings .FW_New_Update_Changelog_Approval ; // e.g. "APPROVED" or "BLOCKED"
1672+ var approvalValue = custom_settings .FW_New_Update_Changelog_Approval ;
16661673
1667- // If Changelog Check is disabled, also disable our checkbox
1668- if (! isChangelogCheckEnabled || ! approvalValue || approvalValue === ' TBD' ) {
1674+ // If Changelog Check is disabled, also disable checkbox //
1675+ if (! isChangelogCheckEnabled || ! approvalValue || approvalValue === ' TBD' )
1676+ {
16691677 approveChangelogCheck .disabled = true ;
16701678 approveChangelogCheck .checked = false ;
16711679 }
1672- else {
1680+ else
1681+ {
16731682 approveChangelogCheck .disabled = false ;
1674-
1675- // If the stored approval is "APPROVED", default to checked
1676- if (approvalValue === ' APPROVED' ) {
1677- approveChangelogCheck .checked = true ;
1678- }
1679- // Otherwise, set as unchecked for "BLOCKED," "Disabled," etc.
1680- else {
1681- approveChangelogCheck .checked = false ;
1682- }
1683+ if (approvalValue === ' APPROVED' )
1684+ { approveChangelogCheck .checked = true ; }
1685+ else
1686+ { approveChangelogCheck .checked = false ; }
16831687 }
16841688 }
16851689
0 commit comments