summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2022-06-05 11:41:28 +0300
committerAndrew Dolgov <[email protected]>2022-06-05 11:41:28 +0300
commitfc847121352d4b0e54e046473420d35cac255a62 (patch)
treed24fdefd5fd5703c527e56318b5786322b125765
parent185234bc67023640a0890daf69faeaa0df8575da (diff)
pref-filters: add a button to hide or show rules in the filter list
-rwxr-xr-xclasses/pref/filters.php6
-rw-r--r--js/PrefFilterTree.js17
-rw-r--r--themes/compact.css3
-rw-r--r--themes/compact_night.css3
-rw-r--r--themes/light-high-contrast.css3
-rw-r--r--themes/light.css3
-rw-r--r--themes/light/prefs.less6
-rw-r--r--themes/night.css3
-rw-r--r--themes/night_blue.css3
9 files changed, 45 insertions, 2 deletions
diff --git a/classes/pref/filters.php b/classes/pref/filters.php
index 04178f1a6..79dd78993 100755
--- a/classes/pref/filters.php
+++ b/classes/pref/filters.php
@@ -684,10 +684,12 @@ class Pref_Filters extends Handler_Protected {
<?= __('Create filter') ?></button>
<button dojoType="dijit.form.Button" onclick="return dijit.byId('filterTree').joinSelectedFilters()">
<?= __('Combine') ?></button>
- <button dojoType="dijit.form.Button" onclick="return dijit.byId('filterTree').resetFilterOrder()">
- <?= __('Reset sort order') ?></button>
<button dojoType="dijit.form.Button" onclick="return dijit.byId('filterTree').removeSelectedFilters()">
<?= __('Remove') ?></button>
+ <button dojoType="dijit.form.Button" onclick="return dijit.byId('filterTree').resetFilterOrder()">
+ <?= __('Reset sort order') ?></button>
+ <button dojoType="dijit.form.Button" onclick="return dijit.byId('filterTree').toggleRules()">
+ <?= __('Toggle rule display') ?></button>
</div>
</div>
diff --git a/js/PrefFilterTree.js b/js/PrefFilterTree.js
index fff58ff1a..d4496b647 100644
--- a/js/PrefFilterTree.js
+++ b/js/PrefFilterTree.js
@@ -4,6 +4,13 @@
define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], function (declare, domConstruct) {
return declare("fox.PrefFilterTree", lib.CheckBoxTree, {
+ postCreate: function() {
+ this.inherited(arguments);
+
+ dijit.byId('filterTree').hideOrShowFilterRules(
+ parseInt(localStorage.getItem("ttrss:hide-filter-rules"))
+ );
+ },
_createTreeNode: function(args) {
const tnode = this.inherited(arguments);
@@ -96,6 +103,16 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
Notify.close();
});
},
+ hideOrShowFilterRules(hide) {
+ App.findAll("body")[0].setAttribute("hide-filter-rules", !!hide);
+ },
+ toggleRules: function() {
+ const hide = !parseInt(localStorage.getItem("ttrss:hide-filter-rules"));
+
+ this.hideOrShowFilterRules(hide);
+
+ localStorage.setItem("ttrss:hide-filter-rules", hide ? 1 : 0);
+ },
resetFilterOrder: function() {
Notify.progress("Loading, please wait...");
diff --git a/themes/compact.css b/themes/compact.css
index 11e05550d..76a532b15 100644
--- a/themes/compact.css
+++ b/themes/compact.css
@@ -1728,6 +1728,9 @@ body.ttrss_utility fieldset > label.checkbox {
display: inline;
font-weight: normal;
}
+body.ttrss_prefs[hide-filter-rules="true"] ul.filterRules {
+ display: none;
+}
body.ttrss_utility.sanity_failed {
background: #900;
}
diff --git a/themes/compact_night.css b/themes/compact_night.css
index caaea832b..16097ec6e 100644
--- a/themes/compact_night.css
+++ b/themes/compact_night.css
@@ -1728,6 +1728,9 @@ body.ttrss_utility fieldset > label.checkbox {
display: inline;
font-weight: normal;
}
+body.ttrss_prefs[hide-filter-rules="true"] ul.filterRules {
+ display: none;
+}
.flat {
/*#feedTree {
.dijitTreeContent .dijitInline {
diff --git a/themes/light-high-contrast.css b/themes/light-high-contrast.css
index a8a7cab12..8f4729176 100644
--- a/themes/light-high-contrast.css
+++ b/themes/light-high-contrast.css
@@ -1728,6 +1728,9 @@ body.ttrss_utility fieldset > label.checkbox {
display: inline;
font-weight: normal;
}
+body.ttrss_prefs[hide-filter-rules="true"] ul.filterRules {
+ display: none;
+}
body.ttrss_utility.sanity_failed {
background: #900;
}
diff --git a/themes/light.css b/themes/light.css
index 7da617d43..bfd221eef 100644
--- a/themes/light.css
+++ b/themes/light.css
@@ -1728,6 +1728,9 @@ body.ttrss_utility fieldset > label.checkbox {
display: inline;
font-weight: normal;
}
+body.ttrss_prefs[hide-filter-rules="true"] ul.filterRules {
+ display: none;
+}
body.ttrss_utility.sanity_failed {
background: #900;
}
diff --git a/themes/light/prefs.less b/themes/light/prefs.less
index 927181aae..58677a27f 100644
--- a/themes/light/prefs.less
+++ b/themes/light/prefs.less
@@ -300,3 +300,9 @@ body.ttrss_utility {
font-weight : normal;
}
}
+
+body.ttrss_prefs[hide-filter-rules="true"] {
+ ul.filterRules {
+ display : none;
+ }
+}
diff --git a/themes/night.css b/themes/night.css
index aa33e94b3..18c370ee4 100644
--- a/themes/night.css
+++ b/themes/night.css
@@ -1729,6 +1729,9 @@ body.ttrss_utility fieldset > label.checkbox {
display: inline;
font-weight: normal;
}
+body.ttrss_prefs[hide-filter-rules="true"] ul.filterRules {
+ display: none;
+}
.flat {
/*#feedTree {
.dijitTreeContent .dijitInline {
diff --git a/themes/night_blue.css b/themes/night_blue.css
index 458db3616..22ba4fd17 100644
--- a/themes/night_blue.css
+++ b/themes/night_blue.css
@@ -1729,6 +1729,9 @@ body.ttrss_utility fieldset > label.checkbox {
display: inline;
font-weight: normal;
}
+body.ttrss_prefs[hide-filter-rules="true"] ul.filterRules {
+ display: none;
+}
.flat {
/*#feedTree {
.dijitTreeContent .dijitInline {