From 0ba6a044543ecd52eba516cc8468c9999736723a Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Mon, 4 Dec 2023 01:21:25 +0100 Subject: [PATCH] version dialog js --- assets/js/sections/version_dialog.js | 39 ++++++++++++++++++---------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/assets/js/sections/version_dialog.js b/assets/js/sections/version_dialog.js index 0004bef8..717cc611 100644 --- a/assets/js/sections/version_dialog.js +++ b/assets/js/sections/version_dialog.js @@ -19,19 +19,30 @@ $('#version_dialog_mode').on('change', function () { showCustomTextarea(); }); +// JavaScript-Funktion displayVersionDialog für Bootstrap 5 function displayVersionDialog() { - BootstrapDialog.show({ - title: 'Stored Queries', - type: BootstrapDialog.TYPE_WARNING, - size: BootstrapDialog.SIZE_NORMAL, - cssClass: 'queries-dialog', - nl2br: false, - message: 'You need to make a query before you search!', - buttons: [{ - label: lang_admin_close, - action: function(dialogItself) { - dialogItself.close(); - } - }] + + $.ajax({ + url: base_url + "index.php/Version_Dialog/displayVersionDialog", + type: 'GET', + dataType: 'html', + success: function(data) { + $('body').append(data); + + // Aktiviere das Bootstrap-Modal + var versionDialogModal = new bootstrap.Modal(document.getElementById('versionDialogModal')); + versionDialogModal.show(); + }, + error: function() { + // Behandlung von Fehlern + console.log('Fehler beim Laden der PHP-Datei.'); + } }); -} \ No newline at end of file +} + +function dismissVersionDialog() { + $.ajax({ + url: base_url + 'index.php/user_options/dismissVersionDialog', + method: 'POST', + }); +}