luci-app-adblock: sync with adblock-4.2.1
authorDirk Brenken <dev@brenken.org>
Sun, 11 Aug 2024 07:52:10 +0000 (09:52 +0200)
committerDirk Brenken <dev@brenken.org>
Sun, 11 Aug 2024 07:52:10 +0000 (09:52 +0200)
* added full 1Hosts support

Signed-off-by: Dirk Brenken <dev@brenken.org>
(cherry picked from commit 06037ad777ab0500008c49bcb2c06af309bc4e51)
Signed-off-by: Dirk Brenken <dev@brenken.org>
applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js

index 744d2d51b69037bf9f582ba581bbe882d3adda86..f79a828d8f30971de87348c5d71ffe2e55acbd9f 100644 (file)
@@ -613,6 +613,22 @@ return view.extend({
                o.optional = true;
                o.rmempty = true;
 
+               o = s.taboption('sources', form.DummyValue, '_sub');
+               o.rawhtml = true;
+               o.default = '<em><b>1Hosts List Selection</b></em>';
+
+               o = s.taboption('sources', form.DynamicList, 'adb_hst_sources', _('Variants'));
+               for (var i = 0; i < categories.length; i++) {
+                       code = categories[i].match(/^(\w+);/)[1].trim();
+                       if (code === 'hst') {
+                               list = categories[i].match(/^\w+;(.*);/)[1].trim();
+                               path = categories[i].match(/^.*;(.*$)/)[1].trim();
+                               o.value(path, list);
+                       }
+               }
+               o.optional = true;
+               o.rmempty = true;
+
                return m.render();
        },
        handleReset: null