From a0408a1d1d311d0d210c57999b2625944b99bf5a Mon Sep 17 00:00:00 2001 From: Michael Green <84688932+michael-j-green@users.noreply.github.com> Date: Wed, 20 Sep 2023 12:07:25 +1000 Subject: [PATCH] Added EmulatorJS core selection help link (#124) --- gaseous-server/wwwroot/images/help.svg | 4 ++ .../pages/dialogs/platformmapedit.html | 57 +++++++++++++++++-- .../wwwroot/pages/settings/mapping.html | 2 +- 3 files changed, 57 insertions(+), 6 deletions(-) create mode 100644 gaseous-server/wwwroot/images/help.svg diff --git a/gaseous-server/wwwroot/images/help.svg b/gaseous-server/wwwroot/images/help.svg new file mode 100644 index 0000000..bb8249c --- /dev/null +++ b/gaseous-server/wwwroot/images/help.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/gaseous-server/wwwroot/pages/dialogs/platformmapedit.html b/gaseous-server/wwwroot/pages/dialogs/platformmapedit.html index 47470b4..a4153ee 100644 --- a/gaseous-server/wwwroot/pages/dialogs/platformmapedit.html +++ b/gaseous-server/wwwroot/pages/dialogs/platformmapedit.html @@ -27,7 +27,7 @@

Standard Directory Naming

- + @@ -38,7 +38,7 @@

RetroPie Directory Naming

- + @@ -53,7 +53,7 @@ - +

Engine

@@ -64,12 +64,20 @@ - +

Core

- + + + + + + + + + @@ -129,10 +137,15 @@ if (result.webEmulator.type.length > 0) { document.getElementById('mapping_edit_enablewebemulator').checked = true; $('#mapping_edit_webemulatorengine').val(result.webEmulator.type); + DisplayWebEmulatorHelp(result.webEmulator.type); $('#mapping_edit_webemulatorengine').trigger('change'); document.getElementById('mapping_edit_webemulatorcore').value = result.webEmulator.core; + + DisplayWebEmulatorContent(true); } else { document.getElementById('mapping_edit_enablewebemulator').checked = false; + + DisplayWebEmulatorContent(false); } var biosTableHeaders = [ @@ -254,4 +267,38 @@ JSON.stringify(item) ); } + + $('#mapping_edit_webemulatorengine').on('select2:select', function (e) { + DisplayWebEmulatorHelp(e.params.data.id); + }); + + function DisplayWebEmulatorHelp(Emulator) { + var helpCell = document.getElementById('mapping_edit_webemulatorhelp'); + switch (Emulator) { + case 'EmulatorJS': + helpCell.innerHTML = ' See https://emulatorjs.org/docs4devs/Cores.html for more information regarding EmulatorJS cores.'; + break; + + default: + helpCell.innerHTML = ''; + break; + + } + } + + $('#mapping_edit_enablewebemulator').change(function() { + DisplayWebEmulatorContent(this.checked); + }); + + function DisplayWebEmulatorContent(showContent) { + var webEmulatorRows = document.getElementsByName('mapping_edit_webemulator'); + + for (var i = 0; i < webEmulatorRows.length; i++) { + if (showContent == true) { + webEmulatorRows[i].style.display = ''; + } else { + webEmulatorRows[i].style.display = 'none'; + } + } + } \ No newline at end of file diff --git a/gaseous-server/wwwroot/pages/settings/mapping.html b/gaseous-server/wwwroot/pages/settings/mapping.html index 5e97ae2..83c0bcf 100644 --- a/gaseous-server/wwwroot/pages/settings/mapping.html +++ b/gaseous-server/wwwroot/pages/settings/mapping.html @@ -48,7 +48,7 @@ } var newRow = [ - '' + result[i].igdbName + '', + '' + result[i].igdbName + '', result[i].extensions.supportedFileExtensions.join(', '), result[i].extensions.uniqueFileExtensions.join(', '), hasWebEmulator