From 992e4eeed9c1cd5b1e7feb209b9dcbe8b7428d22 Mon Sep 17 00:00:00 2001 From: Jadowyne Ulve Date: Sat, 9 Aug 2025 17:40:24 -0500 Subject: [PATCH] Implemented darkmode in POE module --- application/poe/static/js/receiptsHandler.js | 18 ------------------ .../poe/static/js/transactionHandler.js | 16 ---------------- application/poe/templates/receipts.html | 9 +++++++-- application/poe/templates/scanner.html | 9 +++++++-- 4 files changed, 14 insertions(+), 38 deletions(-) diff --git a/application/poe/static/js/receiptsHandler.js b/application/poe/static/js/receiptsHandler.js index 490caee..88241ff 100644 --- a/application/poe/static/js/receiptsHandler.js +++ b/application/poe/static/js/receiptsHandler.js @@ -303,22 +303,4 @@ async function addPLUToReceipt(item) { data: {'cost': item.cost, 'expires': false} }, type: 'PLU SKU'}) await replenishScannedReceiptTable(scannedReceiptItems) -} - - - -var mode = false -async function toggleDarkMode() { - let darkMode = document.getElementById("dark-mode"); - darkMode.disabled = !darkMode.disabled; - mode = !mode; - if(mode){ - document.getElementById('modeToggle').innerHTML = "light_mode" - document.getElementById('main_html').classList.add('uk-light') - } else { - document.getElementById('modeToggle').innerHTML = "dark_mode" - document.getElementById('main_html').classList.remove('uk-light') - - } - } \ No newline at end of file diff --git a/application/poe/static/js/transactionHandler.js b/application/poe/static/js/transactionHandler.js index e371010..ba24436 100644 --- a/application/poe/static/js/transactionHandler.js +++ b/application/poe/static/js/transactionHandler.js @@ -153,20 +153,4 @@ async function replenishScanTable() { tableRow.append(statusCell, barcodeCell, nameCell, typeCell, locationCell) scanTableBody.append(tableRow) } -} - -var mode = false -async function toggleDarkMode() { - let darkMode = document.getElementById("dark-mode"); - darkMode.disabled = !darkMode.disabled; - mode = !mode; - if(mode){ - document.getElementById('modeToggle').innerHTML = "light_mode" - document.getElementById('main_html').classList.add('uk-light') - } else { - document.getElementById('modeToggle').innerHTML = "dark_mode" - document.getElementById('main_html').classList.remove('uk-light') - - } - } \ No newline at end of file diff --git a/application/poe/templates/receipts.html b/application/poe/templates/receipts.html index cc8bc10..62a9aeb 100644 --- a/application/poe/templates/receipts.html +++ b/application/poe/templates/receipts.html @@ -12,8 +12,9 @@ - - + {% if session['user']['flags']['darkmode'] %} + + {% endif %} @@ -24,7 +25,11 @@ cursor: pointer; } + {% if session['user']['flags']['darkmode'] %} + + {% else %} + {% endif %}