From db0651220af2404e88a4aeae28eef52131f61494 Mon Sep 17 00:00:00 2001 From: Chris Mason Date: Thu, 20 Mar 2025 10:56:06 +0000 Subject: [PATCH] add support for dynamic javascript --- CHANGELOG.md | 4 ++++ jinjafx_server.py | 2 +- www/index.html | 2 +- www/jinjafx_m.js | 16 ++++++++++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dcfe5c..16ea8e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## CHANGELOG +### [25.6.2] - Mar 20, 2025 +- Fixed an issue where `select` tags within JinjaFx Input modals wasn't working when multi-select was enabled + ### [25.6.1] - Mar 20, 2025 - Fixed an issue where JinjaFx Input scripts were removed when the modal was reset - You can now pass `?g` at the end of the URL to trigger auto-generate - you will need to allow popups or use a JinjaFx Input modal @@ -431,6 +434,7 @@ ### 21.11.0 - Nov 29, 2021 - Initial release +[25.6.2]: https://github.com/cmason3/jinjafx_server/compare/25.6.1...25.6.2 [25.6.1]: https://github.com/cmason3/jinjafx_server/compare/25.6.0...25.6.1 [25.6.0]: https://github.com/cmason3/jinjafx_server/compare/25.5.5...25.6.0 [25.5.5]: https://github.com/cmason3/jinjafx_server/compare/25.5.4...25.5.5 diff --git a/jinjafx_server.py b/jinjafx_server.py index 49ef89a..778a161 100755 --- a/jinjafx_server.py +++ b/jinjafx_server.py @@ -27,7 +27,7 @@ import re, argparse, hashlib, traceback, glob, hmac, uuid, struct, binascii, gzip, requests, ctypes, subprocess import cmarkgfm, emoji -__version__ = '25.6.1' +__version__ = '25.6.2' llock = threading.RLock() rlock = threading.RLock() diff --git a/www/index.html b/www/index.html index 711c3bd..a09d326 100644 --- a/www/index.html +++ b/www/index.html @@ -32,7 +32,7 @@ - +
diff --git a/www/jinjafx_m.js b/www/jinjafx_m.js index 6f4fbbc..690428e 100644 --- a/www/jinjafx_m.js +++ b/www/jinjafx_m.js @@ -1501,6 +1501,22 @@ function getStatusText(code) { return ' ' + e; }).join('\r\n'); } + else if (e.tagName == 'SELECT') { + var options = []; + for (var i = 0; i < e.options.length; i++) { + if (e.options[i].selected) { + options.push(e.options[i].value || e.options[i].text); + } + } + if (options.length) { + if (vars.hasOwnProperty(e.dataset.var)) { + vars[e.dataset.var] = vars[e.dataset.var].concat(options); + } + else { + vars[e.dataset.var] = options; + } + } + } else { if (vars.hasOwnProperty(e.dataset.var)) { vars[e.dataset.var].push(v);