From a19f740d842c17b7d9e152c9d160ed7936931bbf Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Sun, 28 May 2023 21:43:12 +0100 Subject: [PATCH] Fix broken button to close active content warning --- www/js/lib/uiUtil.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/www/js/lib/uiUtil.js b/www/js/lib/uiUtil.js index e14ca280..dbf2dd74 100644 --- a/www/js/lib/uiUtil.js +++ b/www/js/lib/uiUtil.js @@ -323,14 +323,14 @@ function displayActiveContentWarning(type) { var alertHTML = ''; if (params.contentInjectionMode === 'jquery' && type === 'open') { alertHTML = '
' + - '×' + + '×' + 'Unable to display active content: To use Archive Index type a space, or for URL Index type ' + 'space / , or else switch to Service Worker mode ' + 'if your platform supports it.  [Permanently hide]' + '
'; } else if (params.contentInjectionMode === 'serviceworker' && type === 'legacy') { alertHTML = '
' + - '×' + + '×' + 'Legacy ZIM type! To display content correctly from this historical ZIM, ' + 'please switch to the legacy JQuery mode. ' + 'You may need to increase font size with zoom buttons at bottom of screen. [Permanently hide]' + @@ -338,7 +338,7 @@ function displayActiveContentWarning(type) { } else if (params.contentInjectionMode === 'serviceworker' && (params.manipulateImages || params.displayHiddenBlockElements || params.allowHTMLExtraction)) { alertHTML = '
' + - '×' + + '×' + 'Active content may not work correctly: Please ' + (params.displayHiddenBlockElements ? 'disable Display hidden block elements ' : params.manipulateImages ? 'disable Image manipulation ' : '') + @@ -350,7 +350,7 @@ function displayActiveContentWarning(type) { if (type === 'zimit') { alertHTML = '
' + - '×' + + '×' + // '' + (params.contentInjectionMode === 'jquery' ? 'Limited Zimit' : 'Experimental') + ' support: ' + (params.contentInjectionMode === 'jquery' ? 'Limited Zimit support! Please switch to Service Worker mode if your platform supports it. ' : @@ -363,6 +363,10 @@ function displayActiveContentWarning(type) { var alertBoxHeader = document.getElementById('alertBoxHeader'); alertBoxHeader.innerHTML = alertHTML; alertBoxHeader.style.display = 'block'; + document.getElementById('activeContentClose').addEventListener('click', function () { + // Hide the alert box + alertBoxHeader.style.display = 'none'; + }); ['swModeLink', 'jqModeLink', 'imModeLink', 'hbeModeLink', 'stop'].forEach(function(id) { // Define event listeners for both hyperlinks in alert box: these take the user to the Config tab and highlight // the options that the user needs to select