aboutsummaryrefslogtreecommitdiff
path: root/p/scripts
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-10-13 15:28:45 +0200
committerGravatar GitHub <noreply@github.com> 2024-10-13 15:28:45 +0200
commitccb132523a4ee740d5b576574e9f44668021fbe6 (patch)
tree0b6977a345c56eff277abb0bc9199b0010f003a8 /p/scripts
parent91624037c7d73eb545478aab2f8abc55fc224453 (diff)
New feed mode: HTML + XPath + JSON dot notation (JSON in HTML) (#6888)
* New feed mode: HTML + XPath + JSON dot notation (JSON in HTML) Same as `JSON+DotNotation` but first extracting the JSON string from an HTML document thanks to an XPath expression. Example: `//script[@type='application/json']` fix https://github.com/FreshRSS/FreshRSS/discussions/6876 * JavaScript UI to show/hide new field * Casing xPathToJson * Slight renaming
Diffstat (limited to 'p/scripts')
-rw-r--r--p/scripts/feed.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/p/scripts/feed.js b/p/scripts/feed.js
index 29af2a3ea..7516f9e51 100644
--- a/p/scripts/feed.js
+++ b/p/scripts/feed.js
@@ -66,9 +66,6 @@ function init_popup_preview_selector() {
});
}
-/**
- * Allow a <select class="select-show"> to hide/show elements defined by <option data-show="elem-id"></option>
- */
function init_disable_elements_on_update(parent) {
const inputs = parent.querySelectorAll('input[data-disable-update]');
for (const input of inputs) {
@@ -90,8 +87,11 @@ function init_select_show(parent) {
const options = select.querySelectorAll('option[data-show]');
const shows = {}; // To allow multiple options to show the same element
for (const option of options) {
- if (!shows[option.dataset.show]) {
- shows[option.dataset.show] = option.selected;
+ const targets = option.dataset.show.split(' '); // Allow multiple targets
+ for (const target of targets) {
+ if (!shows[target]) {
+ shows[target] = option.selected;
+ }
}
}